thread.hpp
Go to the documentation of this file.
1
2#pragma once
3
8
9struct exprTest;
10
11namespace by {
12
13 class slotLoader;
14
19 class _nout thread: public node, public dumpable {
20 BY(CLASS(thread, node))
21 friend class verifier; // for frames
22 friend class baseObj; // for frames.
23 friend class func; // for frames.
24 friend class blockExpr; // for frames.
25 friend class defPropExpr;
26 friend class defVarExpr;
27 friend class defNestedFuncExpr;
28 friend class assignExpr;
29 friend class verifier;
30 friend class runExpr;
31 friend class baseFunc; // for frames.
32 friend class forExpr;
33 friend class whileExpr;
34 friend class retStateExpr;
35 friend class starter;
36 friend struct ::exprTest;
37 friend class loopExpr;
38 friend class closure; // for _getFrames()
39
40 public:
41 thread();
42 thread(const errReport& new1);
43
44 public:
45 const frames& getFrames() const BY_CONST_FUNC(_getFrames())
46 const frame* getNowFrame() const BY_CONST_FUNC(_getNowFrame())
47
48 static thread& get();
49 static void set(thread* new1);
50 static void set(thread& new1);
51 static const instancer* getInstancer();
52
56 const errReport& getEx() const BY_CONST_FUNC(getEx())
57 virtual void setEx(const errReport& new1);
58 void setEx(const errReport* it) BY_SIDE_FUNC(setEx);
59
60 // node:
61 scope& subs() override;
62
63 using super::prioritize;
64 priorType prioritize(const args& a) const override;
65
66 using super::run;
67 str run(const args& a) override;
68
69 void rel() override;
70
73 const nmap& getSlots() const;
74
75 void dump() const override;
76
77 virtual nbool isInteractable() const;
78
79 protected:
80 virtual frames& _getFrames();
81 frame* _getNowFrame();
82
83 private:
84 void _loadBuiltIns(nmap& tray) const;
85 tstr<nmap> _initSlots() const;
86
87 private:
88 frames _frames;
89 tstr<errReport> _ex;
90 };
91} // namespace by
Function call arguments container.
Definition: args.hpp:13
Assignment expression for variable assignment.
Definition: assignExpr.hpp:16
Base class for all function types.
Definition: baseFunc.hpp:18
Base class for all objects in byeol language.
Definition: baseObj.hpp:24
Block expression containing multiple statements.
Definition: blockExpr.hpp:15
func closure with captured object scope
Definition: closure.hpp:19
Nested func definition expression (lambda)
Definition: defNestedFuncExpr.hpp:13
Property definition expression.
Definition: defPropExpr.hpp:11
Variable definition expression base class.
Definition: defVarExpr.hpp:17
Interface for objects that can dump their state.
Definition: dumpable.hpp:12
Error reporting and collection system.
Definition: errReport.hpp:14
For loop expression.
Definition: forExpr.hpp:14
Execution frame for byeol runtime.
Definition: frame.hpp:29
Container for execution frame stack.
Definition: frames.hpp:11
Function definition in byeol language.
Definition: func.hpp:20
Singleton manager for instance lifecycle and memory allocation.
Definition: instancer.hpp:13
Base class for loop expressions.
Definition: loopExpr.hpp:16
Base class for all AST nodes in byeol language.
Definition: node.hpp:30
Base class for return state expressions.
Definition: retStateExpr.hpp:19
Function/method call expression.
Definition: runExpr.hpp:14
Program execution starter.
Definition: starter.hpp:14
Thread execution context for byeol runtime.
Definition: thread.hpp:19
errReport & getEx()
Definition: tnmap.hpp:11
AST verifier for semantic analysis.
Definition: verifier.hpp:20
While loop expression.
Definition: whileExpr.hpp:12
priorType
the lower value, the higher priority.
Definition: tpriorities.hpp:8