getExpr.hpp
Go to the documentation of this file.
1
2
3#pragma once
4
5#include "core/ast/expr.hpp"
6#include "core/ast/params.hpp"
7
8namespace by {
9
10 class visitor;
11 class closure;
12
17 class _nout getExpr: public expr {
18 BY(CLASS(getExpr, expr, expr::exprType), VISIT())
19 friend class verifier;
20 friend class parser;
21 friend class visitor; // for _me
22 friend class generalizer; // for _args
23 friend class closure; // for `_evalMe()`
24
25 public:
26 getExpr(const std::string& name);
27 getExpr(const std::string& name, const args& a);
28 getExpr(const node& me, const std::string& name);
29 getExpr(const node& me, const std::string& name, const args& a);
30
31 public:
32 using super::run;
33 str run(const args& a) override;
34
35 str getEval() const override;
36 const node* getMe() const;
37 const std::string& getName() const;
38 void setName(const std::string& new1);
39 void setName(const std::string* it) BY_SIDE_FUNC(setName) void setMe(const node& newMe);
40
42 const args& getArgs() const;
43 void setArgs(const args& new1);
44
45 void onCloneDeep(const clonable& new1) override;
46
47 protected:
48 virtual node* _onGet(node& me) const;
49 virtual node* _onGet(node* it) const BY_SIDE_FUNC(it, _onGet(*it), nullptr);
50
51 private:
52 str _get(nbool evalMode) const;
53 str _evalMe(nbool evalMode) const;
54
55 private:
56 str _me;
57 std::string _name;
58 tstr<args> _args;
59 };
60} // namespace by
Function call arguments container.
Definition: args.hpp:13
Interface for objects that can be cloned.
Definition: clonable.hpp:12
func closure with captured object scope
Definition: closure.hpp:19
Type information for expression nodes
Definition: expr.hpp:22
Base class for all expressions.
Definition: expr.hpp:15
Visitor for generic type parameter replacement.
Definition: generalizer.hpp:13
Expression for property and method access.
Definition: getExpr.hpp:17
const args & getArgs() const
str getEval() const override
Base class for all AST nodes in byeol language.
Definition: node.hpp:30
Parser for byeol language source code.
Definition: parser.hpp:43
AST verifier for semantic analysis.
Definition: verifier.hpp:20
Base visitor class for AST traversal.
Definition: visitor.hpp:20