origin.hpp
Go to the documentation of this file.
1
2#pragma once
3
5#include "core/ast/obj.hpp"
6
7namespace by {
8
9 class src;
10 class runExpr;
11
17 class _nout origin final: public obj {
18 BY(ME(origin, obj), INIT_META(origin))
19
20 public:
21 friend class genericOrigin; // for _setOrigin(), _setType
22 friend class slot; // for _onRunSub
23 friend class expander;
24 friend class exprMaker;
25 friend class parser;
26
27 public:
28 explicit origin(const mgdType& newType);
29 explicit origin(const mgdType& newType, const node& subpack);
30 explicit origin(const me& rhs);
31
32 public:
33 me& operator=(const me& rhs);
34
35 public:
36 using super::subs;
37 scope& subs() override;
38
39 state getState() const override;
40 void setState(state new1) override;
41 const ntype& getType() const override;
42 const node& getSubPack() const override;
43 const src& getSrc() const override;
44 void onCloneDeep(const clonable& from) override;
45 baseObj* make() const override;
46
47 using super::getCallComplete;
48 node* getCallComplete() override;
49
50 void setCallComplete(const node& new1);
51 void setCallComplete(const node* it) BY_SIDE_FUNC(setCallComplete);
52
53 nbool isComplete() const override;
54 clonable* clone() const override;
55 clonable* cloneDeep() const override;
56
57 private:
58 void _setType(const mgdType& new1) override;
59 void _setSubPack(const node& newSub);
60 void _setSrc(const src& s) override;
61 void _setModifier(const modifier& mod) override;
62 me& _assign(const me& rhs);
63 void _runCallComplete();
64
65 private:
66 mgdType _type; // TODO: memory leak
67 str _subpack;
68 tstr<src> _src;
69 tstr<modifier> _mod;
70 str _callComplete;
71 state _state;
72 };
73} // namespace by
Base class for all objects in byeol language.
Definition: baseObj.hpp:24
Interface for objects that can be cloned.
Definition: clonable.hpp:12
Visitor for expanding generic types and expressions.
Definition: expander.hpp:13
Factory for creating expressions with source location information.
Definition: exprMaker.hpp:17
Generic type origin with type parameters.
Definition: genericOrigin.hpp:15
Managed type for byeol objects.
Definition: mgdType.hpp:17
Access modifier for class members and func.
Definition: modifier.hpp:12
Base class for all AST nodes in byeol language.
Definition: node.hpp:30
Native type system for byeol language.
Definition: ntype.hpp:19
Managed object in byeol programming environment.
Definition: obj.hpp:19
User-defined class origin in byeol language.
Definition: origin.hpp:17
nbool isComplete() const override
Parser for byeol language source code.
Definition: parser.hpp:43
Pack slot for loading and management.
Definition: slot.hpp:16
Source location information.
Definition: src.hpp:11