X-Git-Url: http://nitlanguage.org diff --git a/src/parser/parser_prod.nit b/src/parser/parser_prod.nit index 384769c..0c9f9d7 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 +module parser_prod is no_warning("missing-doc") import lexer intrude import parser_nodes @@ -388,9 +388,7 @@ redef class AStdClassdef n_classkind: nullable AClasskind, n_id: nullable TClassid, n_formaldefs: Collection[Object], # Should be Collection[AFormaldef] - n_annotations: nullable AAnnotations, n_extern_code_block: nullable AExternCodeBlock, - n_superclasses: Collection[Object], # Should be Collection[ASuperclass] n_propdefs: Collection[Object], # Should be Collection[APropdef] n_kwend: nullable TKwend ) @@ -406,11 +404,8 @@ redef class AStdClassdef _n_id = n_id if n_id != null then n_id.parent = self self.n_formaldefs.unsafe_add_all(n_formaldefs) - _n_annotations = n_annotations - if n_annotations != null then n_annotations.parent = self _n_extern_code_block = n_extern_code_block if n_extern_code_block != null then n_extern_code_block.parent = self - self.n_superclasses.unsafe_add_all(n_superclasses) self.n_propdefs.unsafe_add_all(n_propdefs) _n_kwend = n_kwend.as(not null) n_kwend.parent = self @@ -439,15 +434,10 @@ redef class AStdClassdef return end if n_formaldefs.replace_child(old_child, new_child) then return - if _n_annotations == old_child then - n_annotations = new_child.as(nullable AAnnotations) - return - end if _n_extern_code_block == old_child then n_extern_code_block = new_child.as(nullable AExternCodeBlock) return end - if n_superclasses.replace_child(old_child, new_child) then return if n_propdefs.replace_child(old_child, new_child) then return if _n_kwend == old_child then n_kwend = new_child.as(TKwend) @@ -480,11 +470,6 @@ redef class AStdClassdef _n_id = node if node != null then node.parent = self end - redef fun n_annotations=(node) - do - _n_annotations = node - if node != null then node.parent = self - end redef fun n_extern_code_block=(node) do _n_extern_code_block = node @@ -505,9 +490,7 @@ redef class AStdClassdef v.enter_visit(_n_classkind) v.enter_visit(_n_id) n_formaldefs.visit_all(v) - v.enter_visit(_n_annotations) v.enter_visit(_n_extern_code_block) - n_superclasses.visit_all(v) n_propdefs.visit_all(v) v.enter_visit(_n_kwend) end @@ -778,61 +761,6 @@ redef class AFormaldef v.enter_visit(_n_annotations) end end -redef class ASuperclass - init init_asuperclass ( - n_kwsuper: nullable TKwsuper, - n_type: nullable AType, - n_annotations: nullable AAnnotations - ) - do - _n_kwsuper = n_kwsuper.as(not null) - n_kwsuper.parent = self - _n_type = n_type.as(not null) - n_type.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_kwsuper == old_child then - n_kwsuper = new_child.as(TKwsuper) - return - end - if _n_type == old_child then - n_type = new_child.as(AType) - return - end - if _n_annotations == old_child then - n_annotations = new_child.as(nullable AAnnotations) - return - end - end - - redef fun n_kwsuper=(node) - do - _n_kwsuper = node - node.parent = self - end - redef fun n_type=(node) - do - _n_type = 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_kwsuper) - v.enter_visit(_n_type) - v.enter_visit(_n_annotations) - end -end redef class AAttrPropdef init init_aattrpropdef ( n_doc: nullable ADoc, @@ -842,7 +770,8 @@ redef class AAttrPropdef n_id2: nullable TId, n_type: nullable AType, n_expr: nullable AExpr, - n_annotations: nullable AAnnotations + n_annotations: nullable AAnnotations, + n_block: nullable AExpr ) do _n_doc = n_doc @@ -861,6 +790,8 @@ redef class AAttrPropdef if n_expr != null then n_expr.parent = self _n_annotations = n_annotations if n_annotations != null then n_annotations.parent = self + _n_block = n_block + if n_block != null then n_block.parent = self end redef fun replace_child(old_child: ANode, new_child: nullable ANode) @@ -897,6 +828,10 @@ redef class AAttrPropdef n_annotations = new_child.as(nullable AAnnotations) return end + if _n_block == old_child then + n_block = new_child.as(nullable AExpr) + return + end end redef fun n_doc=(node) @@ -939,6 +874,11 @@ redef class AAttrPropdef _n_annotations = node if node != null then node.parent = self end + redef fun n_block=(node) + do + _n_block = node + if node != null then node.parent = self + end redef fun visit_all(v: Visitor) @@ -951,6 +891,7 @@ redef class AAttrPropdef v.enter_visit(_n_type) v.enter_visit(_n_expr) v.enter_visit(_n_annotations) + v.enter_visit(_n_block) end end redef class AMainMethPropdef @@ -1274,6 +1215,211 @@ redef class AMethPropdef v.enter_visit(_n_block) end end +redef class ASuperPropdef + init init_asuperpropdef ( + n_doc: nullable ADoc, + n_kwredef: nullable TKwredef, + n_visibility: nullable AVisibility, + n_kwsuper: nullable TKwsuper, + n_type: nullable AType, + n_annotations: nullable AAnnotations + ) + do + _n_doc = n_doc + if n_doc != null then n_doc.parent = self + _n_kwredef = n_kwredef + if n_kwredef != null then n_kwredef.parent = self + _n_visibility = n_visibility.as(not null) + n_visibility.parent = self + _n_kwsuper = n_kwsuper.as(not null) + n_kwsuper.parent = self + _n_type = n_type.as(not null) + n_type.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_doc == old_child then + n_doc = new_child.as(nullable ADoc) + return + end + if _n_kwredef == old_child then + n_kwredef = new_child.as(nullable TKwredef) + return + end + if _n_visibility == old_child then + n_visibility = new_child.as(AVisibility) + return + end + if _n_kwsuper == old_child then + n_kwsuper = new_child.as(TKwsuper) + return + end + if _n_type == old_child then + n_type = new_child.as(AType) + return + end + if _n_annotations == old_child then + n_annotations = new_child.as(nullable AAnnotations) + return + end + end + + redef fun n_doc=(node) + do + _n_doc = node + if node != null then node.parent = self + end + redef fun n_kwredef=(node) + do + _n_kwredef = node + if node != null then node.parent = self + end + redef fun n_visibility=(node) + do + _n_visibility = node + node.parent = self + end + redef fun n_kwsuper=(node) + do + _n_kwsuper = node + node.parent = self + end + redef fun n_type=(node) + do + _n_type = 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_doc) + v.enter_visit(_n_kwredef) + v.enter_visit(_n_visibility) + v.enter_visit(_n_kwsuper) + v.enter_visit(_n_type) + v.enter_visit(_n_annotations) + end +end +redef class AAnnotPropdef + init init_aannotpropdef ( + n_doc: nullable ADoc, + n_kwredef: nullable TKwredef, + n_visibility: nullable AVisibility, + n_atid: nullable AAtid, + n_opar: nullable TOpar, + n_args: Collection[Object], # Should be Collection[AExpr] + n_cpar: nullable TCpar, + n_annotations: nullable AAnnotations + ) + do + _n_doc = n_doc + if n_doc != null then n_doc.parent = self + _n_kwredef = n_kwredef + if n_kwredef != null then n_kwredef.parent = self + _n_visibility = n_visibility + if n_visibility != null then n_visibility.parent = self + _n_atid = n_atid.as(not null) + n_atid.parent = self + _n_opar = n_opar + if n_opar != null then n_opar.parent = self + self.n_args.unsafe_add_all(n_args) + _n_cpar = n_cpar + if n_cpar != null then n_cpar.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_doc == old_child then + n_doc = new_child.as(nullable ADoc) + return + end + if _n_kwredef == old_child then + n_kwredef = new_child.as(nullable TKwredef) + return + end + if _n_visibility == old_child then + n_visibility = new_child.as(nullable AVisibility) + return + end + if _n_atid == old_child then + n_atid = new_child.as(AAtid) + return + end + if _n_opar == old_child then + n_opar = new_child.as(nullable TOpar) + return + end + if n_args.replace_child(old_child, new_child) then return + if _n_cpar == old_child then + n_cpar = new_child.as(nullable TCpar) + return + end + if _n_annotations == old_child then + n_annotations = new_child.as(nullable AAnnotations) + return + end + end + + redef fun n_doc=(node) + do + _n_doc = node + if node != null then node.parent = self + end + redef fun n_kwredef=(node) + do + _n_kwredef = node + if node != null then node.parent = self + end + redef fun n_visibility=(node) + do + _n_visibility = node + if node != null then node.parent = self + end + redef fun n_atid=(node) + do + _n_atid = node + node.parent = self + end + redef fun n_opar=(node) + do + _n_opar = node + if node != null then node.parent = self + end + redef fun n_cpar=(node) + do + _n_cpar = node + if node != null then 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_doc) + v.enter_visit(_n_kwredef) + v.enter_visit(_n_visibility) + v.enter_visit(_n_atid) + v.enter_visit(_n_opar) + n_args.visit_all(v) + v.enter_visit(_n_cpar) + v.enter_visit(_n_annotations) + end +end redef class AIdMethid init init_aidmethid ( n_id: nullable TId @@ -5039,20 +5185,37 @@ redef class AOrangeExpr end redef class AArrayExpr init init_aarrayexpr ( - n_exprs: nullable AExprs, + n_obra: nullable TObra, + n_exprs: Collection[Object], # Should be Collection[AExpr] + n_type: nullable AType, + n_cbra: nullable TCbra, n_annotations: nullable AAnnotations ) do - _n_exprs = n_exprs.as(not null) - n_exprs.parent = self + _n_obra = n_obra.as(not null) + n_obra.parent = self + self.n_exprs.unsafe_add_all(n_exprs) + _n_type = n_type + if n_type != null then n_type.parent = self + _n_cbra = n_cbra.as(not null) + n_cbra.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_exprs == old_child then - n_exprs = new_child.as(AExprs) + if _n_obra == old_child then + n_obra = new_child.as(TObra) + return + end + if n_exprs.replace_child(old_child, new_child) then return + if _n_type == old_child then + n_type = new_child.as(nullable AType) + return + end + if _n_cbra == old_child then + n_cbra = new_child.as(TCbra) return end if _n_annotations == old_child then @@ -5061,9 +5224,19 @@ redef class AArrayExpr end end - redef fun n_exprs=(node) + redef fun n_obra=(node) + do + _n_obra = node + node.parent = self + end + redef fun n_type=(node) + do + _n_type = node + if node != null then node.parent = self + end + redef fun n_cbra=(node) do - _n_exprs = node + _n_cbra = node node.parent = self end redef fun n_annotations=(node) @@ -5075,7 +5248,10 @@ redef class AArrayExpr redef fun visit_all(v: Visitor) do - v.enter_visit(_n_exprs) + v.enter_visit(_n_obra) + n_exprs.visit_all(v) + v.enter_visit(_n_type) + v.enter_visit(_n_cbra) v.enter_visit(_n_annotations) end end @@ -6000,6 +6176,126 @@ redef class AVarargExpr v.enter_visit(_n_dotdotdot) end end +redef class ATypeExpr + init init_atypeexpr ( + n_type: nullable AType + ) + do + _n_type = n_type.as(not null) + n_type.parent = self + end + + redef fun replace_child(old_child: ANode, new_child: nullable ANode) + do + if _n_type == old_child then + n_type = new_child.as(AType) + return + end + end + + redef fun n_type=(node) + do + _n_type = node + node.parent = self + end + + + redef fun visit_all(v: Visitor) + do + v.enter_visit(_n_type) + end +end +redef class AMethidExpr + init init_amethidexpr ( + n_expr: nullable AExpr, + n_id: nullable AMethid + ) + do + _n_expr = n_expr.as(not null) + n_expr.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_expr == old_child then + n_expr = new_child.as(AExpr) + return + end + if _n_id == old_child then + n_id = new_child.as(AMethid) + return + end + end + + redef fun n_expr=(node) + do + _n_expr = node + 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_expr) + v.enter_visit(_n_id) + end +end +redef class AAtExpr + init init_aatexpr ( + n_annotations: nullable AAnnotations + ) + do + _n_annotations = n_annotations.as(not null) + n_annotations.parent = self + end + + redef fun replace_child(old_child: ANode, new_child: nullable ANode) + do + if _n_annotations == old_child then + n_annotations = new_child.as(AAnnotations) + return + end + end + + redef fun n_annotations=(node) + do + _n_annotations = node + node.parent = self + end + + + redef fun visit_all(v: Visitor) + do + v.enter_visit(_n_annotations) + end +end +redef class AManyExpr + init init_amanyexpr ( + n_exprs: Collection[Object] # Should be Collection[AExpr] + ) + do + self.n_exprs.unsafe_add_all(n_exprs) + end + + redef fun replace_child(old_child: ANode, new_child: nullable ANode) + do + if n_exprs.replace_child(old_child, new_child) then return + end + + + + redef fun visit_all(v: Visitor) + do + n_exprs.visit_all(v) + end +end redef class AListExprs init init_alistexprs ( n_exprs: Collection[Object] # Should be Collection[AExpr] @@ -6800,7 +7096,7 @@ redef class AAnnotation n_visibility: nullable AVisibility, n_atid: nullable AAtid, n_opar: nullable TOpar, - n_args: Collection[Object], # Should be Collection[AAtArg] + n_args: Collection[Object], # Should be Collection[AExpr] n_cpar: nullable TCpar, n_annotations: nullable AAnnotations ) @@ -6904,93 +7200,6 @@ redef class AAnnotation v.enter_visit(_n_annotations) end end -redef class ATypeAtArg - init init_atypeatarg ( - n_type: nullable AType - ) - do - _n_type = n_type.as(not null) - n_type.parent = self - end - - redef fun replace_child(old_child: ANode, new_child: nullable ANode) - do - if _n_type == old_child then - n_type = new_child.as(AType) - return - end - end - - redef fun n_type=(node) - do - _n_type = node - node.parent = self - end - - - redef fun visit_all(v: Visitor) - do - v.enter_visit(_n_type) - end -end -redef class AExprAtArg - init init_aexpratarg ( - n_expr: nullable AExpr - ) - do - _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_expr == old_child then - n_expr = new_child.as(AExpr) - return - end - 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_expr) - end -end -redef class AAtAtArg - init init_aatatarg ( - n_annotations: nullable AAnnotations - ) - do - _n_annotations = n_annotations.as(not null) - n_annotations.parent = self - end - - redef fun replace_child(old_child: ANode, new_child: nullable ANode) - do - if _n_annotations == old_child then - n_annotations = new_child.as(AAnnotations) - return - end - end - - redef fun n_annotations=(node) - do - _n_annotations = node - node.parent = self - end - - - redef fun visit_all(v: Visitor) - do - v.enter_visit(_n_annotations) - end -end redef class AIdAtid init init_aidatid ( n_id: nullable TId