Loading...
Searching...
No Matches
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
17 class _nout loopExpr: public expr {
19
20 public:
25 class _nout loop: public instance {
26 BY(ADT(loop))
27
28 public:
29 loop(arr* ret);
30
31 public:
35 virtual nbool isLooping() = 0;
41 virtual void eval(blockExpr& blk, frame& fr);
42 arr* getRet();
48 virtual nbool postprocess(frame& fr);
49
50
51 private:
52 tstr<arr> _ret;
53 };
54
55 public:
57
58 public:
59 blockExpr* getBlock() const;
60 str infer() const override;
61
62 using super::eval;
63 str eval(const args& a) override;
64
65 protected:
73 virtual tstr<loop> _makeLoop(arr* ret) const = 0;
80 virtual str _makeEval() const;
81
82 private:
83 tstr<arr> _makeRet() const;
84
85 private:
86 mutable tstr<blockExpr> _blk;
87 mutable str _eval;
88 };
89} // namespace by
Function or object evaluation arguments.
Definition args.hpp:22
Scripted array container for byeol language.
Definition arr.hpp:15
Block expression.
Definition blockExpr.hpp:24
Type information for expression nodes
Definition expr.hpp:45
Base class for all expressions.
Definition expr.hpp:36
Execution frame.
Definition frame.hpp:52
Base class for loop expressions.
Definition loopExpr.hpp:17
virtual str _makeEval() const
Protected virtual method to create the evaluation block for the loop body.
virtual tstr< loop > _makeLoop(arr *ret) const =0
Protected pure virtual method to create the loop controller.
str infer() const override
Definition tnarr.hpp:9
loopExpr(const blockExpr &blk)
Loop execution controller.
to Top