1 | //
|
---|
2 | // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
|
---|
3 | //
|
---|
4 | // The contents of this file are covered under the licence agreement in the
|
---|
5 | // file "LICENCE" distributed with Cforall.
|
---|
6 | //
|
---|
7 | // Fwd.hpp -- Forward declarations of AST Types.
|
---|
8 | //
|
---|
9 | // Author : Andrew Beach
|
---|
10 | // Created On : Wed May 8 16:05:00 2019
|
---|
11 | // Last Modified By : Andrew Beach
|
---|
12 | // Last Modified On : Thr May 9 13:09:00 2019
|
---|
13 | // Update Count : 0
|
---|
14 | //
|
---|
15 |
|
---|
16 | #pragma once
|
---|
17 |
|
---|
18 | #include "AST/Node.hpp"
|
---|
19 |
|
---|
20 | namespace ast {
|
---|
21 |
|
---|
22 | class ParseNode;
|
---|
23 |
|
---|
24 | class Decl;
|
---|
25 | class DeclWithType;
|
---|
26 | class ObjectDecl;
|
---|
27 | class FunctionDecl;
|
---|
28 | class AggregateDecl;
|
---|
29 | class StructDecl;
|
---|
30 | class UnionDecl;
|
---|
31 | class EnumDecl;
|
---|
32 | class TraitDecl;
|
---|
33 | class NamedTypeDecl;
|
---|
34 | class TypeDecl;
|
---|
35 | class FtypeDecl;
|
---|
36 | class DtypeDecl;
|
---|
37 | class TypedefDecl;
|
---|
38 | class AsmDecl;
|
---|
39 | class StaticAssertDecl;
|
---|
40 |
|
---|
41 | class Stmt;
|
---|
42 | class CompoundStmt;
|
---|
43 | class ExprStmt;
|
---|
44 | class AsmStmt;
|
---|
45 | class DirectiveStmt;
|
---|
46 | class IfStmt;
|
---|
47 | class WhileStmt;
|
---|
48 | class ForStmt;
|
---|
49 | class SwitchStmt;
|
---|
50 | class CaseStmt;
|
---|
51 | class BranchStmt;
|
---|
52 | class ReturnStmt;
|
---|
53 | class ThrowStmt;
|
---|
54 | class TryStmt;
|
---|
55 | class CatchStmt;
|
---|
56 | class FinallyStmt;
|
---|
57 | class WaitForStmt;
|
---|
58 | class WithStmt;
|
---|
59 | class DeclStmt;
|
---|
60 | class NullStmt;
|
---|
61 | class ImplicitCtorDtorStmt;
|
---|
62 |
|
---|
63 | class Expr;
|
---|
64 | class ApplicationExpr;
|
---|
65 | class UntypedExpr;
|
---|
66 | class NameExpr;
|
---|
67 | class AddressExpr;
|
---|
68 | class LabelAddressExpr;
|
---|
69 | class CastExpr;
|
---|
70 | class KeywordCastExpr;
|
---|
71 | class VirtualCastExpr;
|
---|
72 | class MemberExpr;
|
---|
73 | class UntypedMemberExpr;
|
---|
74 | class VariableExpr;
|
---|
75 | class ConstantExpr;
|
---|
76 | class SizeofExpr;
|
---|
77 | class AlignofExpr;
|
---|
78 | class UntypedOffsetofExpr;
|
---|
79 | class OffsetofExpr;
|
---|
80 | class OffsetPackExpr;
|
---|
81 | class AttrExpr;
|
---|
82 | class LogicalExpr;
|
---|
83 | class ConditionalExpr;
|
---|
84 | class CommaExpr;
|
---|
85 | class TypeExpr;
|
---|
86 | class AsmExpr;
|
---|
87 | class ImplicitCopyCtorExpr;
|
---|
88 | class ConstructorExpr;
|
---|
89 | class CompoundLiteralExpr;
|
---|
90 | class UntypedValofExpr;
|
---|
91 | class RangeExpr;
|
---|
92 | class UntypedTupleExpr;
|
---|
93 | class TupleExpr;
|
---|
94 | class TupleIndexExpr;
|
---|
95 | class TupleAssignExpr;
|
---|
96 | class StmtExpr;
|
---|
97 | class UniqueExpr;
|
---|
98 | class UntypedInitExpr;
|
---|
99 | class InitExpr;
|
---|
100 | class DeletedExpr;
|
---|
101 | class DefaultArgExpr;
|
---|
102 | class GenericExpr;
|
---|
103 |
|
---|
104 | class Type;
|
---|
105 | class VoidType;
|
---|
106 | class BasicType;
|
---|
107 | class PointerType;
|
---|
108 | class ArrayType;
|
---|
109 | class ReferenceType;
|
---|
110 | class QualifiedType;
|
---|
111 | class FunctionType;
|
---|
112 | class ReferenceToType;
|
---|
113 | class StructInstType;
|
---|
114 | class UnionInstType;
|
---|
115 | class EnumInstType;
|
---|
116 | class TraitInstType;
|
---|
117 | class TypeInstType;
|
---|
118 | class TupleType;
|
---|
119 | class TypeofType;
|
---|
120 | class AttrType;
|
---|
121 | class VarArgsType;
|
---|
122 | class ZeroType;
|
---|
123 | class OneType;
|
---|
124 | class GlobalScopeType;
|
---|
125 |
|
---|
126 | class Designation;
|
---|
127 | class Init;
|
---|
128 | class SingleInit;
|
---|
129 | class ListInit;
|
---|
130 | class ConstructorInit;
|
---|
131 |
|
---|
132 | class Constant;
|
---|
133 |
|
---|
134 | class Label;
|
---|
135 |
|
---|
136 | class Attribute;
|
---|
137 |
|
---|
138 | class TypeSubstitution;
|
---|
139 |
|
---|
140 | //=================================================================================================
|
---|
141 | /// This disgusting and giant piece of boiler-plate is here to solve a cyclic dependency
|
---|
142 | /// remove only if there is a better solution
|
---|
143 | /// The problem is that ast::ptr< ... > uses increment/decrement which won't work well with
|
---|
144 | /// forward declarations
|
---|
145 | inline void decrement( const class Node * node, Node::ref_type ref ) { node->decrement(ref); }
|
---|
146 | inline void increment( const class Node * node, Node::ref_type ref ) { node->increment(ref); }
|
---|
147 | inline void increment( const class ParseNode *, Node::ref_type );
|
---|
148 | inline void decrement( const class ParseNode *, Node::ref_type );
|
---|
149 | inline void increment( const class Decl *, Node::ref_type );
|
---|
150 | inline void decrement( const class Decl *, Node::ref_type );
|
---|
151 | inline void increment( const class DeclWithType *, Node::ref_type );
|
---|
152 | inline void decrement( const class DeclWithType *, Node::ref_type );
|
---|
153 | inline void increment( const class ObjectDecl *, Node::ref_type );
|
---|
154 | inline void decrement( const class ObjectDecl *, Node::ref_type );
|
---|
155 | inline void increment( const class FunctionDecl *, Node::ref_type );
|
---|
156 | inline void decrement( const class FunctionDecl *, Node::ref_type );
|
---|
157 | inline void increment( const class AggregateDecl *, Node::ref_type );
|
---|
158 | inline void decrement( const class AggregateDecl *, Node::ref_type );
|
---|
159 | inline void increment( const class StructDecl *, Node::ref_type );
|
---|
160 | inline void decrement( const class StructDecl *, Node::ref_type );
|
---|
161 | inline void increment( const class UnionDecl *, Node::ref_type );
|
---|
162 | inline void decrement( const class UnionDecl *, Node::ref_type );
|
---|
163 | inline void increment( const class EnumDecl *, Node::ref_type );
|
---|
164 | inline void decrement( const class EnumDecl *, Node::ref_type );
|
---|
165 | inline void increment( const class TraitDecl *, Node::ref_type );
|
---|
166 | inline void decrement( const class TraitDecl *, Node::ref_type );
|
---|
167 | inline void increment( const class NamedTypeDecl *, Node::ref_type );
|
---|
168 | inline void decrement( const class NamedTypeDecl *, Node::ref_type );
|
---|
169 | inline void increment( const class TypeDecl *, Node::ref_type );
|
---|
170 | inline void decrement( const class TypeDecl *, Node::ref_type );
|
---|
171 | inline void increment( const class FtypeDecl *, Node::ref_type );
|
---|
172 | inline void decrement( const class FtypeDecl *, Node::ref_type );
|
---|
173 | inline void increment( const class DtypeDecl *, Node::ref_type );
|
---|
174 | inline void decrement( const class DtypeDecl *, Node::ref_type );
|
---|
175 | inline void increment( const class TypedefDecl *, Node::ref_type );
|
---|
176 | inline void decrement( const class TypedefDecl *, Node::ref_type );
|
---|
177 | inline void increment( const class AsmDecl *, Node::ref_type );
|
---|
178 | inline void decrement( const class AsmDecl *, Node::ref_type );
|
---|
179 | inline void increment( const class StaticAssertDecl *, Node::ref_type );
|
---|
180 | inline void decrement( const class StaticAssertDecl *, Node::ref_type );
|
---|
181 | inline void increment( const class Stmt *, Node::ref_type );
|
---|
182 | inline void decrement( const class Stmt *, Node::ref_type );
|
---|
183 | inline void increment( const class CompoundStmt *, Node::ref_type );
|
---|
184 | inline void decrement( const class CompoundStmt *, Node::ref_type );
|
---|
185 | inline void increment( const class ExprStmt *, Node::ref_type );
|
---|
186 | inline void decrement( const class ExprStmt *, Node::ref_type );
|
---|
187 | inline void increment( const class AsmStmt *, Node::ref_type );
|
---|
188 | inline void decrement( const class AsmStmt *, Node::ref_type );
|
---|
189 | inline void increment( const class DirectiveStmt *, Node::ref_type );
|
---|
190 | inline void decrement( const class DirectiveStmt *, Node::ref_type );
|
---|
191 | inline void increment( const class IfStmt *, Node::ref_type );
|
---|
192 | inline void decrement( const class IfStmt *, Node::ref_type );
|
---|
193 | inline void increment( const class WhileStmt *, Node::ref_type );
|
---|
194 | inline void decrement( const class WhileStmt *, Node::ref_type );
|
---|
195 | inline void increment( const class ForStmt *, Node::ref_type );
|
---|
196 | inline void decrement( const class ForStmt *, Node::ref_type );
|
---|
197 | inline void increment( const class SwitchStmt *, Node::ref_type );
|
---|
198 | inline void decrement( const class SwitchStmt *, Node::ref_type );
|
---|
199 | inline void increment( const class CaseStmt *, Node::ref_type );
|
---|
200 | inline void decrement( const class CaseStmt *, Node::ref_type );
|
---|
201 | inline void increment( const class BranchStmt *, Node::ref_type );
|
---|
202 | inline void decrement( const class BranchStmt *, Node::ref_type );
|
---|
203 | inline void increment( const class ReturnStmt *, Node::ref_type );
|
---|
204 | inline void decrement( const class ReturnStmt *, Node::ref_type );
|
---|
205 | inline void increment( const class ThrowStmt *, Node::ref_type );
|
---|
206 | inline void decrement( const class ThrowStmt *, Node::ref_type );
|
---|
207 | inline void increment( const class TryStmt *, Node::ref_type );
|
---|
208 | inline void decrement( const class TryStmt *, Node::ref_type );
|
---|
209 | inline void increment( const class CatchStmt *, Node::ref_type );
|
---|
210 | inline void decrement( const class CatchStmt *, Node::ref_type );
|
---|
211 | inline void increment( const class FinallyStmt *, Node::ref_type );
|
---|
212 | inline void decrement( const class FinallyStmt *, Node::ref_type );
|
---|
213 | inline void increment( const class WaitForStmt *, Node::ref_type );
|
---|
214 | inline void decrement( const class WaitForStmt *, Node::ref_type );
|
---|
215 | inline void increment( const class WithStmt *, Node::ref_type );
|
---|
216 | inline void decrement( const class WithStmt *, Node::ref_type );
|
---|
217 | inline void increment( const class DeclStmt *, Node::ref_type );
|
---|
218 | inline void decrement( const class DeclStmt *, Node::ref_type );
|
---|
219 | inline void increment( const class NullStmt *, Node::ref_type );
|
---|
220 | inline void decrement( const class NullStmt *, Node::ref_type );
|
---|
221 | inline void increment( const class ImplicitCtorDtorStmt *, Node::ref_type );
|
---|
222 | inline void decrement( const class ImplicitCtorDtorStmt *, Node::ref_type );
|
---|
223 | inline void increment( const class Expr *, Node::ref_type );
|
---|
224 | inline void decrement( const class Expr *, Node::ref_type );
|
---|
225 | inline void increment( const class ApplicationExpr *, Node::ref_type );
|
---|
226 | inline void decrement( const class ApplicationExpr *, Node::ref_type );
|
---|
227 | inline void increment( const class UntypedExpr *, Node::ref_type );
|
---|
228 | inline void decrement( const class UntypedExpr *, Node::ref_type );
|
---|
229 | inline void increment( const class NameExpr *, Node::ref_type );
|
---|
230 | inline void decrement( const class NameExpr *, Node::ref_type );
|
---|
231 | inline void increment( const class AddressExpr *, Node::ref_type );
|
---|
232 | inline void decrement( const class AddressExpr *, Node::ref_type );
|
---|
233 | inline void increment( const class LabelAddressExpr *, Node::ref_type );
|
---|
234 | inline void decrement( const class LabelAddressExpr *, Node::ref_type );
|
---|
235 | inline void increment( const class CastExpr *, Node::ref_type );
|
---|
236 | inline void decrement( const class CastExpr *, Node::ref_type );
|
---|
237 | inline void increment( const class KeywordCastExpr *, Node::ref_type );
|
---|
238 | inline void decrement( const class KeywordCastExpr *, Node::ref_type );
|
---|
239 | inline void increment( const class VirtualCastExpr *, Node::ref_type );
|
---|
240 | inline void decrement( const class VirtualCastExpr *, Node::ref_type );
|
---|
241 | inline void increment( const class MemberExpr *, Node::ref_type );
|
---|
242 | inline void decrement( const class MemberExpr *, Node::ref_type );
|
---|
243 | inline void increment( const class UntypedMemberExpr *, Node::ref_type );
|
---|
244 | inline void decrement( const class UntypedMemberExpr *, Node::ref_type );
|
---|
245 | inline void increment( const class VariableExpr *, Node::ref_type );
|
---|
246 | inline void decrement( const class VariableExpr *, Node::ref_type );
|
---|
247 | inline void increment( const class ConstantExpr *, Node::ref_type );
|
---|
248 | inline void decrement( const class ConstantExpr *, Node::ref_type );
|
---|
249 | inline void increment( const class SizeofExpr *, Node::ref_type );
|
---|
250 | inline void decrement( const class SizeofExpr *, Node::ref_type );
|
---|
251 | inline void increment( const class AlignofExpr *, Node::ref_type );
|
---|
252 | inline void decrement( const class AlignofExpr *, Node::ref_type );
|
---|
253 | inline void increment( const class UntypedOffsetofExpr *, Node::ref_type );
|
---|
254 | inline void decrement( const class UntypedOffsetofExpr *, Node::ref_type );
|
---|
255 | inline void increment( const class OffsetofExpr *, Node::ref_type );
|
---|
256 | inline void decrement( const class OffsetofExpr *, Node::ref_type );
|
---|
257 | inline void increment( const class OffsetPackExpr *, Node::ref_type );
|
---|
258 | inline void decrement( const class OffsetPackExpr *, Node::ref_type );
|
---|
259 | inline void increment( const class AttrExpr *, Node::ref_type );
|
---|
260 | inline void decrement( const class AttrExpr *, Node::ref_type );
|
---|
261 | inline void increment( const class LogicalExpr *, Node::ref_type );
|
---|
262 | inline void decrement( const class LogicalExpr *, Node::ref_type );
|
---|
263 | inline void increment( const class ConditionalExpr *, Node::ref_type );
|
---|
264 | inline void decrement( const class ConditionalExpr *, Node::ref_type );
|
---|
265 | inline void increment( const class CommaExpr *, Node::ref_type );
|
---|
266 | inline void decrement( const class CommaExpr *, Node::ref_type );
|
---|
267 | inline void increment( const class TypeExpr *, Node::ref_type );
|
---|
268 | inline void decrement( const class TypeExpr *, Node::ref_type );
|
---|
269 | inline void increment( const class AsmExpr *, Node::ref_type );
|
---|
270 | inline void decrement( const class AsmExpr *, Node::ref_type );
|
---|
271 | inline void increment( const class ImplicitCopyCtorExpr *, Node::ref_type );
|
---|
272 | inline void decrement( const class ImplicitCopyCtorExpr *, Node::ref_type );
|
---|
273 | inline void increment( const class ConstructorExpr *, Node::ref_type );
|
---|
274 | inline void decrement( const class ConstructorExpr *, Node::ref_type );
|
---|
275 | inline void increment( const class CompoundLiteralExpr *, Node::ref_type );
|
---|
276 | inline void decrement( const class CompoundLiteralExpr *, Node::ref_type );
|
---|
277 | inline void increment( const class UntypedValofExpr *, Node::ref_type );
|
---|
278 | inline void decrement( const class UntypedValofExpr *, Node::ref_type );
|
---|
279 | inline void increment( const class RangeExpr *, Node::ref_type );
|
---|
280 | inline void decrement( const class RangeExpr *, Node::ref_type );
|
---|
281 | inline void increment( const class UntypedTupleExpr *, Node::ref_type );
|
---|
282 | inline void decrement( const class UntypedTupleExpr *, Node::ref_type );
|
---|
283 | inline void increment( const class TupleExpr *, Node::ref_type );
|
---|
284 | inline void decrement( const class TupleExpr *, Node::ref_type );
|
---|
285 | inline void increment( const class TupleIndexExpr *, Node::ref_type );
|
---|
286 | inline void decrement( const class TupleIndexExpr *, Node::ref_type );
|
---|
287 | inline void increment( const class TupleAssignExpr *, Node::ref_type );
|
---|
288 | inline void decrement( const class TupleAssignExpr *, Node::ref_type );
|
---|
289 | inline void increment( const class StmtExpr *, Node::ref_type );
|
---|
290 | inline void decrement( const class StmtExpr *, Node::ref_type );
|
---|
291 | inline void increment( const class UniqueExpr *, Node::ref_type );
|
---|
292 | inline void decrement( const class UniqueExpr *, Node::ref_type );
|
---|
293 | inline void increment( const class UntypedInitExpr *, Node::ref_type );
|
---|
294 | inline void decrement( const class UntypedInitExpr *, Node::ref_type );
|
---|
295 | inline void increment( const class InitExpr *, Node::ref_type );
|
---|
296 | inline void decrement( const class InitExpr *, Node::ref_type );
|
---|
297 | inline void increment( const class DeletedExpr *, Node::ref_type );
|
---|
298 | inline void decrement( const class DeletedExpr *, Node::ref_type );
|
---|
299 | inline void increment( const class DefaultArgExpr *, Node::ref_type );
|
---|
300 | inline void decrement( const class DefaultArgExpr *, Node::ref_type );
|
---|
301 | inline void increment( const class GenericExpr *, Node::ref_type );
|
---|
302 | inline void decrement( const class GenericExpr *, Node::ref_type );
|
---|
303 | inline void increment( const class Type *, Node::ref_type );
|
---|
304 | inline void decrement( const class Type *, Node::ref_type );
|
---|
305 | inline void increment( const class VoidType *, Node::ref_type );
|
---|
306 | inline void decrement( const class VoidType *, Node::ref_type );
|
---|
307 | inline void increment( const class BasicType *, Node::ref_type );
|
---|
308 | inline void decrement( const class BasicType *, Node::ref_type );
|
---|
309 | inline void increment( const class PointerType *, Node::ref_type );
|
---|
310 | inline void decrement( const class PointerType *, Node::ref_type );
|
---|
311 | inline void increment( const class ArrayType *, Node::ref_type );
|
---|
312 | inline void decrement( const class ArrayType *, Node::ref_type );
|
---|
313 | inline void increment( const class ReferenceType *, Node::ref_type );
|
---|
314 | inline void decrement( const class ReferenceType *, Node::ref_type );
|
---|
315 | inline void increment( const class QualifiedType *, Node::ref_type );
|
---|
316 | inline void decrement( const class QualifiedType *, Node::ref_type );
|
---|
317 | inline void increment( const class FunctionType *, Node::ref_type );
|
---|
318 | inline void decrement( const class FunctionType *, Node::ref_type );
|
---|
319 | inline void increment( const class ReferenceToType *, Node::ref_type );
|
---|
320 | inline void decrement( const class ReferenceToType *, Node::ref_type );
|
---|
321 | inline void increment( const class StructInstType *, Node::ref_type );
|
---|
322 | inline void decrement( const class StructInstType *, Node::ref_type );
|
---|
323 | inline void increment( const class UnionInstType *, Node::ref_type );
|
---|
324 | inline void decrement( const class UnionInstType *, Node::ref_type );
|
---|
325 | inline void increment( const class EnumInstType *, Node::ref_type );
|
---|
326 | inline void decrement( const class EnumInstType *, Node::ref_type );
|
---|
327 | inline void increment( const class TraitInstType *, Node::ref_type );
|
---|
328 | inline void decrement( const class TraitInstType *, Node::ref_type );
|
---|
329 | inline void increment( const class TypeInstType *, Node::ref_type );
|
---|
330 | inline void decrement( const class TypeInstType *, Node::ref_type );
|
---|
331 | inline void increment( const class TupleType *, Node::ref_type );
|
---|
332 | inline void decrement( const class TupleType *, Node::ref_type );
|
---|
333 | inline void increment( const class TypeofType *, Node::ref_type );
|
---|
334 | inline void decrement( const class TypeofType *, Node::ref_type );
|
---|
335 | inline void increment( const class AttrType *, Node::ref_type );
|
---|
336 | inline void decrement( const class AttrType *, Node::ref_type );
|
---|
337 | inline void increment( const class VarArgsType *, Node::ref_type );
|
---|
338 | inline void decrement( const class VarArgsType *, Node::ref_type );
|
---|
339 | inline void increment( const class ZeroType *, Node::ref_type );
|
---|
340 | inline void decrement( const class ZeroType *, Node::ref_type );
|
---|
341 | inline void increment( const class OneType *, Node::ref_type );
|
---|
342 | inline void decrement( const class OneType *, Node::ref_type );
|
---|
343 | inline void increment( const class GlobalScopeType *, Node::ref_type );
|
---|
344 | inline void decrement( const class GlobalScopeType *, Node::ref_type );
|
---|
345 | inline void increment( const class Designation *, Node::ref_type );
|
---|
346 | inline void decrement( const class Designation *, Node::ref_type );
|
---|
347 | inline void increment( const class Init *, Node::ref_type );
|
---|
348 | inline void decrement( const class Init *, Node::ref_type );
|
---|
349 | inline void increment( const class SingleInit *, Node::ref_type );
|
---|
350 | inline void decrement( const class SingleInit *, Node::ref_type );
|
---|
351 | inline void increment( const class ListInit *, Node::ref_type );
|
---|
352 | inline void decrement( const class ListInit *, Node::ref_type );
|
---|
353 | inline void increment( const class ConstructorInit *, Node::ref_type );
|
---|
354 | inline void decrement( const class ConstructorInit *, Node::ref_type );
|
---|
355 | inline void increment( const class Constant *, Node::ref_type );
|
---|
356 | inline void decrement( const class Constant *, Node::ref_type );
|
---|
357 | inline void increment( const class Label *, Node::ref_type );
|
---|
358 | inline void decrement( const class Label *, Node::ref_type );
|
---|
359 | inline void increment( const class Attribute *, Node::ref_type );
|
---|
360 | inline void decrement( const class Attribute *, Node::ref_type );
|
---|
361 | inline void increment( const class TypeSubstitution *, Node::ref_type );
|
---|
362 | inline void decrement( const class TypeSubstitution *, Node::ref_type );
|
---|
363 |
|
---|
364 | typedef unsigned int UniqueId;
|
---|
365 |
|
---|
366 | }
|
---|