X-Git-Url: http://nitlanguage.org diff --git a/src/parser/parser_abs.nit b/src/parser/parser_abs.nit index 5749955..977ddd2 100644 --- a/src/parser/parser_abs.nit +++ b/src/parser/parser_abs.nit @@ -15,348 +15,354 @@ end # Ancestor of all tokens abstract class Token -special ANode + super ANode end # Ancestor of all productions abstract class Prod -special ANode + super ANode fun location=(loc: Location) do _location = loc end class TEol -special Token + super Token end class TComment -special Token + super Token end -class TKwpackage -special Token +class TKwmodule + super Token end class TKwimport -special Token + super Token end class TKwclass -special Token + super Token end class TKwabstract -special Token + super Token end class TKwinterface -special Token + super Token end -class TKwuniversal -special Token +class TKwenum + super Token end class TKwspecial -special Token + super Token end class TKwend -special Token + super Token end class TKwmeth -special Token + super Token end class TKwtype -special Token + super Token end class TKwinit -special Token + super Token end class TKwredef -special Token + super Token end class TKwis -special Token + super Token end class TKwdo -special Token + super Token end class TKwreadable -special Token + super Token end class TKwwritable -special Token + super Token end class TKwvar -special Token + super Token end class TKwintern -special Token + super Token end class TKwextern -special Token + super Token end class TKwprotected -special Token + super Token end class TKwprivate -special Token + super Token end class TKwintrude -special Token + super Token end class TKwif -special Token + super Token end class TKwthen -special Token + super Token end class TKwelse -special Token + super Token end class TKwwhile -special Token + super Token end class TKwloop -special Token + super Token end class TKwfor -special Token + super Token end class TKwin -special Token + super Token end class TKwand -special Token + super Token end class TKwor -special Token + super Token end class TKwnot -special Token + super Token end class TKwreturn -special Token + super Token end class TKwcontinue -special Token + super Token end class TKwbreak -special Token + super Token end class TKwabort -special Token + super Token end class TKwassert -special Token + super Token end class TKwnew -special Token + super Token end class TKwisa -special Token + super Token end class TKwonce -special Token + super Token end class TKwsuper -special Token + super Token end class TKwself -special Token + super Token end class TKwtrue -special Token + super Token end class TKwfalse -special Token + super Token end class TKwnull -special Token + super Token end class TKwas -special Token + super Token end class TKwnullable -special Token + super Token end class TKwisset -special Token + super Token end class TKwlabel -special Token + super Token end class TOpar -special Token + super Token end class TCpar -special Token + super Token end class TObra -special Token + super Token end class TCbra -special Token + super Token end class TComma -special Token + super Token end class TColumn -special Token + super Token end class TQuad -special Token + super Token end class TAssign -special Token + super Token end class TPluseq -special Token + super Token end class TMinuseq -special Token + super Token end class TDotdotdot -special Token + super Token end class TDotdot -special Token + super Token end class TDot -special Token + super Token end class TPlus -special Token + super Token end class TMinus -special Token + super Token end class TStar -special Token + super Token end class TSlash -special Token + super Token end class TPercent -special Token + super Token end class TEq -special Token + super Token end class TNe -special Token + super Token end class TLt -special Token + super Token end class TLe -special Token + super Token +end +class TLl + super Token end class TGt -special Token + super Token end class TGe -special Token + super Token +end +class TGg + super Token end class TStarship -special Token + super Token end class TBang -special Token + super Token end class TClassid -special Token + super Token end class TId -special Token + super Token end class TAttrid -special Token + super Token end class TNumber -special Token + super Token end class TFloat -special Token + super Token end class TChar -special Token + super Token end class TString -special Token + super Token end class TStartString -special Token + super Token end class TMidString -special Token + super Token end class TEndString -special Token + super Token end class EOF -special Token + super Token private init noinit do end end class AError -special EOF + super EOF private init noinit do end end -class AModule special Prod end -class APackagedecl special Prod end -class AImport special Prod end -class AVisibility special Prod end -class AClassdef special Prod end -class AClasskind special Prod end -class AFormaldef special Prod end -class ASuperclass special Prod end -class APropdef special Prod end -class AAble special Prod end -class AMethid special Prod end -class ASignature special Prod end -class AParam special Prod end -class AClosureDecl special Prod end -class AType special Prod end -class ALabel special Prod end -class AExpr special Prod end -class AAssignOp special Prod end -class AClosureDef special Prod end -class AClosureId special Prod end -class AQualified special Prod end -class ADoc special Prod end +class AModule super Prod end +class AModuledecl super Prod end +class AImport super Prod end +class AVisibility super Prod end +class AClassdef super Prod end +class AClasskind super Prod end +class AFormaldef super Prod end +class ASuperclass super Prod end +class APropdef super Prod end +class AAble super Prod end +class AMethid super Prod end +class ASignature super Prod end +class AParam super Prod end +class AClosureDecl super Prod end +class AType super Prod end +class ALabel super Prod end +class AExpr super Prod end +class AAssignOp super Prod end +class AClosureDef super Prod end +class AClosureId super Prod end +class AQualified super Prod end +class ADoc super Prod end class AModule -special AModule - readable var _n_packagedecl: nullable APackagedecl = null + super AModule + readable var _n_moduledecl: nullable AModuledecl = null readable var _n_imports: List[AImport] = new List[AImport] readable var _n_classdefs: List[AClassdef] = new List[AClassdef] end -class APackagedecl -special APackagedecl +class AModuledecl + super AModuledecl readable var _n_doc: nullable ADoc = null - readable var _n_kwpackage: TKwpackage + readable var _n_kwmodule: TKwmodule readable var _n_id: TId end class AStdImport -special AImport + super AImport readable var _n_visibility: AVisibility readable var _n_kwimport: TKwimport readable var _n_id: TId end class ANoImport -special AImport + super AImport readable var _n_visibility: AVisibility readable var _n_kwimport: TKwimport readable var _n_kwend: TKwend end class APublicVisibility -special AVisibility + super AVisibility end class APrivateVisibility -special AVisibility + super AVisibility readable var _n_kwprivate: TKwprivate end class AProtectedVisibility -special AVisibility + super AVisibility readable var _n_kwprotected: TKwprotected end class AIntrudeVisibility -special AVisibility + super AVisibility readable var _n_kwintrude: TKwintrude end class AStdClassdef -special AClassdef + super AClassdef readable var _n_doc: nullable ADoc = null readable var _n_kwredef: nullable TKwredef = null readable var _n_visibility: AVisibility @@ -367,55 +373,56 @@ special AClassdef readable var _n_propdefs: List[APropdef] = new List[APropdef] end class ATopClassdef -special AClassdef + super AClassdef readable var _n_propdefs: List[APropdef] = new List[APropdef] end class AMainClassdef -special AClassdef + super AClassdef readable var _n_propdefs: List[APropdef] = new List[APropdef] end class AConcreteClasskind -special AClasskind + super AClasskind readable var _n_kwclass: TKwclass end class AAbstractClasskind -special AClasskind + super AClasskind readable var _n_kwabstract: TKwabstract readable var _n_kwclass: TKwclass end class AInterfaceClasskind -special AClasskind + super AClasskind readable var _n_kwinterface: TKwinterface end -class AUniversalClasskind -special AClasskind - readable var _n_kwuniversal: TKwuniversal +class AEnumClasskind + super AClasskind + readable var _n_kwenum: TKwenum end class AFormaldef -special AFormaldef + super AFormaldef readable var _n_id: TClassid readable var _n_type: nullable AType = null end class ASuperclass -special ASuperclass + super ASuperclass readable var _n_kwspecial: nullable TKwspecial = null readable var _n_kwsuper: nullable TKwsuper = null readable var _n_type: AType end class AAttrPropdef -special APropdef + super APropdef readable var _n_doc: nullable ADoc = null readable var _n_readable: nullable AAble = null readable var _n_writable: nullable AAble = null readable var _n_kwredef: nullable TKwredef = null readable var _n_visibility: AVisibility readable var _n_kwvar: TKwvar - readable var _n_id: TAttrid + readable var _n_id: nullable TAttrid = null + readable var _n_id2: nullable TId = null readable var _n_type: nullable AType = null readable var _n_expr: nullable AExpr = null end class AMethPropdef -special APropdef + super APropdef readable var _n_doc: nullable ADoc = null readable var _n_kwredef: nullable TKwredef = null readable var _n_visibility: AVisibility @@ -423,7 +430,7 @@ special APropdef readable var _n_signature: ASignature end class ADeferredMethPropdef -special APropdef + super APropdef readable var _n_doc: nullable ADoc = null readable var _n_kwredef: nullable TKwredef = null readable var _n_visibility: AVisibility @@ -432,7 +439,7 @@ special APropdef readable var _n_signature: ASignature end class AInternMethPropdef -special APropdef + super APropdef readable var _n_doc: nullable ADoc = null readable var _n_kwredef: nullable TKwredef = null readable var _n_visibility: AVisibility @@ -441,7 +448,7 @@ special APropdef readable var _n_signature: ASignature end class AExternMethPropdef -special APropdef + super APropdef readable var _n_doc: nullable ADoc = null readable var _n_kwredef: nullable TKwredef = null readable var _n_visibility: AVisibility @@ -451,7 +458,7 @@ special APropdef readable var _n_extern: nullable TString = null end class AConcreteMethPropdef -special APropdef + super APropdef readable var _n_doc: nullable ADoc = null readable var _n_kwredef: nullable TKwredef = null readable var _n_visibility: AVisibility @@ -461,7 +468,7 @@ special APropdef readable var _n_block: nullable AExpr = null end class AConcreteInitPropdef -special APropdef + super APropdef readable var _n_doc: nullable ADoc = null readable var _n_kwredef: nullable TKwredef = null readable var _n_visibility: AVisibility @@ -471,12 +478,12 @@ special APropdef readable var _n_block: nullable AExpr = null end class AMainMethPropdef -special APropdef + super APropdef readable var _n_kwredef: nullable TKwredef = null readable var _n_block: nullable AExpr = null end class ATypePropdef -special APropdef + super APropdef readable var _n_doc: nullable ADoc = null readable var _n_kwredef: nullable TKwredef = null readable var _n_visibility: AVisibility @@ -485,97 +492,106 @@ special APropdef readable var _n_type: AType end class AReadAble -special AAble + super AAble readable var _n_kwredef: nullable TKwredef = null readable var _n_kwreadable: TKwreadable end class AWriteAble -special AAble + super AAble readable var _n_kwredef: nullable TKwredef = null + readable var _n_visibility: nullable AVisibility = null readable var _n_kwwritable: TKwwritable end class AIdMethid -special AMethid + super AMethid readable var _n_id: TId end class APlusMethid -special AMethid + super AMethid readable var _n_plus: TPlus end class AMinusMethid -special AMethid + super AMethid readable var _n_minus: TMinus end class AStarMethid -special AMethid + super AMethid readable var _n_star: TStar end class ASlashMethid -special AMethid + super AMethid readable var _n_slash: TSlash end class APercentMethid -special AMethid + super AMethid readable var _n_percent: TPercent end class AEqMethid -special AMethid + super AMethid readable var _n_eq: TEq end class ANeMethid -special AMethid + super AMethid readable var _n_ne: TNe end class ALeMethid -special AMethid + super AMethid readable var _n_le: TLe end class AGeMethid -special AMethid + super AMethid readable var _n_ge: TGe end class ALtMethid -special AMethid + super AMethid readable var _n_lt: TLt end class AGtMethid -special AMethid + super AMethid readable var _n_gt: TGt end +class ALlMethid + super AMethid + readable var _n_ll: TLl +end +class AGgMethid + super AMethid + readable var _n_gg: TGg +end class ABraMethid -special AMethid + super AMethid readable var _n_obra: TObra readable var _n_cbra: TCbra end class AStarshipMethid -special AMethid + super AMethid readable var _n_starship: TStarship end class AAssignMethid -special AMethid + super AMethid readable var _n_id: TId readable var _n_assign: TAssign end class ABraassignMethid -special AMethid + super AMethid readable var _n_obra: TObra readable var _n_cbra: TCbra readable var _n_assign: TAssign end class ASignature -special ASignature + super ASignature readable var _n_params: List[AParam] = new List[AParam] readable var _n_type: nullable AType = null readable var _n_closure_decls: List[AClosureDecl] = new List[AClosureDecl] end class AParam -special AParam + super AParam readable var _n_id: TId readable var _n_type: nullable AType = null readable var _n_dotdotdot: nullable TDotdotdot = null end class AClosureDecl -special AClosureDecl + super AClosureDecl readable var _n_kwbreak: nullable TKwbreak = null readable var _n_bang: TBang readable var _n_id: TId @@ -583,22 +599,22 @@ special AClosureDecl readable var _n_expr: nullable AExpr = null end class AType -special AType + super AType readable var _n_kwnullable: nullable TKwnullable = null readable var _n_id: TClassid readable var _n_types: List[AType] = new List[AType] end class ALabel -special ALabel + super ALabel readable var _n_kwlabel: TKwlabel readable var _n_id: TId end class ABlockExpr -special AExpr + super AExpr readable var _n_expr: List[AExpr] = new List[AExpr] end class AVardeclExpr -special AExpr + super AExpr readable var _n_kwvar: TKwvar readable var _n_id: TId readable var _n_type: nullable AType = null @@ -606,41 +622,41 @@ special AExpr readable var _n_expr: nullable AExpr = null end class AReturnExpr -special AExpr + super AExpr readable var _n_kwreturn: nullable TKwreturn = null readable var _n_expr: nullable AExpr = null end class ABreakExpr -special AExpr + super AExpr readable var _n_kwbreak: TKwbreak readable var _n_label: nullable ALabel = null readable var _n_expr: nullable AExpr = null end class AAbortExpr -special AExpr + super AExpr readable var _n_kwabort: TKwabort end class AContinueExpr -special AExpr + super AExpr readable var _n_kwcontinue: nullable TKwcontinue = null readable var _n_label: nullable ALabel = null readable var _n_expr: nullable AExpr = null end class ADoExpr -special AExpr + super AExpr readable var _n_kwdo: TKwdo readable var _n_block: nullable AExpr = null readable var _n_label: nullable ALabel = null end class AIfExpr -special AExpr + super AExpr readable var _n_kwif: TKwif readable var _n_expr: AExpr readable var _n_then: nullable AExpr = null readable var _n_else: nullable AExpr = null end class AIfexprExpr -special AExpr + super AExpr readable var _n_kwif: TKwif readable var _n_expr: AExpr readable var _n_kwthen: TKwthen @@ -649,7 +665,7 @@ special AExpr readable var _n_else: AExpr end class AWhileExpr -special AExpr + super AExpr readable var _n_kwwhile: TKwwhile readable var _n_expr: AExpr readable var _n_kwdo: TKwdo @@ -657,13 +673,13 @@ special AExpr readable var _n_label: nullable ALabel = null end class ALoopExpr -special AExpr + super AExpr readable var _n_kwloop: TKwloop readable var _n_block: nullable AExpr = null readable var _n_label: nullable ALabel = null end class AForExpr -special AExpr + super AExpr readable var _n_kwfor: TKwfor readable var _n_id: TId readable var _n_expr: AExpr @@ -672,151 +688,166 @@ special AExpr readable var _n_label: nullable ALabel = null end class AAssertExpr -special AExpr + super AExpr readable var _n_kwassert: TKwassert readable var _n_id: nullable TId = null readable var _n_expr: AExpr readable var _n_else: nullable AExpr = null end class AOnceExpr -special AExpr + super AExpr readable var _n_kwonce: TKwonce readable var _n_expr: AExpr end class ASendExpr -special AExpr + super AExpr readable var _n_expr: AExpr end class ABinopExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class AOrExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class AAndExpr -special AExpr + super AExpr + readable var _n_expr: AExpr + readable var _n_expr2: AExpr +end +class AOrElseExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class ANotExpr -special AExpr + super AExpr readable var _n_kwnot: TKwnot readable var _n_expr: AExpr end class AEqExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class AEeExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class ANeExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class ALtExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class ALeExpr -special AExpr + super AExpr + readable var _n_expr: AExpr + readable var _n_expr2: AExpr +end +class ALlExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class AGtExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class AGeExpr -special AExpr + super AExpr + readable var _n_expr: AExpr + readable var _n_expr2: AExpr +end +class AGgExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class AIsaExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_type: AType end class APlusExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class AMinusExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class AStarshipExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class AStarExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class ASlashExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class APercentExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class AUminusExpr -special AExpr + super AExpr readable var _n_minus: TMinus readable var _n_expr: AExpr end class ANewExpr -special AExpr + super AExpr readable var _n_kwnew: TKwnew readable var _n_type: AType readable var _n_id: nullable TId = null readable var _n_args: List[AExpr] = new List[AExpr] end class AAttrExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_id: TAttrid end class AAttrAssignExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_id: TAttrid readable var _n_assign: TAssign readable var _n_value: AExpr end class AAttrReassignExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_id: TAttrid readable var _n_assign_op: AAssignOp readable var _n_value: AExpr end class ACallExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_id: TId readable var _n_args: List[AExpr] = new List[AExpr] readable var _n_closure_defs: List[AClosureDef] = new List[AClosureDef] end class ACallAssignExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_id: TId readable var _n_args: List[AExpr] = new List[AExpr] @@ -824,7 +855,7 @@ special AExpr readable var _n_value: AExpr end class ACallReassignExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_id: TId readable var _n_args: List[AExpr] = new List[AExpr] @@ -832,162 +863,162 @@ special AExpr readable var _n_value: AExpr end class ASuperExpr -special AExpr + super AExpr readable var _n_qualified: nullable AQualified = null readable var _n_kwsuper: TKwsuper readable var _n_args: List[AExpr] = new List[AExpr] end class AInitExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_kwinit: TKwinit readable var _n_args: List[AExpr] = new List[AExpr] end class ABraExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_args: List[AExpr] = new List[AExpr] readable var _n_closure_defs: List[AClosureDef] = new List[AClosureDef] end class ABraAssignExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_args: List[AExpr] = new List[AExpr] readable var _n_assign: TAssign readable var _n_value: AExpr end class ABraReassignExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_args: List[AExpr] = new List[AExpr] readable var _n_assign_op: AAssignOp readable var _n_value: AExpr end class AClosureCallExpr -special AExpr + super AExpr readable var _n_id: TId readable var _n_args: List[AExpr] = new List[AExpr] readable var _n_closure_defs: List[AClosureDef] = new List[AClosureDef] end class AVarExpr -special AExpr + super AExpr readable var _n_id: TId end class AVarAssignExpr -special AExpr + super AExpr readable var _n_id: TId readable var _n_assign: TAssign readable var _n_value: AExpr end class AVarReassignExpr -special AExpr + super AExpr readable var _n_id: TId readable var _n_assign_op: AAssignOp readable var _n_value: AExpr end class ARangeExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class ACrangeExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class AOrangeExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end class AArrayExpr -special AExpr + super AExpr readable var _n_exprs: List[AExpr] = new List[AExpr] end class ASelfExpr -special AExpr + super AExpr readable var _n_kwself: TKwself end class AImplicitSelfExpr -special AExpr + super AExpr end class ATrueExpr -special AExpr + super AExpr readable var _n_kwtrue: TKwtrue end class AFalseExpr -special AExpr + super AExpr readable var _n_kwfalse: TKwfalse end class ANullExpr -special AExpr + super AExpr readable var _n_kwnull: TKwnull end class AIntExpr -special AExpr + super AExpr readable var _n_number: TNumber end class AFloatExpr -special AExpr + super AExpr readable var _n_float: TFloat end class ACharExpr -special AExpr + super AExpr readable var _n_char: TChar end class AStringExpr -special AExpr + super AExpr readable var _n_string: TString end class AStartStringExpr -special AExpr + super AExpr readable var _n_string: TStartString end class AMidStringExpr -special AExpr + super AExpr readable var _n_string: TMidString end class AEndStringExpr -special AExpr + super AExpr readable var _n_string: TEndString end class ASuperstringExpr -special AExpr + super AExpr readable var _n_exprs: List[AExpr] = new List[AExpr] end class AParExpr -special AExpr + super AExpr readable var _n_expr: AExpr end class AAsCastExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_kwas: TKwas readable var _n_type: AType end class AAsNotnullExpr -special AExpr + super AExpr readable var _n_expr: AExpr readable var _n_kwas: TKwas readable var _n_kwnot: TKwnot readable var _n_kwnull: TKwnull end class AIssetAttrExpr -special AExpr + super AExpr readable var _n_kwisset: TKwisset readable var _n_expr: AExpr readable var _n_id: TAttrid end class APlusAssignOp -special AAssignOp + super AAssignOp readable var _n_pluseq: TPluseq end class AMinusAssignOp -special AAssignOp + super AAssignOp readable var _n_minuseq: TMinuseq end class AClosureDef -special AClosureDef + super AClosureDef readable var _n_bang: TBang readable var _n_id: AClosureId readable var _n_ids: List[TId] = new List[TId] @@ -996,25 +1027,25 @@ special AClosureDef readable var _n_label: nullable ALabel = null end class ASimpleClosureId -special AClosureId + super AClosureId readable var _n_id: TId end class ABreakClosureId -special AClosureId + super AClosureId readable var _n_kwbreak: TKwbreak end class AQualified -special AQualified + super AQualified readable var _n_id: List[TId] = new List[TId] readable var _n_classid: nullable TClassid = null end class ADoc -special ADoc + super ADoc readable var _n_comment: List[TComment] = new List[TComment] end class Start -special Prod + super Prod readable var _n_base: nullable AModule readable var _n_eof: EOF end