No significant changes. Adding a few more tests to the primitives test case and...
[boo.git] / ast.model.boo
bloba826427980cc5c72144afb45ff9ccea3de8a41c1
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
283 class WhileStatement(Statement):
284 Condition as Expression
286 [auto]
287 Block as Block
289 class BreakStatement(Statement):
290 pass
292 class ContinueStatement(Statement):
293 pass
295 class ReturnStatement(Statement):
296 Expression as Expression
298 class YieldStatement(Statement):
299 Expression as Expression
301 class RaiseStatement(Statement):
302 Exception as Expression
304 class UnpackStatement(Statement):
305 Declarations as DeclarationCollection
306 Expression as Expression
308 class ExpressionStatement(Statement):
309 [LexicalInfo]
310 Expression as Expression
312 abstract class Expression(Node):
313 pass
315 [collection(Expression)]
316 class ExpressionCollection:
317 pass
319 [ignore]
320 class OmittedExpression(Expression):
321 pass
323 class ExpressionPair(Node):
324 First as Expression
325 Second as Expression
327 [collection(ExpressionPair)]
328 class ExpressionPairCollection:
329 pass
331 class MethodInvocationExpression(Expression, INodeWithArguments):
332 Target as Expression
333 Arguments as ExpressionCollection
334 NamedArguments as ExpressionPairCollection
336 enum BinaryOperatorType:
337 None
338 Addition
339 Subtraction
340 Multiply
341 Division
342 Modulus
343 Exponentiation
344 LessThan
345 LessThanOrEqual
346 GreaterThan
347 GreaterThanOrEqual
348 Equality
349 Inequality
350 Match
351 NotMatch
352 Assign
353 InPlaceAddition
354 InPlaceSubtraction
355 InPlaceMultiply
356 InPlaceDivision
357 InPlaceBitwiseAnd
358 InPlaceBitwiseOr
359 ReferenceEquality
360 ReferenceInequality
361 TypeTest
362 Member
363 NotMember
366 BitwiseOr
367 BitwiseAnd
368 ExclusiveOr
369 InPlaceExclusiveOr
370 ShiftLeft
371 InPlaceShiftLeft
372 ShiftRight
373 InPlaceShiftRight
375 enum UnaryOperatorType:
376 None
377 UnaryNegation
378 Increment
379 Decrement
380 PostIncrement
381 PostDecrement
382 LogicalNot
383 Explode
384 OnesComplement
386 class UnaryExpression(Expression):
387 Operator as UnaryOperatorType
388 Operand as Expression
390 class BinaryExpression(Expression):
391 Operator as BinaryOperatorType
392 Left as Expression
393 Right as Expression
395 class ConditionalExpression(Expression):
396 Condition as Expression
397 TrueValue as Expression
398 FalseValue as Expression
400 class ReferenceExpression(Expression):
401 Name as string
403 class MemberReferenceExpression(ReferenceExpression):
404 Target as Expression
406 class GenericReferenceExpression(Expression):
407 Target as Expression
408 GenericArguments as TypeReferenceCollection
410 abstract class LiteralExpression(Expression):
411 pass
413 class QuasiquoteExpression(LiteralExpression):
414 Node as Node
416 class StringLiteralExpression(LiteralExpression):
417 Value as string
419 class CharLiteralExpression(StringLiteralExpression):
420 pass
422 class TimeSpanLiteralExpression(LiteralExpression):
423 Value as System.TimeSpan
425 class IntegerLiteralExpression(LiteralExpression):
426 Value as long
427 IsLong as bool
429 class DoubleLiteralExpression(LiteralExpression):
430 Value as double
431 IsSingle as bool
433 class NullLiteralExpression(LiteralExpression):
434 pass
436 class SelfLiteralExpression(LiteralExpression):
437 pass
439 class SuperLiteralExpression(LiteralExpression):
440 pass
442 class BoolLiteralExpression(LiteralExpression):
443 Value as bool
445 class RELiteralExpression(LiteralExpression):
446 Value as string
448 class SpliceExpression(Expression):
449 Expression as Expression
451 class SpliceTypeReference(TypeReference):
452 Expression as Expression
454 class SpliceMemberReferenceExpression(Expression):
455 Target as Expression
456 NameExpression as Expression
458 class SpliceTypeMember(TypeMember):
459 TypeMember as TypeMember
460 NameExpression as Expression
462 class SpliceParameterDeclaration(ParameterDeclaration):
463 ParameterDeclaration as ParameterDeclaration
464 NameExpression as Expression
466 class ExpressionInterpolationExpression(Expression):
467 Expressions as ExpressionCollection
469 class HashLiteralExpression(LiteralExpression):
470 Items as ExpressionPairCollection
472 class ListLiteralExpression(LiteralExpression):
473 Items as ExpressionCollection
475 class ArrayLiteralExpression(ListLiteralExpression):
476 Type as ArrayTypeReference
478 class GeneratorExpression(Expression):
479 Expression as Expression
480 Declarations as DeclarationCollection
481 Iterator as Expression
482 Filter as StatementModifier
484 class ExtendedGeneratorExpression(Expression):
485 Items as GeneratorExpressionCollection
487 [collection(GeneratorExpression)]
488 class GeneratorExpressionCollection:
489 pass
491 class Slice(Node):
492 Begin as Expression
493 End as Expression
494 Step as Expression
496 [collection(Slice)]
497 class SliceCollection:
498 pass
500 class SlicingExpression(Expression):
501 Target as Expression
502 Indices as SliceCollection
504 class TryCastExpression(Expression):
505 Target as Expression
506 Type as TypeReference
508 class CastExpression(Expression):
509 Target as Expression
510 Type as TypeReference
512 class TypeofExpression(Expression):
513 Type as TypeReference