aboutsummaryrefslogtreecommitdiff
path: root/src/astnode.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/astnode.h174
1 files changed, 87 insertions, 87 deletions
diff --git a/src/astnode.h b/src/astnode.h
index 843dba8..f3b2d70 100644
--- a/src/astnode.h
+++ b/src/astnode.h
@@ -7,101 +7,101 @@
7class AstNode 7class AstNode
8{ 8{
9public: 9public:
10 enum Type 10 enum Type
11 { 11 {
12 // Branching types 12 // Branching types
13 typeFunction = 0x100001, 13 typeFunction = 0x100001,
14 typeSet = 0x100002, 14 typeSet = 0x100002,
15 typeUnset = 0x100003, 15 typeUnset = 0x100003,
16 typeIf = 0x100004, 16 typeIf = 0x100004,
17 typeInclude = 0x100005, 17 typeInclude = 0x100005,
18 typeTarget = 0x100006, 18 typeTarget = 0x100006,
19 typeRule = 0x100007, 19 typeRule = 0x100007,
20 typeConfig = 0x100008, 20 typeConfig = 0x100008,
21 typeList = 0x100009, 21 typeList = 0x100009,
22 typeInlineFunc = 0x10000A, 22 typeInlineFunc = 0x10000A,
23 typeRequires = 0x10000B, 23 typeRequires = 0x10000B,
24 typeFor = 0x10000C, 24 typeFor = 0x10000C,
25 typeFunctionDef = 0x10000D, 25 typeFunctionDef = 0x10000D,
26 typeReturn = 0x10000E, 26 typeReturn = 0x10000E,
27 typeProfile = 0x10000F, 27 typeProfile = 0x10000F,
28 typeInput = 0x100010, 28 typeInput = 0x100010,
29 typeRuleDef = 0x100011, 29 typeRuleDef = 0x100011,
30 typeOutput = 0x100012, 30 typeOutput = 0x100012,
31 typeAutoConfig = 0x100013, 31 typeAutoConfig = 0x100013,
32 typeGlobalConfig = 0x100014, 32 typeGlobalConfig = 0x100014,
33 typeType = 0x100015, 33 typeType = 0x100015,
34 typeValue = 0x100016, 34 typeValue = 0x100016,
35 typeAllow = 0x100017, 35 typeAllow = 0x100017,
36 typeDefault = 0x100018, 36 typeDefault = 0x100018,
37 typeExport = 0x100019, 37 typeExport = 0x100019,
38 typeExpr = 0x10001A, /***< Stack based compound expression.*/ 38 typeExpr = 0x10001A, /***< Stack based compound expression.*/
39 typeActionDef = 0x10001B, 39 typeActionDef = 0x10001B,
40 typeProcessTarget = 0x10001C, 40 typeProcessTarget = 0x10001C,
41 typeTag = 0x10001D, 41 typeTag = 0x10001D,
42 42
43 // Leaf types 43 // Leaf types
44 typeVariable = 0x210001, 44 typeVariable = 0x210001,
45 typeString = 0x210002, 45 typeString = 0x210002,
46 typeInt = 0x220003, 46 typeInt = 0x220003,
47 typeFloat = 0x230004, 47 typeFloat = 0x230004,
48 typeBool = 0x240005, 48 typeBool = 0x240005,
49 typeVersion = 0x250006, 49 typeVersion = 0x250006,
50 typeOpEq = 0x200007, 50 typeOpEq = 0x200007,
51 typeOpPlusEq = 0x200008, 51 typeOpPlusEq = 0x200008,
52 typeOpPlusEqRaw = 0x200009, 52 typeOpPlusEqRaw = 0x200009,
53 typeError = 0x21000A, 53 typeError = 0x21000A,
54 typeWarning = 0x21000B, 54 typeWarning = 0x21000B,
55 typeNotice = 0x21000C, 55 typeNotice = 0x21000C,
56 typeTypeString = 0x20000D, 56 typeTypeString = 0x20000D,
57 typeTypeInt = 0x20000E, 57 typeTypeInt = 0x20000E,
58 typeTypeFloat = 0x20000F, 58 typeTypeFloat = 0x20000F,
59 typeTypeBool = 0x200010, 59 typeTypeBool = 0x200010,
60 typeTypeVersion = 0x200011, 60 typeTypeVersion = 0x200011,
61 typeCmpEq = 0x200012, 61 typeCmpEq = 0x200012,
62 typeCmpLt = 0x200013, 62 typeCmpLt = 0x200013,
63 typeCmpGt = 0x200014, 63 typeCmpGt = 0x200014,
64 typeCmpNe = 0x200015, 64 typeCmpNe = 0x200015,
65 typeCmpLtEq = 0x200016, 65 typeCmpLtEq = 0x200016,
66 typeCmpGtEq = 0x200017, 66 typeCmpGtEq = 0x200017,
67 typeCondition = 0x210018, 67 typeCondition = 0x210018,
68 typeDisplay = 0x210019, 68 typeDisplay = 0x210019,
69 typeCache = 0x24001A, 69 typeCache = 0x24001A,
70 typePushPrefix = 0x21001B, 70 typePushPrefix = 0x21001B,
71 typePopPrefix = 0x20001C, 71 typePopPrefix = 0x20001C,
72 typeNull = 0x20001D, 72 typeNull = 0x20001D,
73 typeVariableRef = 0x21001E, 73 typeVariableRef = 0x21001E,
74 typeOpPlus = 0x20001F, 74 typeOpPlus = 0x20001F,
75 typeOpMinus = 0x200020, 75 typeOpMinus = 0x200020,
76 typeOpMultiply = 0x200021, 76 typeOpMultiply = 0x200021,
77 typeOpDivide = 0x200022, 77 typeOpDivide = 0x200022,
78 typeOpNegate = 0x200023, 78 typeOpNegate = 0x200023,
79 typeOpNot = 0x200024, 79 typeOpNot = 0x200024,
80 80
81 typeBranch = 0x100000, 81 typeBranch = 0x100000,
82 typeLeaf = 0x200000, 82 typeLeaf = 0x200000,
83 typeClassMask = 0x300000, 83 typeClassMask = 0x300000,
84 84
85 typeDataNone = 0x000000, 85 typeDataNone = 0x000000,
86 typeDataString = 0x010000, 86 typeDataString = 0x010000,
87 typeDataInt = 0x020000, 87 typeDataInt = 0x020000,
88 typeDataFloat = 0x030000, 88 typeDataFloat = 0x030000,
89 typeDataBool = 0x040000, 89 typeDataBool = 0x040000,
90 typeDataVersion = 0x050000, 90 typeDataVersion = 0x050000,
91 91
92 typeDataMask = 0x0F0000 92 typeDataMask = 0x0F0000
93 }; 93 };
94public: 94public:
95 AstNode( const Location &loc, Type eType ); 95 AstNode( const Location &loc, Type eType );
96 virtual ~AstNode(); 96 virtual ~AstNode();
97 97
98 Type getType() const { return eType; } 98 Type getType() const { return eType; }
99 Type getClass() const { return (Type)(eType&typeClassMask); } 99 Type getClass() const { return (Type)(eType&typeClassMask); }
100 Type getDataType() const { return (Type)(eType&typeDataMask); } 100 Type getDataType() const { return (Type)(eType&typeDataMask); }
101 101
102private: 102private:
103 Type eType; 103 Type eType;
104 Location loc; 104 Location loc;
105}; 105};
106 106
107Bu::Formatter &operator<<( Bu::Formatter &f, const AstNode &n ); 107Bu::Formatter &operator<<( Bu::Formatter &f, const AstNode &n );