diff options
Diffstat (limited to '')
-rw-r--r-- | src/astnode.cpp | 184 |
1 files changed, 92 insertions, 92 deletions
diff --git a/src/astnode.cpp b/src/astnode.cpp index 87b9383..1e86bdd 100644 --- a/src/astnode.cpp +++ b/src/astnode.cpp | |||
@@ -3,8 +3,8 @@ | |||
3 | #include "astbranch.h" | 3 | #include "astbranch.h" |
4 | 4 | ||
5 | AstNode::AstNode( const Location &loc, Type eType ) : | 5 | AstNode::AstNode( const Location &loc, Type eType ) : |
6 | eType( eType ), | 6 | eType( eType ), |
7 | loc( loc ) | 7 | loc( loc ) |
8 | { | 8 | { |
9 | } | 9 | } |
10 | 10 | ||
@@ -14,101 +14,101 @@ AstNode::~AstNode() | |||
14 | 14 | ||
15 | Bu::Formatter &operator<<( Bu::Formatter &f, const AstNode &n ) | 15 | Bu::Formatter &operator<<( Bu::Formatter &f, const AstNode &n ) |
16 | { | 16 | { |
17 | f << n.getType(); | 17 | f << n.getType(); |
18 | if( n.getClass() == AstNode::typeBranch ) | 18 | if( n.getClass() == AstNode::typeBranch ) |
19 | { | 19 | { |
20 | f << *dynamic_cast<const AstBranch *>(&n); | 20 | f << *dynamic_cast<const AstBranch *>(&n); |
21 | } | 21 | } |
22 | else | 22 | else |
23 | { | 23 | { |
24 | f << *dynamic_cast<const AstLeaf *>(&n); | 24 | f << *dynamic_cast<const AstLeaf *>(&n); |
25 | } | 25 | } |
26 | return f; | 26 | return f; |
27 | } | 27 | } |
28 | 28 | ||
29 | Bu::Formatter &operator<<( Bu::Formatter &f, const AstNode::Type &t ) | 29 | Bu::Formatter &operator<<( Bu::Formatter &f, const AstNode::Type &t ) |
30 | { | 30 | { |
31 | switch( t ) | 31 | switch( t ) |
32 | { | 32 | { |
33 | case AstNode::typeFunction: f << "Function"; break; | 33 | case AstNode::typeFunction: f << "Function"; break; |
34 | case AstNode::typeSet: f << "Set"; break; | 34 | case AstNode::typeSet: f << "Set"; break; |
35 | case AstNode::typeUnset: f << "Unset"; break; | 35 | case AstNode::typeUnset: f << "Unset"; break; |
36 | case AstNode::typeIf: f << "If"; break; | 36 | case AstNode::typeIf: f << "If"; break; |
37 | case AstNode::typeInclude: f << "Include"; break; | 37 | case AstNode::typeInclude: f << "Include"; break; |
38 | case AstNode::typeTarget: f << "Target"; break; | 38 | case AstNode::typeTarget: f << "Target"; break; |
39 | case AstNode::typeRule: f << "Rule"; break; | 39 | case AstNode::typeRule: f << "Rule"; break; |
40 | case AstNode::typeConfig: f << "Config"; break; | 40 | case AstNode::typeConfig: f << "Config"; break; |
41 | case AstNode::typeList: f << "List"; break; | 41 | case AstNode::typeList: f << "List"; break; |
42 | case AstNode::typeInlineFunc: f << "InlineFunc"; break; | 42 | case AstNode::typeInlineFunc: f << "InlineFunc"; break; |
43 | case AstNode::typeRequires: f << "Requires"; break; | 43 | case AstNode::typeRequires: f << "Requires"; break; |
44 | case AstNode::typeFor: f << "For"; break; | 44 | case AstNode::typeFor: f << "For"; break; |
45 | case AstNode::typeFunctionDef: f << "FunctionDef"; break; | 45 | case AstNode::typeFunctionDef: f << "FunctionDef"; break; |
46 | case AstNode::typeReturn: f << "Return"; break; | 46 | case AstNode::typeReturn: f << "Return"; break; |
47 | case AstNode::typeProfile: f << "Profile"; break; | 47 | case AstNode::typeProfile: f << "Profile"; break; |
48 | case AstNode::typeInput: f << "Input"; break; | 48 | case AstNode::typeInput: f << "Input"; break; |
49 | case AstNode::typeRuleDef: f << "RuleDef"; break; | 49 | case AstNode::typeRuleDef: f << "RuleDef"; break; |
50 | case AstNode::typeOutput: f << "Output"; break; | 50 | case AstNode::typeOutput: f << "Output"; break; |
51 | case AstNode::typeAutoConfig: f << "AutoConfig"; break; | 51 | case AstNode::typeAutoConfig: f << "AutoConfig"; break; |
52 | case AstNode::typeGlobalConfig: f << "GlobalConfig"; break; | 52 | case AstNode::typeGlobalConfig: f << "GlobalConfig"; break; |
53 | case AstNode::typeType: f << "Type"; break; | 53 | case AstNode::typeType: f << "Type"; break; |
54 | case AstNode::typeValue: f << "Value"; break; | 54 | case AstNode::typeValue: f << "Value"; break; |
55 | case AstNode::typeAllow: f << "Allow"; break; | 55 | case AstNode::typeAllow: f << "Allow"; break; |
56 | case AstNode::typeDefault: f << "Default"; break; | 56 | case AstNode::typeDefault: f << "Default"; break; |
57 | case AstNode::typeExport: f << "Export"; break; | 57 | case AstNode::typeExport: f << "Export"; break; |
58 | case AstNode::typeExpr: f << "Expr"; break; | 58 | case AstNode::typeExpr: f << "Expr"; break; |
59 | case AstNode::typeActionDef: f << "ActionDef"; break; | 59 | case AstNode::typeActionDef: f << "ActionDef"; break; |
60 | case AstNode::typeProcessTarget:f << "ProcessTarget"; break; | 60 | case AstNode::typeProcessTarget:f << "ProcessTarget"; break; |
61 | case AstNode::typeTag: f << "Tag"; break; | 61 | case AstNode::typeTag: f << "Tag"; break; |
62 | 62 | ||
63 | case AstNode::typeVariable: f << "Variable"; break; | 63 | case AstNode::typeVariable: f << "Variable"; break; |
64 | case AstNode::typeString: f << "String"; break; | 64 | case AstNode::typeString: f << "String"; break; |
65 | case AstNode::typeInt: f << "Int"; break; | 65 | case AstNode::typeInt: f << "Int"; break; |
66 | case AstNode::typeFloat: f << "Float"; break; | 66 | case AstNode::typeFloat: f << "Float"; break; |
67 | case AstNode::typeBool: f << "Bool"; break; | 67 | case AstNode::typeBool: f << "Bool"; break; |
68 | case AstNode::typeVersion: f << "Version"; break; | 68 | case AstNode::typeVersion: f << "Version"; break; |
69 | case AstNode::typeOpEq: f << "Operator ="; break; | 69 | case AstNode::typeOpEq: f << "Operator ="; break; |
70 | case AstNode::typeOpPlusEq: f << "Operator +="; break; | 70 | case AstNode::typeOpPlusEq: f << "Operator +="; break; |
71 | case AstNode::typeOpPlusEqRaw: f << "Operator <<"; break; | 71 | case AstNode::typeOpPlusEqRaw: f << "Operator <<"; break; |
72 | case AstNode::typeError: f << "Error"; break; | 72 | case AstNode::typeError: f << "Error"; break; |
73 | case AstNode::typeWarning: f << "Warning"; break; | 73 | case AstNode::typeWarning: f << "Warning"; break; |
74 | case AstNode::typeNotice: f << "Notice"; break; | 74 | case AstNode::typeNotice: f << "Notice"; break; |
75 | case AstNode::typeTypeString: f << "Type String"; break; | 75 | case AstNode::typeTypeString: f << "Type String"; break; |
76 | case AstNode::typeTypeInt: f << "Type Int"; break; | 76 | case AstNode::typeTypeInt: f << "Type Int"; break; |
77 | case AstNode::typeTypeFloat: f << "Type Float"; break; | 77 | case AstNode::typeTypeFloat: f << "Type Float"; break; |
78 | case AstNode::typeTypeBool: f << "Type Bool"; break; | 78 | case AstNode::typeTypeBool: f << "Type Bool"; break; |
79 | case AstNode::typeTypeVersion: f << "Type Version"; break; | 79 | case AstNode::typeTypeVersion: f << "Type Version"; break; |
80 | case AstNode::typeCmpEq: f << "Compare ="; break; | 80 | case AstNode::typeCmpEq: f << "Compare ="; break; |
81 | case AstNode::typeCmpLt: f << "Compare <"; break; | 81 | case AstNode::typeCmpLt: f << "Compare <"; break; |
82 | case AstNode::typeCmpGt: f << "Compare >"; break; | 82 | case AstNode::typeCmpGt: f << "Compare >"; break; |
83 | case AstNode::typeCmpNe: f << "Compare !="; break; | 83 | case AstNode::typeCmpNe: f << "Compare !="; break; |
84 | case AstNode::typeCmpLtEq: f << "Compare <="; break; | 84 | case AstNode::typeCmpLtEq: f << "Compare <="; break; |
85 | case AstNode::typeCmpGtEq: f << "Compare >="; break; | 85 | case AstNode::typeCmpGtEq: f << "Compare >="; break; |
86 | case AstNode::typeCondition: f << "Condition"; break; | 86 | case AstNode::typeCondition: f << "Condition"; break; |
87 | case AstNode::typeDisplay: f << "Display"; break; | 87 | case AstNode::typeDisplay: f << "Display"; break; |
88 | case AstNode::typeCache: f << "Cache"; break; | 88 | case AstNode::typeCache: f << "Cache"; break; |
89 | case AstNode::typePushPrefix: f << "Push Prefix"; break; | 89 | case AstNode::typePushPrefix: f << "Push Prefix"; break; |
90 | case AstNode::typePopPrefix: f << "Pop Prefix"; break; | 90 | case AstNode::typePopPrefix: f << "Pop Prefix"; break; |
91 | case AstNode::typeNull: f << "Null"; break; | 91 | case AstNode::typeNull: f << "Null"; break; |
92 | case AstNode::typeVariableRef: f << "VariableRef"; break; | 92 | case AstNode::typeVariableRef: f << "VariableRef"; break; |
93 | case AstNode::typeOpPlus: f << "Operator +"; break; | 93 | case AstNode::typeOpPlus: f << "Operator +"; break; |
94 | case AstNode::typeOpMinus: f << "Operator -"; break; | 94 | case AstNode::typeOpMinus: f << "Operator -"; break; |
95 | case AstNode::typeOpMultiply: f << "Operator *"; break; | 95 | case AstNode::typeOpMultiply: f << "Operator *"; break; |
96 | case AstNode::typeOpDivide: f << "Operator /"; break; | 96 | case AstNode::typeOpDivide: f << "Operator /"; break; |
97 | case AstNode::typeOpNegate: f << "Operator negate"; break; | 97 | case AstNode::typeOpNegate: f << "Operator negate"; break; |
98 | case AstNode::typeOpNot: f << "Operator not"; break; | 98 | case AstNode::typeOpNot: f << "Operator not"; break; |
99 | 99 | ||
100 | case AstNode::typeBranch: f << "Branch"; break; | 100 | case AstNode::typeBranch: f << "Branch"; break; |
101 | case AstNode::typeLeaf: f << "Leaf"; break; | 101 | case AstNode::typeLeaf: f << "Leaf"; break; |
102 | case AstNode::typeClassMask: f << "ClassMask"; break; | 102 | case AstNode::typeClassMask: f << "ClassMask"; break; |
103 | 103 | ||
104 | case AstNode::typeDataNone: f << "<Data None>"; break; | 104 | case AstNode::typeDataNone: f << "<Data None>"; break; |
105 | case AstNode::typeDataString: f << "<Data String>"; break; | 105 | case AstNode::typeDataString: f << "<Data String>"; break; |
106 | case AstNode::typeDataInt: f << "<Data Int>"; break; | 106 | case AstNode::typeDataInt: f << "<Data Int>"; break; |
107 | case AstNode::typeDataFloat: f << "<Data Float>"; break; | 107 | case AstNode::typeDataFloat: f << "<Data Float>"; break; |
108 | case AstNode::typeDataBool: f << "<Data Bool>"; break; | 108 | case AstNode::typeDataBool: f << "<Data Bool>"; break; |
109 | case AstNode::typeDataVersion: f << "<Data Version>"; break; | 109 | case AstNode::typeDataVersion: f << "<Data Version>"; break; |
110 | case AstNode::typeDataMask: f << "<Data Mask>"; break; | 110 | case AstNode::typeDataMask: f << "<Data Mask>"; break; |
111 | } | 111 | } |
112 | return f; | 112 | return f; |
113 | } | 113 | } |
114 | 114 | ||