defBlock.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "core/ast/scope.hpp"
6
7namespace by {
8
9 class defVarExpr;
10
15 class _nout defBlock: public instance {
16 BY(CLASS(defBlock, instance))
17
18 public:
19 defBlock();
20
21 public:
22 me& addCommon(node& stmt);
23 me& addCommon(node* it) BY_SIDE_FUNC(it, addCommon(*it), *this);
24
25 me& addScope(const std::string& name, node& stmt);
26 me& addScope(const std::string* name, node& stmt) BY_SIDE_FUNC(name, addScope(*name, stmt), *this);
27 me& addScope(const std::string& name, node* it) BY_SIDE_FUNC(it, addScope(name, *it), *this);
28 me& addScope(const std::string* name, node* stmt) BY_SIDE_FUNC(name&& stmt, addScope(*name, *stmt), *this);
29
30 me& expand(node& stmt);
31 me& expand(node* it) BY_SIDE_FUNC(it, expand(*it), *this);
32
33 const narr& getExpands() const;
34 scope& getScope();
35 const scope& getScope() const BY_CONST_FUNC(getScope())
36 const narr& getCommon() const;
37
38 private:
39 tstr<scope> _scope;
40 tstr<narr> _common;
41 tstr<narr> _expands;
42 };
43}
Definition block for organizing object definitions.
Definition: defBlock.hpp:15
Base class for all managed instances in memlite system.
Definition: instance.hpp:20
Base class for all AST nodes in byeol language.
Definition: node.hpp:30
Strong reference smart pointer with strict type checking.
Definition: tstr.hpp:13