X-Git-Url: http://nitlanguage.org diff --git a/src/parser/parser_prod.nit b/src/parser/parser_prod.nit index f3826dc..1efa612 100644 --- a/src/parser/parser_prod.nit +++ b/src/parser/parser_prod.nit @@ -1,6 +1,6 @@ # Production AST nodes full definition. # This file was generated by SableCC (http://www.sablecc.org/). -module parser_prod is no_warning("missing-doc") +module parser_prod is generated, no_warning("missing-doc") import lexer intrude import parser_nodes @@ -386,7 +386,7 @@ redef class AStdClassdef n_kwredef: nullable TKwredef, n_visibility: nullable AVisibility, n_classkind: nullable AClasskind, - n_id: nullable TClassid, + n_qid: nullable AQclassid, n_obra: nullable TObra, n_formaldefs: Collection[Object], # Should be Collection[AFormaldef] n_cbra: nullable TCbra, @@ -403,8 +403,8 @@ redef class AStdClassdef n_visibility.parent = self _n_classkind = n_classkind.as(not null) n_classkind.parent = self - _n_id = n_id - if n_id != null then n_id.parent = self + _n_qid = n_qid + if n_qid != null then n_qid.parent = self _n_obra = n_obra if n_obra != null then n_obra.parent = self self.n_formaldefs.unsafe_add_all(n_formaldefs) @@ -435,8 +435,8 @@ redef class AStdClassdef n_classkind = new_child.as(AClasskind) return end - if _n_id == old_child then - n_id = new_child.as(nullable TClassid) + if _n_qid == old_child then + n_qid = new_child.as(nullable AQclassid) return end if _n_obra == old_child then @@ -479,9 +479,9 @@ redef class AStdClassdef _n_classkind = node node.parent = self end - redef fun n_id=(node) + redef fun n_qid=(node) do - _n_id = node + _n_qid = node if node != null then node.parent = self end redef fun n_obra=(node) @@ -512,7 +512,7 @@ redef class AStdClassdef v.enter_visit(_n_kwredef) v.enter_visit(_n_visibility) v.enter_visit(_n_classkind) - v.enter_visit(_n_id) + v.enter_visit(_n_qid) v.enter_visit(_n_obra) n_formaldefs.visit_all(v) v.enter_visit(_n_cbra) @@ -732,6 +732,35 @@ redef class AExternClasskind v.enter_visit(_n_kwclass) end end +redef class ASubsetClasskind + init init_asubsetclasskind ( + n_kwsubset: nullable TKwsubset + ) + do + _n_kwsubset = n_kwsubset.as(not null) + n_kwsubset.parent = self + end + + redef fun replace_child(old_child: ANode, new_child: nullable ANode) + do + if _n_kwsubset == old_child then + n_kwsubset = new_child.as(TKwsubset) + return + end + end + + redef fun n_kwsubset=(node) + do + _n_kwsubset = node + node.parent = self + end + + + redef fun visit_all(v: Visitor) + do + v.enter_visit(_n_kwsubset) + end +end redef class AFormaldef init init_aformaldef ( n_id: nullable TClassid, @@ -1007,7 +1036,7 @@ redef class ATypePropdef n_kwredef: nullable TKwredef, n_visibility: nullable AVisibility, n_kwtype: nullable TKwtype, - n_id: nullable TClassid, + n_qid: nullable AQclassid, n_type: nullable AType, n_annotations: nullable AAnnotations ) @@ -1020,8 +1049,8 @@ redef class ATypePropdef n_visibility.parent = self _n_kwtype = n_kwtype.as(not null) n_kwtype.parent = self - _n_id = n_id.as(not null) - n_id.parent = self + _n_qid = n_qid.as(not null) + n_qid.parent = self _n_type = n_type.as(not null) n_type.parent = self _n_annotations = n_annotations @@ -1046,8 +1075,8 @@ redef class ATypePropdef n_kwtype = new_child.as(TKwtype) return end - if _n_id == old_child then - n_id = new_child.as(TClassid) + if _n_qid == old_child then + n_qid = new_child.as(AQclassid) return end if _n_type == old_child then @@ -1080,9 +1109,9 @@ redef class ATypePropdef _n_kwtype = node node.parent = self end - redef fun n_id=(node) + redef fun n_qid=(node) do - _n_id = node + _n_qid = node node.parent = self end redef fun n_type=(node) @@ -1103,7 +1132,7 @@ redef class ATypePropdef v.enter_visit(_n_kwredef) v.enter_visit(_n_visibility) v.enter_visit(_n_kwtype) - v.enter_visit(_n_id) + v.enter_visit(_n_qid) v.enter_visit(_n_type) v.enter_visit(_n_annotations) end @@ -1115,6 +1144,7 @@ redef class AMethPropdef n_visibility: nullable AVisibility, n_kwmeth: nullable TKwmeth, n_kwinit: nullable TKwinit, + n_kwisa: nullable TKwisa, n_kwnew: nullable TKwnew, n_methid: nullable AMethid, n_signature: nullable ASignature, @@ -1136,6 +1166,8 @@ redef class AMethPropdef if n_kwmeth != null then n_kwmeth.parent = self _n_kwinit = n_kwinit if n_kwinit != null then n_kwinit.parent = self + _n_kwisa = n_kwisa + if n_kwisa != null then n_kwisa.parent = self _n_kwnew = n_kwnew if n_kwnew != null then n_kwnew.parent = self _n_methid = n_methid @@ -1178,6 +1210,10 @@ redef class AMethPropdef n_kwinit = new_child.as(nullable TKwinit) return end + if _n_kwisa == old_child then + n_kwisa = new_child.as(nullable TKwisa) + return + end if _n_kwnew == old_child then n_kwnew = new_child.as(nullable TKwnew) return @@ -1241,6 +1277,11 @@ redef class AMethPropdef _n_kwinit = node if node != null then node.parent = self end + redef fun n_kwisa=(node) + do + _n_kwisa = node + if node != null then node.parent = self + end redef fun n_kwnew=(node) do _n_kwnew = node @@ -1295,6 +1336,7 @@ redef class AMethPropdef v.enter_visit(_n_visibility) v.enter_visit(_n_kwmeth) v.enter_visit(_n_kwinit) + v.enter_visit(_n_kwisa) v.enter_visit(_n_kwnew) v.enter_visit(_n_methid) v.enter_visit(_n_signature) @@ -2230,6 +2272,90 @@ redef class ABraassignMethid v.enter_visit(_n_assign) end end +redef class AQid + init init_aqid ( + n_qualified: nullable AQualified, + n_id: nullable TId + ) + do + _n_qualified = n_qualified + if n_qualified != null then n_qualified.parent = self + _n_id = n_id.as(not null) + n_id.parent = self + end + + redef fun replace_child(old_child: ANode, new_child: nullable ANode) + do + if _n_qualified == old_child then + n_qualified = new_child.as(nullable AQualified) + return + end + if _n_id == old_child then + n_id = new_child.as(TId) + return + end + end + + redef fun n_qualified=(node) + do + _n_qualified = node + if node != null then node.parent = self + end + redef fun n_id=(node) + do + _n_id = node + node.parent = self + end + + + redef fun visit_all(v: Visitor) + do + v.enter_visit(_n_qualified) + v.enter_visit(_n_id) + end +end +redef class AQclassid + init init_aqclassid ( + n_qualified: nullable AQualified, + n_id: nullable TClassid + ) + do + _n_qualified = n_qualified + if n_qualified != null then n_qualified.parent = self + _n_id = n_id.as(not null) + n_id.parent = self + end + + redef fun replace_child(old_child: ANode, new_child: nullable ANode) + do + if _n_qualified == old_child then + n_qualified = new_child.as(nullable AQualified) + return + end + if _n_id == old_child then + n_id = new_child.as(TClassid) + return + end + end + + redef fun n_qualified=(node) + do + _n_qualified = node + if node != null then node.parent = self + end + redef fun n_id=(node) + do + _n_id = node + node.parent = self + end + + + redef fun visit_all(v: Visitor) + do + v.enter_visit(_n_qualified) + v.enter_visit(_n_id) + end +end redef class ASignature init init_asignature ( n_opar: nullable TOpar, @@ -2360,7 +2486,7 @@ end redef class AType init init_atype ( n_kwnullable: nullable TKwnullable, - n_id: nullable TClassid, + n_qid: nullable AQclassid, n_obra: nullable TObra, n_types: Collection[Object], # Should be Collection[AType] n_cbra: nullable TCbra, @@ -2369,8 +2495,8 @@ redef class AType do _n_kwnullable = n_kwnullable if n_kwnullable != null then n_kwnullable.parent = self - _n_id = n_id.as(not null) - n_id.parent = self + _n_qid = n_qid.as(not null) + n_qid.parent = self _n_obra = n_obra if n_obra != null then n_obra.parent = self self.n_types.unsafe_add_all(n_types) @@ -2386,8 +2512,8 @@ redef class AType n_kwnullable = new_child.as(nullable TKwnullable) return end - if _n_id == old_child then - n_id = new_child.as(TClassid) + if _n_qid == old_child then + n_qid = new_child.as(AQclassid) return end if _n_obra == old_child then @@ -2410,9 +2536,9 @@ redef class AType _n_kwnullable = node if node != null then node.parent = self end - redef fun n_id=(node) + redef fun n_qid=(node) do - _n_id = node + _n_qid = node node.parent = self end redef fun n_obra=(node) @@ -2435,7 +2561,7 @@ redef class AType redef fun visit_all(v: Visitor) do v.enter_visit(_n_kwnullable) - v.enter_visit(_n_id) + v.enter_visit(_n_qid) v.enter_visit(_n_obra) n_types.visit_all(v) v.enter_visit(_n_cbra) @@ -2653,6 +2779,48 @@ redef class AReturnExpr v.enter_visit(_n_expr) end end +redef class AYieldExpr + init init_ayieldexpr ( + n_kwyield: nullable TKwyield, + n_expr: nullable AExpr + ) + do + _n_kwyield = n_kwyield.as(not null) + n_kwyield.parent = self + _n_expr = n_expr.as(not null) + n_expr.parent = self + end + + redef fun replace_child(old_child: ANode, new_child: nullable ANode) + do + if _n_kwyield == old_child then + n_kwyield = new_child.as(TKwyield) + return + end + if _n_expr == old_child then + n_expr = new_child.as(AExpr) + return + end + end + + redef fun n_kwyield=(node) + do + _n_kwyield = node + node.parent = self + end + redef fun n_expr=(node) + do + _n_expr = node + node.parent = self + end + + + redef fun visit_all(v: Visitor) + do + v.enter_visit(_n_kwyield) + v.enter_visit(_n_expr) + end +end redef class ABreakExpr init init_abreakexpr ( n_kwbreak: nullable TKwbreak, @@ -2770,6 +2938,8 @@ redef class ADoExpr init init_adoexpr ( n_kwdo: nullable TKwdo, n_block: nullable AExpr, + n_kwcatch: nullable TKwcatch, + n_catch: nullable AExpr, n_label: nullable ALabel ) do @@ -2777,6 +2947,10 @@ redef class ADoExpr n_kwdo.parent = self _n_block = n_block if n_block != null then n_block.parent = self + _n_kwcatch = n_kwcatch + if n_kwcatch != null then n_kwcatch.parent = self + _n_catch = n_catch + if n_catch != null then n_catch.parent = self _n_label = n_label if n_label != null then n_label.parent = self end @@ -2791,6 +2965,14 @@ redef class ADoExpr n_block = new_child.as(nullable AExpr) return end + if _n_kwcatch == old_child then + n_kwcatch = new_child.as(nullable TKwcatch) + return + end + if _n_catch == old_child then + n_catch = new_child.as(nullable AExpr) + return + end if _n_label == old_child then n_label = new_child.as(nullable ALabel) return @@ -2807,6 +2989,16 @@ redef class ADoExpr _n_block = node if node != null then node.parent = self end + redef fun n_kwcatch=(node) + do + _n_kwcatch = node + if node != null then node.parent = self + end + redef fun n_catch=(node) + do + _n_catch = node + if node != null then node.parent = self + end redef fun n_label=(node) do _n_label = node @@ -2818,6 +3010,8 @@ redef class ADoExpr do v.enter_visit(_n_kwdo) v.enter_visit(_n_block) + v.enter_visit(_n_kwcatch) + v.enter_visit(_n_catch) v.enter_visit(_n_label) end end @@ -3148,9 +3342,7 @@ end redef class AForExpr init init_aforexpr ( n_kwfor: nullable TKwfor, - n_ids: Collection[Object], # Should be Collection[TId] - n_kwin: nullable TKwin, - n_expr: nullable AExpr, + n_groups: Collection[Object], # Should be Collection[AForGroup] n_kwdo: nullable TKwdo, n_block: nullable AExpr, n_label: nullable ALabel @@ -3158,11 +3350,7 @@ redef class AForExpr do _n_kwfor = n_kwfor.as(not null) n_kwfor.parent = self - self.n_ids.unsafe_add_all(n_ids) - _n_kwin = n_kwin.as(not null) - n_kwin.parent = self - _n_expr = n_expr.as(not null) - n_expr.parent = self + self.n_groups.unsafe_add_all(n_groups) _n_kwdo = n_kwdo.as(not null) n_kwdo.parent = self _n_block = n_block @@ -3177,15 +3365,7 @@ redef class AForExpr n_kwfor = new_child.as(TKwfor) return end - if n_ids.replace_child(old_child, new_child) then return - if _n_kwin == old_child then - n_kwin = new_child.as(TKwin) - return - end - if _n_expr == old_child then - n_expr = new_child.as(AExpr) - return - end + if n_groups.replace_child(old_child, new_child) then return if _n_kwdo == old_child then n_kwdo = new_child.as(TKwdo) return @@ -3205,16 +3385,6 @@ redef class AForExpr _n_kwfor = node node.parent = self end - redef fun n_kwin=(node) - do - _n_kwin = node - node.parent = self - end - redef fun n_expr=(node) - do - _n_expr = node - node.parent = self - end redef fun n_kwdo=(node) do _n_kwdo = node @@ -3235,9 +3405,7 @@ redef class AForExpr redef fun visit_all(v: Visitor) do v.enter_visit(_n_kwfor) - n_ids.visit_all(v) - v.enter_visit(_n_kwin) - v.enter_visit(_n_expr) + n_groups.visit_all(v) v.enter_visit(_n_kwdo) v.enter_visit(_n_block) v.enter_visit(_n_label) @@ -4968,7 +5136,7 @@ redef class ANewExpr init init_anewexpr ( n_kwnew: nullable TKwnew, n_type: nullable AType, - n_id: nullable TId, + n_qid: nullable AQid, n_args: nullable AExprs ) do @@ -4976,8 +5144,8 @@ redef class ANewExpr n_kwnew.parent = self _n_type = n_type.as(not null) n_type.parent = self - _n_id = n_id - if n_id != null then n_id.parent = self + _n_qid = n_qid + if n_qid != null then n_qid.parent = self _n_args = n_args.as(not null) n_args.parent = self end @@ -4992,8 +5160,8 @@ redef class ANewExpr n_type = new_child.as(AType) return end - if _n_id == old_child then - n_id = new_child.as(nullable TId) + if _n_qid == old_child then + n_qid = new_child.as(nullable AQid) return end if _n_args == old_child then @@ -5012,9 +5180,9 @@ redef class ANewExpr _n_type = node node.parent = self end - redef fun n_id=(node) + redef fun n_qid=(node) do - _n_id = node + _n_qid = node if node != null then node.parent = self end redef fun n_args=(node) @@ -5028,7 +5196,7 @@ redef class ANewExpr do v.enter_visit(_n_kwnew) v.enter_visit(_n_type) - v.enter_visit(_n_id) + v.enter_visit(_n_qid) v.enter_visit(_n_args) end end @@ -5213,14 +5381,14 @@ end redef class ACallExpr init init_acallexpr ( n_expr: nullable AExpr, - n_id: nullable TId, + n_qid: nullable AQid, n_args: nullable AExprs ) do _n_expr = n_expr.as(not null) n_expr.parent = self - _n_id = n_id.as(not null) - n_id.parent = self + _n_qid = n_qid.as(not null) + n_qid.parent = self _n_args = n_args.as(not null) n_args.parent = self end @@ -5231,8 +5399,8 @@ redef class ACallExpr n_expr = new_child.as(AExpr) return end - if _n_id == old_child then - n_id = new_child.as(TId) + if _n_qid == old_child then + n_qid = new_child.as(AQid) return end if _n_args == old_child then @@ -5246,9 +5414,9 @@ redef class ACallExpr _n_expr = node node.parent = self end - redef fun n_id=(node) + redef fun n_qid=(node) do - _n_id = node + _n_qid = node node.parent = self end redef fun n_args=(node) @@ -5261,14 +5429,14 @@ redef class ACallExpr redef fun visit_all(v: Visitor) do v.enter_visit(_n_expr) - v.enter_visit(_n_id) + v.enter_visit(_n_qid) v.enter_visit(_n_args) end end redef class ACallAssignExpr init init_acallassignexpr ( n_expr: nullable AExpr, - n_id: nullable TId, + n_qid: nullable AQid, n_args: nullable AExprs, n_assign: nullable TAssign, n_value: nullable AExpr @@ -5276,8 +5444,8 @@ redef class ACallAssignExpr do _n_expr = n_expr.as(not null) n_expr.parent = self - _n_id = n_id.as(not null) - n_id.parent = self + _n_qid = n_qid.as(not null) + n_qid.parent = self _n_args = n_args.as(not null) n_args.parent = self _n_assign = n_assign.as(not null) @@ -5292,8 +5460,8 @@ redef class ACallAssignExpr n_expr = new_child.as(AExpr) return end - if _n_id == old_child then - n_id = new_child.as(TId) + if _n_qid == old_child then + n_qid = new_child.as(AQid) return end if _n_args == old_child then @@ -5315,9 +5483,9 @@ redef class ACallAssignExpr _n_expr = node node.parent = self end - redef fun n_id=(node) + redef fun n_qid=(node) do - _n_id = node + _n_qid = node node.parent = self end redef fun n_args=(node) @@ -5340,7 +5508,7 @@ redef class ACallAssignExpr redef fun visit_all(v: Visitor) do v.enter_visit(_n_expr) - v.enter_visit(_n_id) + v.enter_visit(_n_qid) v.enter_visit(_n_args) v.enter_visit(_n_assign) v.enter_visit(_n_value) @@ -5349,7 +5517,7 @@ end redef class ACallReassignExpr init init_acallreassignexpr ( n_expr: nullable AExpr, - n_id: nullable TId, + n_qid: nullable AQid, n_args: nullable AExprs, n_assign_op: nullable AAssignOp, n_value: nullable AExpr @@ -5357,8 +5525,8 @@ redef class ACallReassignExpr do _n_expr = n_expr.as(not null) n_expr.parent = self - _n_id = n_id.as(not null) - n_id.parent = self + _n_qid = n_qid.as(not null) + n_qid.parent = self _n_args = n_args.as(not null) n_args.parent = self _n_assign_op = n_assign_op.as(not null) @@ -5373,8 +5541,8 @@ redef class ACallReassignExpr n_expr = new_child.as(AExpr) return end - if _n_id == old_child then - n_id = new_child.as(TId) + if _n_qid == old_child then + n_qid = new_child.as(AQid) return end if _n_args == old_child then @@ -5396,9 +5564,9 @@ redef class ACallReassignExpr _n_expr = node node.parent = self end - redef fun n_id=(node) + redef fun n_qid=(node) do - _n_id = node + _n_qid = node node.parent = self end redef fun n_args=(node) @@ -5421,7 +5589,7 @@ redef class ACallReassignExpr redef fun visit_all(v: Visitor) do v.enter_visit(_n_expr) - v.enter_visit(_n_id) + v.enter_visit(_n_qid) v.enter_visit(_n_args) v.enter_visit(_n_assign_op) v.enter_visit(_n_value) @@ -6352,22 +6520,22 @@ redef class ANullExpr v.enter_visit(_n_annotations) end end -redef class ADecIntExpr - init init_adecintexpr ( - n_number: nullable TNumber, +redef class AIntegerExpr + init init_aintegerexpr ( + n_integer: nullable TInteger, n_annotations: nullable AAnnotations ) do - _n_number = n_number.as(not null) - n_number.parent = self + _n_integer = n_integer.as(not null) + n_integer.parent = self _n_annotations = n_annotations if n_annotations != null then n_annotations.parent = self end redef fun replace_child(old_child: ANode, new_child: nullable ANode) do - if _n_number == old_child then - n_number = new_child.as(TNumber) + if _n_integer == old_child then + n_integer = new_child.as(TInteger) return end if _n_annotations == old_child then @@ -6376,9 +6544,9 @@ redef class ADecIntExpr end end - redef fun n_number=(node) + redef fun n_integer=(node) do - _n_number = node + _n_integer = node node.parent = self end redef fun n_annotations=(node) @@ -6390,26 +6558,26 @@ redef class ADecIntExpr redef fun visit_all(v: Visitor) do - v.enter_visit(_n_number) + v.enter_visit(_n_integer) v.enter_visit(_n_annotations) end end -redef class AHexIntExpr - init init_ahexintexpr ( - n_hex_number: nullable THexNumber, +redef class AFloatExpr + init init_afloatexpr ( + n_float: nullable TFloat, n_annotations: nullable AAnnotations ) do - _n_hex_number = n_hex_number.as(not null) - n_hex_number.parent = self + _n_float = n_float.as(not null) + n_float.parent = self _n_annotations = n_annotations if n_annotations != null then n_annotations.parent = self end redef fun replace_child(old_child: ANode, new_child: nullable ANode) do - if _n_hex_number == old_child then - n_hex_number = new_child.as(THexNumber) + if _n_float == old_child then + n_float = new_child.as(TFloat) return end if _n_annotations == old_child then @@ -6418,9 +6586,9 @@ redef class AHexIntExpr end end - redef fun n_hex_number=(node) + redef fun n_float=(node) do - _n_hex_number = node + _n_float = node node.parent = self end redef fun n_annotations=(node) @@ -6432,26 +6600,26 @@ redef class AHexIntExpr redef fun visit_all(v: Visitor) do - v.enter_visit(_n_hex_number) + v.enter_visit(_n_float) v.enter_visit(_n_annotations) end end -redef class ABinIntExpr - init init_abinintexpr ( - n_bin_number: nullable TBinNumber, +redef class ACharExpr + init init_acharexpr ( + n_char: nullable TChar, n_annotations: nullable AAnnotations ) do - _n_bin_number = n_bin_number.as(not null) - n_bin_number.parent = self + _n_char = n_char.as(not null) + n_char.parent = self _n_annotations = n_annotations if n_annotations != null then n_annotations.parent = self end redef fun replace_child(old_child: ANode, new_child: nullable ANode) do - if _n_bin_number == old_child then - n_bin_number = new_child.as(TBinNumber) + if _n_char == old_child then + n_char = new_child.as(TChar) return end if _n_annotations == old_child then @@ -6460,9 +6628,9 @@ redef class ABinIntExpr end end - redef fun n_bin_number=(node) + redef fun n_char=(node) do - _n_bin_number = node + _n_char = node node.parent = self end redef fun n_annotations=(node) @@ -6474,301 +6642,7 @@ redef class ABinIntExpr redef fun visit_all(v: Visitor) do - v.enter_visit(_n_bin_number) - v.enter_visit(_n_annotations) - end -end -redef class AOctIntExpr - init init_aoctintexpr ( - n_oct_number: nullable TOctNumber, - n_annotations: nullable AAnnotations - ) - do - _n_oct_number = n_oct_number.as(not null) - n_oct_number.parent = self - _n_annotations = n_annotations - if n_annotations != null then n_annotations.parent = self - end - - redef fun replace_child(old_child: ANode, new_child: nullable ANode) - do - if _n_oct_number == old_child then - n_oct_number = new_child.as(TOctNumber) - return - end - if _n_annotations == old_child then - n_annotations = new_child.as(nullable AAnnotations) - return - end - end - - redef fun n_oct_number=(node) - do - _n_oct_number = node - node.parent = self - end - redef fun n_annotations=(node) - do - _n_annotations = node - if node != null then node.parent = self - end - - - redef fun visit_all(v: Visitor) - do - v.enter_visit(_n_oct_number) - v.enter_visit(_n_annotations) - end -end -redef class ADecByteExpr - init init_adecbyteexpr ( - n_bytenum: nullable TBytenum, - n_annotations: nullable AAnnotations - ) - do - _n_bytenum = n_bytenum.as(not null) - n_bytenum.parent = self - _n_annotations = n_annotations - if n_annotations != null then n_annotations.parent = self - end - - redef fun replace_child(old_child: ANode, new_child: nullable ANode) - do - if _n_bytenum == old_child then - n_bytenum = new_child.as(TBytenum) - return - end - if _n_annotations == old_child then - n_annotations = new_child.as(nullable AAnnotations) - return - end - end - - redef fun n_bytenum=(node) - do - _n_bytenum = node - node.parent = self - end - redef fun n_annotations=(node) - do - _n_annotations = node - if node != null then node.parent = self - end - - - redef fun visit_all(v: Visitor) - do - v.enter_visit(_n_bytenum) - v.enter_visit(_n_annotations) - end -end -redef class AHexByteExpr - init init_ahexbyteexpr ( - n_hex_bytenum: nullable THexBytenum, - n_annotations: nullable AAnnotations - ) - do - _n_hex_bytenum = n_hex_bytenum.as(not null) - n_hex_bytenum.parent = self - _n_annotations = n_annotations - if n_annotations != null then n_annotations.parent = self - end - - redef fun replace_child(old_child: ANode, new_child: nullable ANode) - do - if _n_hex_bytenum == old_child then - n_hex_bytenum = new_child.as(THexBytenum) - return - end - if _n_annotations == old_child then - n_annotations = new_child.as(nullable AAnnotations) - return - end - end - - redef fun n_hex_bytenum=(node) - do - _n_hex_bytenum = node - node.parent = self - end - redef fun n_annotations=(node) - do - _n_annotations = node - if node != null then node.parent = self - end - - - redef fun visit_all(v: Visitor) - do - v.enter_visit(_n_hex_bytenum) - v.enter_visit(_n_annotations) - end -end -redef class ABinByteExpr - init init_abinbyteexpr ( - n_bin_bytenum: nullable TBinBytenum, - n_annotations: nullable AAnnotations - ) - do - _n_bin_bytenum = n_bin_bytenum.as(not null) - n_bin_bytenum.parent = self - _n_annotations = n_annotations - if n_annotations != null then n_annotations.parent = self - end - - redef fun replace_child(old_child: ANode, new_child: nullable ANode) - do - if _n_bin_bytenum == old_child then - n_bin_bytenum = new_child.as(TBinBytenum) - return - end - if _n_annotations == old_child then - n_annotations = new_child.as(nullable AAnnotations) - return - end - end - - redef fun n_bin_bytenum=(node) - do - _n_bin_bytenum = node - node.parent = self - end - redef fun n_annotations=(node) - do - _n_annotations = node - if node != null then node.parent = self - end - - - redef fun visit_all(v: Visitor) - do - v.enter_visit(_n_bin_bytenum) - v.enter_visit(_n_annotations) - end -end -redef class AOctByteExpr - init init_aoctbyteexpr ( - n_oct_bytenum: nullable TOctBytenum, - n_annotations: nullable AAnnotations - ) - do - _n_oct_bytenum = n_oct_bytenum.as(not null) - n_oct_bytenum.parent = self - _n_annotations = n_annotations - if n_annotations != null then n_annotations.parent = self - end - - redef fun replace_child(old_child: ANode, new_child: nullable ANode) - do - if _n_oct_bytenum == old_child then - n_oct_bytenum = new_child.as(TOctBytenum) - return - end - if _n_annotations == old_child then - n_annotations = new_child.as(nullable AAnnotations) - return - end - end - - redef fun n_oct_bytenum=(node) - do - _n_oct_bytenum = node - node.parent = self - end - redef fun n_annotations=(node) - do - _n_annotations = node - if node != null then node.parent = self - end - - - redef fun visit_all(v: Visitor) - do - v.enter_visit(_n_oct_bytenum) - v.enter_visit(_n_annotations) - end -end -redef class AFloatExpr - init init_afloatexpr ( - n_float: nullable TFloat, - n_annotations: nullable AAnnotations - ) - do - _n_float = n_float.as(not null) - n_float.parent = self - _n_annotations = n_annotations - if n_annotations != null then n_annotations.parent = self - end - - redef fun replace_child(old_child: ANode, new_child: nullable ANode) - do - if _n_float == old_child then - n_float = new_child.as(TFloat) - return - end - if _n_annotations == old_child then - n_annotations = new_child.as(nullable AAnnotations) - return - end - end - - redef fun n_float=(node) - do - _n_float = node - node.parent = self - end - redef fun n_annotations=(node) - do - _n_annotations = node - if node != null then node.parent = self - end - - - redef fun visit_all(v: Visitor) - do - v.enter_visit(_n_float) - v.enter_visit(_n_annotations) - end -end -redef class ACharExpr - init init_acharexpr ( - n_char: nullable TChar, - n_annotations: nullable AAnnotations - ) - do - _n_char = n_char.as(not null) - n_char.parent = self - _n_annotations = n_annotations - if n_annotations != null then n_annotations.parent = self - end - - redef fun replace_child(old_child: ANode, new_child: nullable ANode) - do - if _n_char == old_child then - n_char = new_child.as(TChar) - return - end - if _n_annotations == old_child then - n_annotations = new_child.as(nullable AAnnotations) - return - end - end - - redef fun n_char=(node) - do - _n_char = node - node.parent = self - end - redef fun n_annotations=(node) - do - _n_annotations = node - if node != null then node.parent = self - end - - - redef fun visit_all(v: Visitor) - do - v.enter_visit(_n_char) + v.enter_visit(_n_char) v.enter_visit(_n_annotations) end end @@ -7397,6 +7271,48 @@ redef class ANamedargExpr v.enter_visit(_n_expr) end end +redef class ASafeExpr + init init_asafeexpr ( + n_expr: nullable AExpr, + n_quest: nullable TQuest + ) + do + _n_expr = n_expr.as(not null) + n_expr.parent = self + _n_quest = n_quest.as(not null) + n_quest.parent = self + end + + redef fun replace_child(old_child: ANode, new_child: nullable ANode) + do + if _n_expr == old_child then + n_expr = new_child.as(AExpr) + return + end + if _n_quest == old_child then + n_quest = new_child.as(TQuest) + return + end + end + + redef fun n_expr=(node) + do + _n_expr = node + node.parent = self + end + redef fun n_quest=(node) + do + _n_quest = node + node.parent = self + end + + + redef fun visit_all(v: Visitor) + do + v.enter_visit(_n_expr) + v.enter_visit(_n_quest) + end +end redef class ATypeExpr init init_atypeexpr ( n_type: nullable AType @@ -7948,6 +7864,52 @@ redef class AGgAssignOp v.enter_visit(_n_op) end end +redef class AForGroup + init init_aforgroup ( + n_ids: Collection[Object], # Should be Collection[TId] + n_kwin: nullable TKwin, + n_expr: nullable AExpr + ) + do + self.n_ids.unsafe_add_all(n_ids) + _n_kwin = n_kwin.as(not null) + n_kwin.parent = self + _n_expr = n_expr.as(not null) + n_expr.parent = self + end + + redef fun replace_child(old_child: ANode, new_child: nullable ANode) + do + if n_ids.replace_child(old_child, new_child) then return + if _n_kwin == old_child then + n_kwin = new_child.as(TKwin) + return + end + if _n_expr == old_child then + n_expr = new_child.as(AExpr) + return + end + end + + redef fun n_kwin=(node) + do + _n_kwin = node + node.parent = self + end + redef fun n_expr=(node) + do + _n_expr = node + node.parent = self + end + + + redef fun visit_all(v: Visitor) + do + n_ids.visit_all(v) + v.enter_visit(_n_kwin) + v.enter_visit(_n_expr) + end +end redef class AModuleName init init_amodulename ( n_quad: nullable TQuad,