loopExpr.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "core/ast/expr.hpp"
6
7namespace by {
8
9 class frame;
10 class arr;
11
16 class _nout loopExpr: public expr {
17 BY(ADT(loopExpr, expr, expr::exprType), VISIT())
18 friend class loop;
19
20 public:
24 class _nout loop: public instance {
25 BY(ADT(loop))
26
27 public:
28 loop(arr* ret);
29
30 public:
32 virtual nbool isLooping() = 0;
33 virtual void run(blockExpr& blk, frame& fr);
34 arr* getRet();
35 virtual nbool postprocess(frame& fr);
36
37
38 private:
39 tstr<arr> _ret;
40 };
41
42 public:
43 loopExpr(const blockExpr& blk);
44
45 public:
46 blockExpr* getBlock() const;
47 str getEval() const override;
48
49 using super::run;
50 str run(const args& a) override;
51
52 protected:
53 virtual tstr<loop> _makeLoop(arr* ret) const = 0;
54 virtual str _makeEval() const;
55
56 private:
57 tstr<arr> _makeRet() const;
58
59 private:
60 mutable tstr<blockExpr> _blk;
61 mutable str _eval;
62 };
63} // namespace by
Function call arguments container.
Definition: args.hpp:13
Managed array container for byeol language.
Definition: arr.hpp:14
Block expression containing multiple statements.
Definition: blockExpr.hpp:15
Type information for expression nodes
Definition: expr.hpp:22
Base class for all expressions.
Definition: expr.hpp:15
Execution frame for byeol runtime.
Definition: frame.hpp:29
Base class for all managed instances in memlite system.
Definition: instance.hpp:20
Loop execution controller.
Definition: loopExpr.hpp:24
virtual nbool isLooping()=0
Base class for loop expressions.
Definition: loopExpr.hpp:16
str getEval() const override
Strong reference smart pointer with strict type checking.
Definition: tstr.hpp:13