diff options
Diffstat (limited to 'src/astnode.h')
| -rw-r--r-- | src/astnode.h | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/src/astnode.h b/src/astnode.h index 9584788..1054a2b 100644 --- a/src/astnode.h +++ b/src/astnode.h | |||
| @@ -5,30 +5,33 @@ | |||
| 5 | 5 | ||
| 6 | class AstNode | 6 | class AstNode |
| 7 | { | 7 | { |
| 8 | friend Bu::Formatter &operator<<( Bu::Formatter &f, const AstNode &n ); | ||
| 8 | public: | 9 | public: |
| 9 | enum Type | 10 | enum Type |
| 10 | { | 11 | { |
| 11 | tLeaf = 0x01000000, | 12 | tLeaf = 0x01000000, |
| 12 | tVarName = 0x01000001, | 13 | tNot = 0x01000001, |
| 13 | tLiteral = 0x01000002, | 14 | tComp = 0x01000002, |
| 14 | tFuncName = 0x01000003, | 15 | tCompGt = 0x01000003, |
| 15 | tNot = 0x01000004, | 16 | tCompLt = 0x01000004, |
| 16 | tComp = 0x01000005, | 17 | tCompGtEq = 0x01000005, |
| 17 | tCompGt = 0x01000006, | 18 | tCompLtEq = 0x01000006, |
| 18 | tCompLt = 0x01000007, | 19 | tStore = 0x01000007, |
| 19 | tCompGtEq = 0x01000008, | 20 | tAnd = 0x01000008, |
| 20 | tCompLtEq = 0x01000009, | 21 | tOr = 0x01000009, |
| 21 | tStore = 0x0100000A, | 22 | |
| 22 | tAnd = 0x0100000B, | 23 | tLeafLiteral = 0x02000000, |
| 23 | tOr = 0x0100000C, | 24 | tVarName = 0x02000001, |
| 24 | 25 | tLiteral = 0x02000002, | |
| 25 | tBranch = 0x02000000, | 26 | tFuncName = 0x02000003, |
| 26 | tScope = 0x02000001, | 27 | |
| 27 | tIf = 0x02000002, | 28 | tBranch = 0x04000000, |
| 28 | tForEach = 0x02000003, | 29 | tScope = 0x04000001, |
| 29 | tWhile = 0x02000004, | 30 | tIf = 0x04000002, |
| 30 | 31 | tForEach = 0x04000003, | |
| 31 | tTypeMask = 0x03000000, | 32 | tWhile = 0x04000004, |
| 33 | |||
| 34 | tTypeMask = 0x07000000, | ||
| 32 | }; | 35 | }; |
| 33 | 36 | ||
| 34 | AstNode( Type eType ); | 37 | AstNode( Type eType ); |
| @@ -40,4 +43,7 @@ private: | |||
| 40 | Type eType; | 43 | Type eType; |
| 41 | }; | 44 | }; |
| 42 | 45 | ||
| 46 | Bu::Formatter &operator<<( Bu::Formatter &f, AstNode::Type t ); | ||
| 47 | Bu::Formatter &operator<<( Bu::Formatter &f, const AstNode &n ); | ||
| 48 | |||
| 43 | #endif | 49 | #endif |
