var n_classdefs = new ANodes[AClassdef](self)
end
-# The declaration of the module with the documentation, name, and annotations
-class AModuledecl
+# Abstract class for definition of entities
+abstract class ADefinition
super Prod
var n_doc: nullable ADoc = null is writable
var n_kwredef: nullable TKwredef = null is writable
- var n_visibility: AVisibility is writable, noinit
+ var n_visibility: nullable AVisibility = null is writable
+end
+
+# The declaration of the module with the documentation, name, and annotations
+class AModuledecl
+ super ADefinition
var n_kwmodule: TKwmodule is writable, noinit
var n_name: AModuleName is writable, noinit
end
# A import clause of a module
abstract class AImport
super Prod
+ var n_visibility: AVisibility is writable, noinit
+ var n_kwimport: TKwimport is writable, noinit
end
# A standard import clause. eg `import x`
class AStdImport
super AImport
- var n_visibility: AVisibility is writable, noinit
- var n_kwimport: TKwimport is writable, noinit
var n_name: AModuleName is writable, noinit
end
# The special import clause of the kernel module. eg `import end`
class ANoImport
super AImport
- var n_visibility: AVisibility is writable, noinit
- var n_kwimport: TKwimport is writable, noinit
var n_kwend: TKwend is writable, noinit
end
# A standard class definition with a name, superclasses and properties
class AStdClassdef
super AClassdef
- var n_doc: nullable ADoc = null is writable
- var n_kwredef: nullable TKwredef = null is writable
- var n_visibility: AVisibility is writable, noinit
+ super ADefinition
var n_classkind: AClasskind is writable, noinit
var n_id: nullable TClassid = null is writable
var n_formaldefs = new ANodes[AFormaldef](self)
# The definition of a property
abstract class APropdef
- super Prod
- var n_doc: nullable ADoc = null is writable
- var n_kwredef: nullable TKwredef = null is writable
- var n_visibility: nullable AVisibility = null is writable
+ super ADefinition
end
# A definition of an attribute
# The initial value, if any
var n_expr: nullable AExpr = null is writable
+
+ var n_block: nullable AExpr = null is writable
+
redef fun hot_location
do
return n_id2.location
var n_label: nullable ALabel = null is writable
end
-# A `break` statement.
-class ABreakExpr
+# A `break` or a `continue`
+abstract class AEscapeExpr
super AExpr
super ALabelable
- var n_kwbreak: TKwbreak is writable, noinit
var n_expr: nullable AExpr = null is writable
end
+# A `break` statement.
+class ABreakExpr
+ super AEscapeExpr
+ var n_kwbreak: TKwbreak is writable, noinit
+end
+
# An `abort` statement
class AAbortExpr
super AExpr
# A `continue` statement
class AContinueExpr
- super AExpr
- super ALabelable
+ super AEscapeExpr
var n_kwcontinue: nullable TKwcontinue = null is writable
- var n_expr: nullable AExpr = null is writable
end
# A `do` statement
super AExpr
end
-# A `or` expression
-class AOrExpr
+# Something that is binary boolean expression
+abstract class ABinBoolExpr
super ABoolExpr
var n_expr: AExpr is writable, noinit
var n_expr2: AExpr is writable, noinit
end
+# A `or` expression
+class AOrExpr
+ super ABinBoolExpr
+end
+
# A `and` expression
class AAndExpr
- super ABoolExpr
- var n_expr: AExpr is writable, noinit
- var n_expr2: AExpr is writable, noinit
+ super ABinBoolExpr
end
# A `or else` expression
class AOrElseExpr
- super ABoolExpr
- var n_expr: AExpr is writable, noinit
- var n_expr2: AExpr is writable, noinit
+ super ABinBoolExpr
end
# A `implies` expression
class AImpliesExpr
- super ABoolExpr
- var n_expr: AExpr is writable, noinit
- var n_expr2: AExpr is writable, noinit
+ super ABinBoolExpr
end
# A `not` expression
class AArrayExpr
super AExpr
var n_obra: TObra is writable, noinit
- var n_exprs: AExprs is writable, noinit
+ var n_exprs = new ANodes[AExpr](self)
var n_type: nullable AType = null is writable
var n_cbra: TCbra is writable, noinit
end
var n_cpar: TCpar is writable, noinit
end
-# A type cast. eg `x.as(T)`
-class AAsCastExpr
+# A cast, against a type or `not null`
+class AAsCastForm
super AExpr
var n_expr: AExpr is writable, noinit
var n_kwas: TKwas is writable, noinit
var n_opar: nullable TOpar = null is writable
- var n_type: AType is writable, noinit
var n_cpar: nullable TCpar = null is writable
end
+# A type cast. eg `x.as(T)`
+class AAsCastExpr
+ super AAsCastForm
+ var n_type: AType is writable, noinit
+end
+
# A as-not-null cast. eg `x.as(not null)`
class AAsNotnullExpr
- super AExpr
- var n_expr: AExpr is writable, noinit
- var n_kwas: TKwas is writable, noinit
- var n_opar: nullable TOpar = null is writable
+ super AAsCastForm
var n_kwnot: TKwnot is writable, noinit
var n_kwnull: TKwnull is writable, noinit
- var n_cpar: nullable TCpar = null is writable
end
# A is-set check of old-style attributes. eg `isset x._a`
var n_dotdotdot: TDotdotdot is writable, noinit
end
+# A list of expression separated with commas (arguments for instance)
+class AManyExpr
+ super AExpr
+ var n_exprs = new ANodes[AExpr](self)
+end
+
# A special expression that encapsulates a static type
# Can only be found in special construction like arguments of annotations.
class ATypeExpr
var n_type: AType is writable, noinit
end
+# A special expression that encapsulates a method identifier
+# Can only be found in special construction like arguments of annotations.
+class AMethidExpr
+ super AExpr
+ # The receiver, is any
+ var n_expr: AExpr is writable, noinit
+ var n_id: AMethid is writable, noinit
+end
+
# A special expression that encapsulate an annotation
# Can only be found in special construction like arguments of annotations.
class AAtExpr
# A single annotation
class AAnnotation
- super Prod
- var n_doc: nullable ADoc = null is writable
- var n_kwredef: nullable TKwredef = null is writable
- var n_visibility: nullable AVisibility is writable
+ super ADefinition
var n_atid: AAtid is writable, noinit
var n_opar: nullable TOpar = null is writable
var n_args = new ANodes[AExpr](self)
class Start
super Prod
var n_base: nullable AModule is writable
- var n_eof: EOF is writable, noinit
- init(n_base: nullable AModule, n_eof: EOF)
- do
- self._n_base = n_base
- self._n_eof = n_eof
- end
+ var n_eof: EOF is writable
end