로딩중...
검색중...
일치하는것 없음
ifExpr.hpp
이 파일의 문서화 페이지로 가기
1
2#pragma once
3
4#include "core/ast/expr.hpp"
6
7namespace by {
8
14 class _nout ifExpr: public expr {
16
17 public:
18 ifExpr(const node& exp, const blockExpr& thenBlk);
19 ifExpr(const node& exp, const blockExpr& thenBlk, const blockExpr& elseBlk);
20
21 public:
22 blockExpr& getThen();
23 const blockExpr& getThen() const BY_CONST_FUNC(getThen())
24 void setThen(const blockExpr& newThen);
25 void setThen(const blockExpr* it) BY_SIDE_FUNC(setThen);
26
27 blockExpr* getElse();
28 const blockExpr* getElse() const BY_CONST_FUNC(getElse())
29 void setElse(const blockExpr& newElse);
30 void setElse(const blockExpr* it) BY_SIDE_FUNC(setElse);
31
32 node& getCondition();
33 const node& getCondition() const BY_CONST_FUNC(getCondition())
34 void setCondition(const node& newCondition);
35 void setCondition(const node* it) BY_SIDE_FUNC(setCondition);
36
37 using super::eval;
38 str eval(const args& a) override;
39
40 str infer() const override;
41
42 private:
43 str _expr;
44 tstr<blockExpr> _then;
45 tstr<blockExpr> _else;
46 };
47} // namespace by
Function or object evaluation arguments
Definition args.hpp:22
Block expression
Definition blockExpr.hpp:24
Type information for expression nodes
Definition expr.hpp:45
Base class for all expressions
Definition expr.hpp:36
If conditional expression
Definition ifExpr.hpp:14
str infer() const override
Base class for all AST nodes in the byeol language
Definition node.hpp:195
Definition tnarr.hpp:9
to Top