Gyoji Compiler
Loading...
Searching...
No Matches
forward.hpp
1#ifndef _GYOJI_INTERNAL
2#error "This header is intended to be used internally as a part of the Gyoji front-end. Please include frontend.hpp instead."
3#endif
4#pragma once
5
6#include <memory>
7
8// This is the set of forward declarations for
9// the classes that make up the strongly-typed
10// syntax tree. These are roughly organized in
11// heirarchal order with the things that depend
12// on other things indented and appearing below them.
13// The heirarchy is imperfect because some
14// nodes may appear in multiple contexts and
15// some nodes are recursive, so this is only
16// a rough guide for how the classes relate
17// to one another. For a more full picture
18// of their relationships, see the Doxygen
19// documents.
20//
21// When maintaining these declarations, please
22// make sure to maintain both the class forward-declarations
23// as well as the pointer typedefs associated with
24// them so that users of these classes can refer
25// to them without having a dependency on the
26// classes themselves. This is important because
27// there is some recursiveness in the definitions
28// and it's important that these forward declarations
29// resolve that circularity.
31
32//----------------------------
33// Class forward declarations.
34//----------------------------
35 class Terminal;
36
37 class AccessQualifier;
38 class AccessModifier;
39 class UnsafeModifier;
40 class TypeSpecifier;
41 class TypeName;
48 class TypeSpecifierArray;
49
52
53 class ClassDeclStart;
54 class ClassArgumentList;
55 class ClassMemberDeclarationList;
56 class ClassMemberDeclaration;
57 class ClassMemberDeclarationVariable;
58 class ClassMemberDeclarationMethod;
59 class ClassMemberDeclarationConstructor;
60 class ClassMemberDeclarationDestructor;
61 class ClassDefinition;
62 class ClassDeclaration;
63
64 class TypeDefinition;
65
66 class EnumDefinition;
67 class EnumDefinitionValueList;
68 class EnumDefinitionValue;
69
70 class Expression;
71 class ExpressionPrimary;
72 class ExpressionPrimaryIdentifier;
73 class ExpressionPrimaryNested;
74 class ExpressionPrimaryLiteralChar;
75 class ExpressionPrimaryLiteralString;
76 class ExpressionPrimaryLiteralInt;
77 class ExpressionPrimaryLiteralFloat;
78 class ExpressionPrimaryLiteralBool;
79 class ExpressionPrimaryLiteralNull;
80
81 class ExpressionPostfixArrayIndex;
82 class ExpressionPostfixFunctionCall;
83 class ArgumentExpressionList;
84 class ExpressionPostfixDot;
85 class ExpressionPostfixArrow;
86 class ExpressionPostfixIncDec;
87 class ExpressionUnaryPrefix;
88 class ExpressionUnarySizeofType;
89 class ExpressionCast;
90 class ExpressionBinary;
91 class ExpressionTrinary;
92
93 class StatementList;
94 class Statement;
95 class InitializerExpression;
97 class StatementBlock;
99 class StatementIfElse;
100 class StatementWhile;
101 class StatementFor;
102 class StatementSwitch;
103 class StatementSwitchContent;
104 class StatementSwitchBlock;
105 class StatementLabel;
106 class StatementGoto;
107 class StatementContinue;
108 class StatementBreak;
109 class StatementReturn;
110
111 class TranslationUnit;
112 class FileStatementList;
113 class FileStatement;
114 class FileStatementFunctionDeclStart;
115 class FileStatementFunctionDefinition;
116 class ScopeBody;
118 class ArrayLength;
119 class FileStatementGlobalDefinition;
120 class GlobalInitializer;
121 class GlobalInitializerExpressionPrimary;
122 class GlobalInitializerAddressofExpressionPrimary;
123 class GlobalInitializerStructInitializerList;
124 class StructInitializerList;
125 class StructInitializer;
126
127 class FileStatementNamespace;
128 class NamespaceDeclaration;
129 class FileStatementUsing;
130 class UsingAs;
131//----------------------------
132// Collection of classes to
133// include in the 'SyntaxNode'
134// variant type.
135//----------------------------
136#define GYOJI_SYNTAX_NODE_VARIANT_LIST \
137 Gyoji::frontend::tree::Terminal*, \
138 Gyoji::frontend::tree::AccessQualifier*, \
139 Gyoji::frontend::tree::AccessModifier*, \
140 Gyoji::frontend::tree::UnsafeModifier*, \
141 Gyoji::frontend::tree::TypeSpecifier*, \
142 Gyoji::frontend::tree:: TypeName*, \
143 Gyoji::frontend::tree:: TypeSpecifierCallArgs*, \
144 Gyoji::frontend::tree:: TypeSpecifierSimple*, \
145 Gyoji::frontend::tree:: TypeSpecifierTemplate*, \
146 Gyoji::frontend::tree:: TypeSpecifierFunctionPointer*, \
147 Gyoji::frontend::tree:: TypeSpecifierPointerTo*, \
148 Gyoji::frontend::tree:: TypeSpecifierReferenceTo*, \
149 Gyoji::frontend::tree:: TypeSpecifierArray*, \
150 Gyoji::frontend::tree::FunctionDefinitionArgList*, \
151 Gyoji::frontend::tree:: FunctionDefinitionArg*, \
152 Gyoji::frontend::tree:: ClassDeclStart*, \
153 Gyoji::frontend::tree:: ClassArgumentList*, \
154 Gyoji::frontend::tree:: ClassMemberDeclarationVariable*, \
155 Gyoji::frontend::tree:: ClassMemberDeclarationMethod*, \
156 Gyoji::frontend::tree:: ClassMemberDeclarationConstructor*, \
157 Gyoji::frontend::tree:: ClassMemberDeclarationDestructor*, \
158 Gyoji::frontend::tree:: ClassMemberDeclaration*, \
159 Gyoji::frontend::tree:: ClassMemberDeclarationList*, \
160 Gyoji::frontend::tree::ClassDefinition*, \
161 Gyoji::frontend::tree::ClassDeclaration*, \
162 Gyoji::frontend::tree::TypeDefinition*, \
163 Gyoji::frontend::tree:: EnumDefinitionValue*, \
164 Gyoji::frontend::tree:: EnumDefinitionValueList*, \
165 Gyoji::frontend::tree::EnumDefinition*, \
166 Gyoji::frontend::tree::Expression*, \
167 Gyoji::frontend::tree:: ExpressionPrimary*, \
168 Gyoji::frontend::tree:: ExpressionPrimaryIdentifier*, \
169 Gyoji::frontend::tree:: ExpressionPrimaryNested*, \
170 Gyoji::frontend::tree:: ExpressionPrimaryLiteralChar*, \
171 Gyoji::frontend::tree:: ExpressionPrimaryLiteralString*, \
172 Gyoji::frontend::tree:: ExpressionPrimaryLiteralInt*, \
173 Gyoji::frontend::tree:: ExpressionPrimaryLiteralFloat*, \
174 Gyoji::frontend::tree:: ExpressionPrimaryLiteralBool*, \
175 Gyoji::frontend::tree:: ExpressionPrimaryLiteralNull*, \
176 Gyoji::frontend::tree:: ExpressionPostfixArrayIndex*, \
177 Gyoji::frontend::tree:: ExpressionPostfixFunctionCall*, \
178 Gyoji::frontend::tree:: ArgumentExpressionList*, \
179 Gyoji::frontend::tree:: ExpressionPostfixDot*, \
180 Gyoji::frontend::tree:: ExpressionPostfixArrow*, \
181 Gyoji::frontend::tree:: ExpressionPostfixIncDec*, \
182 Gyoji::frontend::tree:: ExpressionUnaryPrefix*, \
183 Gyoji::frontend::tree:: ExpressionUnarySizeofType*, \
184 Gyoji::frontend::tree:: ExpressionCast*, \
185 Gyoji::frontend::tree:: ExpressionBinary*, \
186 Gyoji::frontend::tree:: ExpressionTrinary*, \
187 Gyoji::frontend::tree::StatementList*, \
188 Gyoji::frontend::tree:: Statement*, \
189 Gyoji::frontend::tree:: InitializerExpression*, \
190 Gyoji::frontend::tree:: StatementVariableDeclaration*, \
191 Gyoji::frontend::tree:: StatementBlock*, \
192 Gyoji::frontend::tree:: StatementExpression*, \
193 Gyoji::frontend::tree:: StatementGoto*, \
194 Gyoji::frontend::tree:: StatementIfElse*, \
195 Gyoji::frontend::tree:: StatementWhile*, \
196 Gyoji::frontend::tree:: StatementFor*, \
197 Gyoji::frontend::tree:: StatementSwitch*, \
198 Gyoji::frontend::tree:: StatementSwitchContent*, \
199 Gyoji::frontend::tree:: StatementSwitchBlock*, \
200 Gyoji::frontend::tree:: StatementReturn*, \
201 Gyoji::frontend::tree:: StatementContinue*, \
202 Gyoji::frontend::tree:: StatementBreak*, \
203 Gyoji::frontend::tree:: StatementLabel*, \
204 Gyoji::frontend::tree::TranslationUnit*, \
205 Gyoji::frontend::tree:: FileStatementList*, \
206 Gyoji::frontend::tree:: FileStatement*, \
207 Gyoji::frontend::tree:: FileStatementFunctionDeclStart*, \
208 Gyoji::frontend::tree:: FileStatementFunctionDefinition*, \
209 Gyoji::frontend::tree:: ScopeBody *, \
210 Gyoji::frontend::tree:: FileStatementFunctionDeclaration*, \
211 Gyoji::frontend::tree:: ArrayLength*, \
212 Gyoji::frontend::tree:: GlobalInitializer*, \
213 Gyoji::frontend::tree:: GlobalInitializerExpressionPrimary*, \
214 Gyoji::frontend::tree:: GlobalInitializerAddressofExpressionPrimary*, \
215 Gyoji::frontend::tree:: GlobalInitializerStructInitializerList*, \
216 Gyoji::frontend::tree:: StructInitializerList*, \
217 Gyoji::frontend::tree:: StructInitializer*, \
218 Gyoji::frontend::tree:: FileStatementGlobalDefinition*, \
219 Gyoji::frontend::tree:: FileStatementNamespace*, \
220 Gyoji::frontend::tree:: NamespaceDeclaration*, \
221 Gyoji::frontend::tree:: FileStatementUsing*, \
222 Gyoji::frontend::tree:: UsingAs*
223};
Declares PUBLIC, PROTECTED, or PRIVATE access to functions and members.
Definition tree.hpp:307
This indicates the type of access that may be permitted as UNSPECIFIED, CONST, or VOLATILE.
Definition tree.hpp:248
Represents the declaration of a function.
Definition tree.hpp:942
Represents the list of arguments to a function definition.
Definition tree.hpp:906
Represents an argument in a function definition.
Definition tree.hpp:879
Represents a block of statements in a particular scope.
Definition tree.hpp:1077
This represents a statement in a function or scope that computes an expression.
Definition tree.hpp:1121
This represents an if condition in one of several forms.
Definition tree.hpp:1192
Represents the declaration of a variable inside the scope of a function or block.
Definition tree.hpp:1018
Represents a 'while' statement in a function or scope.
Definition tree.hpp:1295
Represents tokens from the lexer used to represent keywords and identifiers found in the source.
Definition tree.hpp:89
Represents the top-level syntax unit for a source file.
Definition tree.hpp:2759
Represents the name of a type.
Definition tree.hpp:417
Represents arguments to a template type.
Definition tree.hpp:493
Represents a pointer to a function.
Definition tree.hpp:617
Represents an unsafe poniter to a specific type.
Definition tree.hpp:694
Represents a safe reference to a specific type.
Definition tree.hpp:785
Represents a simple type.
Definition tree.hpp:531
Represents a type with type-arguments modifying the type's definition.
Definition tree.hpp:581
Represents a type being specified.
Definition tree.hpp:848
Represents the safety/borrow check semantics for a function or block.
Definition tree.hpp:362
Strongly-typed syntax tree.
Definition forward.hpp:30