BOO-995, BOO-996: Fix one file that was missed in previous commit.
[boo.git] / ast.model.boo
blob7059f801acdc99f05980c09fe2b3bd73b201723a
1 """
2 The classes in this module model the entire AST for the language.
4 The actual AST classes and supporting modules are generated
5 by a boo script.
6 """
7 namespace Boo.Ast
9 class CompileUnit(Node):
10 Modules as ModuleCollection
12 enum TypeMemberModifiers:
13 None = 0
14 Private = 1
15 Internal = 2
16 Protected = 4
17 Public = 8
18 Transient = 16
19 Static = 32
20 Final = 64
21 Virtual = 128
22 Override = 256
23 Abstract = 512
24 Partial = 1024
25 VisibilityMask = 15
27 enum MethodImplementationFlags:
28 None = 0
29 Runtime = 1
31 enum ParameterModifiers:
32 None = 0
33 Val = 0
34 Ref = 1
36 [Flags]
37 enum ExceptionHandlerFlags:
38 None = 0
39 Anonymous = 1
40 Untyped = 2
41 Filter = 4
43 abstract class TypeMember(Node, INodeWithAttributes):
44 Modifiers as TypeMemberModifiers
45 Name as string
46 Attributes as AttributeCollection
48 class ExplicitMemberInfo(Node):
49 InterfaceType as SimpleTypeReference
51 [collection(TypeMember)]
52 class TypeMemberCollection:
53 pass
55 abstract class TypeReference(Node):
56 pass
58 class SimpleTypeReference(TypeReference):
59 Name as string
61 class ArrayTypeReference(TypeReference):
62 ElementType as TypeReference
63 Rank as IntegerLiteralExpression
65 class CallableTypeReference(TypeReference):
66 Parameters as ParameterDeclarationCollection
67 ReturnType as TypeReference
69 class GenericTypeReference(SimpleTypeReference):
70 GenericArguments as TypeReferenceCollection
72 class GenericTypeDefinitionReference(SimpleTypeReference):
73 GenericPlaceholders as int
75 [collection(TypeReference)]
76 class TypeReferenceCollection:
77 pass
79 class CallableDefinition(TypeMember, INodeWithParameters):
80 Parameters as ParameterDeclarationCollection
81 GenericParameters as GenericParameterDeclarationCollection
82 ReturnType as TypeReference
83 ReturnTypeAttributes as AttributeCollection
85 abstract class TypeDefinition(TypeMember):
86 Members as TypeMemberCollection
87 BaseTypes as TypeReferenceCollection
88 GenericParameters as GenericParameterDeclarationCollection
90 [collection(TypeDefinition)]
91 class TypeDefinitionCollection:
92 pass
94 class NamespaceDeclaration(Node):
95 Name as string
97 class Import(Node):
98 Namespace as string
99 AssemblyReference as ReferenceExpression
100 Alias as ReferenceExpression
102 [collection(Import)]
103 class ImportCollection:
104 pass
106 class Module(TypeDefinition):
107 Namespace as NamespaceDeclaration
108 Imports as ImportCollection
109 [auto]
110 Globals as Block
111 AssemblyAttributes as AttributeCollection
113 [collection(Module)]
114 class ModuleCollection:
115 pass
117 class ClassDefinition(TypeDefinition):
118 pass
120 class StructDefinition(TypeDefinition):
121 pass
123 class InterfaceDefinition(TypeDefinition):
124 pass
126 class EnumDefinition(TypeDefinition):
127 pass
129 class EnumMember(TypeMember):
130 Initializer as IntegerLiteralExpression
132 class Field(TypeMember):
133 Type as TypeReference
134 Initializer as Expression
136 class Property(TypeMember, INodeWithParameters, IExplicitMember):
137 Parameters as ParameterDeclarationCollection
138 Getter as Method
139 Setter as Method
140 Type as TypeReference
141 ExplicitInfo as ExplicitMemberInfo
143 class Event(TypeMember):
144 Add as Method
145 Remove as Method
146 Raise as Method
147 Type as TypeReference
149 class Local(Node):
150 Name as string
152 [collection(Local)]
153 class LocalCollection:
154 pass
156 class BlockExpression(Expression, INodeWithParameters):
157 Parameters as ParameterDeclarationCollection
158 ReturnType as TypeReference
159 [auto]
160 Body as Block
162 class Method(CallableDefinition, IExplicitMember):
163 [auto]
164 Body as Block
165 Locals as LocalCollection
166 ImplementationFlags as MethodImplementationFlags
167 ExplicitInfo as ExplicitMemberInfo
169 class Constructor(Method):
170 pass
172 class Destructor(Method):
173 pass
175 class ParameterDeclaration(Node, INodeWithAttributes):
176 Name as string
177 Type as TypeReference
178 Modifiers as ParameterModifiers
179 Attributes as AttributeCollection
181 [collection(ParameterDeclaration)]
182 class ParameterDeclarationCollection:
183 pass
185 class GenericParameterDeclaration(Node):
186 Name as string
188 [collection(GenericParameterDeclaration)]
189 class GenericParameterDeclarationCollection:
190 pass
192 class Declaration(Node):
193 Name as string
194 Type as TypeReference
196 [collection(Declaration)]
197 class DeclarationCollection:
198 pass
200 class Attribute(Node, INodeWithArguments):
201 Name as string
202 Arguments as ExpressionCollection
203 NamedArguments as ExpressionPairCollection
205 [collection(Attribute)]
206 class AttributeCollection:
207 pass
209 enum StatementModifierType:
210 None
212 Unless
213 While
215 class StatementModifier(Node):
216 Type as StatementModifierType
217 Condition as Expression
219 abstract class Statement(Node):
220 Modifier as StatementModifier
222 class GotoStatement(Statement):
223 Label as ReferenceExpression
225 class LabelStatement(Statement):
226 Name as string
228 class Block(Statement):
229 Statements as StatementCollection
231 [collection(Statement)]
232 class StatementCollection:
233 pass
235 class DeclarationStatement(Statement):
236 Declaration as Declaration
237 Initializer as Expression
239 class MacroStatement(Statement):
240 Name as string
241 Arguments as ExpressionCollection
243 [auto]
244 Block as Block
246 class TryStatement(Statement):
247 [auto]
248 ProtectedBlock as Block
249 ExceptionHandlers as ExceptionHandlerCollection
250 FailureBlock as Block
251 EnsureBlock as Block
253 class ExceptionHandler(Node):
254 Declaration as Declaration
255 FilterCondition as Expression
256 Flags as ExceptionHandlerFlags
258 [auto]
259 Block as Block
261 [collection(ExceptionHandler)]
262 class ExceptionHandlerCollection:
263 pass
265 class IfStatement(Statement):
266 Condition as Expression
267 TrueBlock as Block
268 FalseBlock as Block
270 class UnlessStatement(Statement):
271 Condition as Expression
273 [auto]
274 Block as Block
276 class ForStatement(Statement):
277 Declarations as DeclarationCollection
278 Iterator as Expression
280 [auto]
281 Block as Block
282 OrBlock as Block
283 ThenBlock as Block
285 class WhileStatement(Statement):
286 Condition as Expression
288 [auto]
289 Block as Block
290 OrBlock as Block
291 ThenBlock as Block
293 class BreakStatement(Statement):
294 pass
296 class ContinueStatement(Statement):
297 pass
299 class ReturnStatement(Statement):
300 Expression as Expression
302 class YieldStatement(Statement):
303 Expression as Expression
305 class RaiseStatement(Statement):
306 Exception as Expression
308 class UnpackStatement(Statement):
309 Declarations as DeclarationCollection
310 Expression as Expression
312 class ExpressionStatement(Statement):
313 [LexicalInfo]
314 Expression as Expression
316 abstract class Expression(Node):
317 pass
319 [collection(Expression)]
320 class ExpressionCollection:
321 pass
323 [ignore]
324 class OmittedExpression(Expression):
325 pass
327 class ExpressionPair(Node):
328 First as Expression
329 Second as Expression
331 [collection(ExpressionPair)]
332 class ExpressionPairCollection:
333 pass
335 class MethodInvocationExpression(Expression, INodeWithArguments):
336 Target as Expression
337 Arguments as ExpressionCollection
338 NamedArguments as ExpressionPairCollection
340 enum BinaryOperatorType:
341 None
342 Addition
343 Subtraction
344 Multiply
345 Division
346 Modulus
347 Exponentiation
348 LessThan
349 LessThanOrEqual
350 GreaterThan
351 GreaterThanOrEqual
352 Equality
353 Inequality
354 Match
355 NotMatch
356 Assign
357 InPlaceAddition
358 InPlaceSubtraction
359 InPlaceMultiply
360 InPlaceDivision
361 InPlaceBitwiseAnd
362 InPlaceBitwiseOr
363 ReferenceEquality
364 ReferenceInequality
365 TypeTest
366 Member
367 NotMember
370 BitwiseOr
371 BitwiseAnd
372 ExclusiveOr
373 InPlaceExclusiveOr
374 ShiftLeft
375 InPlaceShiftLeft
376 ShiftRight
377 InPlaceShiftRight
379 enum UnaryOperatorType:
380 None
381 UnaryNegation
382 Increment
383 Decrement
384 PostIncrement
385 PostDecrement
386 LogicalNot
387 Explode
388 OnesComplement
390 class UnaryExpression(Expression):
391 Operator as UnaryOperatorType
392 Operand as Expression
394 class BinaryExpression(Expression):
395 Operator as BinaryOperatorType
396 Left as Expression
397 Right as Expression
399 class ConditionalExpression(Expression):
400 Condition as Expression
401 TrueValue as Expression
402 FalseValue as Expression
404 class ReferenceExpression(Expression):
405 Name as string
407 class MemberReferenceExpression(ReferenceExpression):
408 Target as Expression
410 class GenericReferenceExpression(Expression):
411 Target as Expression
412 GenericArguments as TypeReferenceCollection
414 abstract class LiteralExpression(Expression):
415 pass
417 class QuasiquoteExpression(LiteralExpression):
418 Node as Node
420 class StringLiteralExpression(LiteralExpression):
421 Value as string
423 class CharLiteralExpression(StringLiteralExpression):
424 pass
426 class TimeSpanLiteralExpression(LiteralExpression):
427 Value as System.TimeSpan
429 class IntegerLiteralExpression(LiteralExpression):
430 Value as long
431 IsLong as bool
433 class DoubleLiteralExpression(LiteralExpression):
434 Value as double
435 IsSingle as bool
437 class NullLiteralExpression(LiteralExpression):
438 pass
440 class SelfLiteralExpression(LiteralExpression):
441 pass
443 class SuperLiteralExpression(LiteralExpression):
444 pass
446 class BoolLiteralExpression(LiteralExpression):
447 Value as bool
449 class RELiteralExpression(LiteralExpression):
450 Value as string
452 class SpliceExpression(Expression):
453 Expression as Expression
455 class SpliceTypeReference(TypeReference):
456 Expression as Expression
458 class SpliceMemberReferenceExpression(Expression):
459 Target as Expression
460 NameExpression as Expression
462 class SpliceTypeMember(TypeMember):
463 TypeMember as TypeMember
464 NameExpression as Expression
466 class SpliceParameterDeclaration(ParameterDeclaration):
467 ParameterDeclaration as ParameterDeclaration
468 NameExpression as Expression
470 class ExpressionInterpolationExpression(Expression):
471 Expressions as ExpressionCollection
473 class HashLiteralExpression(LiteralExpression):
474 Items as ExpressionPairCollection
476 class ListLiteralExpression(LiteralExpression):
477 Items as ExpressionCollection
479 class ArrayLiteralExpression(ListLiteralExpression):
480 Type as ArrayTypeReference
482 class GeneratorExpression(Expression):
483 Expression as Expression
484 Declarations as DeclarationCollection
485 Iterator as Expression
486 Filter as StatementModifier
488 class ExtendedGeneratorExpression(Expression):
489 Items as GeneratorExpressionCollection
491 [collection(GeneratorExpression)]
492 class GeneratorExpressionCollection:
493 pass
495 class Slice(Node):
496 Begin as Expression
497 End as Expression
498 Step as Expression
500 [collection(Slice)]
501 class SliceCollection:
502 pass
504 class SlicingExpression(Expression):
505 Target as Expression
506 Indices as SliceCollection
508 class TryCastExpression(Expression):
509 Target as Expression
510 Type as TypeReference
512 class CastExpression(Expression):
513 Target as Expression
514 Type as TypeReference
516 class TypeofExpression(Expression):
517 Type as TypeReference