]> git.bts.cx Git - sun.git/blob - runtime/src/sun/tree/node_internal.h
Initial commit
[sun.git] / runtime / src / sun / tree / node_internal.h
1 #ifndef SUN_TREE_NODE_INTERNAL_H
2 #define SUN_TREE_NODE_INTERNAL_H
3
4 #include <sun/tree/node.h>
5
6 #include <sun/tree/data_type.h>
7 #include <sun/tree/node_type.h>
8 #include <stdbool.h>
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 struct SLTNode {
15 SLTNodeType type;
16 SLTDataType dataType;
17
18 union {
19 struct {
20 char *identifierStringValue;
21 unsigned int identifierStringKeyValue;
22 };
23
24 struct {
25 bool booleanValue;
26 };
27
28 struct {
29 int integerValue;
30 };
31
32 struct {
33 float floatValue;
34 };
35
36 struct {
37 char *stringValue;
38 };
39
40 struct {
41 unsigned int keyValue;
42 };
43
44 struct {
45 SLTNode *compoundSubexpression;
46 };
47
48 struct {
49 SLTNode *argumentExpression;
50 };
51
52 struct {
53 SLTNode *arrayAccessArray;
54 SLTNode *arrayAccessAccess;
55 };
56
57 struct {
58 SLTNode *typeAccessType;
59 SLTNode *typeAccessAccess;
60 };
61
62 struct {
63 SLTNode *functionCallFunction;
64 SLTNode *functionCallArguments;
65 };
66
67 struct {
68 SLTNode *unaryOperationOperator;
69 SLTNode *unaryOperationOperand;
70 };
71
72 struct {
73 SLTNode *binaryOperationOperator;
74 SLTNode *binaryOperationLHS;
75 SLTNode *binaryOperationRHS;
76 };
77
78 struct {
79 SLTOperatorType operatorType;
80 };
81
82 struct {
83 SLTNode *assignmentTarget;
84 SLTNode *assignmentSource;
85 };
86
87 struct {
88 SLTNode *returnExpression;
89 };
90
91 struct {
92 SLTNode *iterationInitialExpression;
93 SLTNode *iterationPreValidExpression;
94 SLTNode *iterationPostValidExpression;
95 SLTNode *iterationLoopExpression;
96 SLTNode *iterationStatement;
97 };
98
99 struct {
100 SLTNode *selectionValidExpression;
101 SLTNode *selectionValidStatement;
102 SLTNode *selectionInvalidStatement;
103 };
104
105 struct {
106 SLTNode *statementBlockContents;
107 };
108
109 struct {
110 SLTNode *variableDefinitionType;
111 SLTNode *variableDefinitionIdentifier;
112 SLTNode *variableDefinitionDefaultExpression;
113 };
114
115 struct {
116 SLTNode *typeDefinitionIdentifier;
117 SLTNode *typeDefinitionMembers;
118 };
119
120 struct {
121 SLTNode *typeMemberDefinitionType;
122 SLTNode *typeMemberDefinitionIdentifier;
123 };
124
125 struct {
126 SLTNode *functionDefinitionType;
127 SLTNode *functionDefinitionIdentifier;
128 SLTNode *functionDefinitionParameters;
129 SLTNode *functionDefinitionBody;
130 };
131
132 struct {
133 SLTNode *functionParameterDefinitionType;
134 SLTNode *functionParameterDefinitionIdentifier;
135 };
136
137 struct {
138 SLTNode *moduleStatementsAndDefinitions;
139 };
140
141 struct {
142 SLTNode *sequenceNode;
143 SLTNode *sequenceNext;
144 };
145 };
146
147 void *metadata;
148 };
149
150 #ifdef __cplusplus
151 }
152 #endif
153
154 #endif