X-Git-Url: http://nitlanguage.org diff --git a/src/parser/parser_abs.nit b/src/parser/parser_abs.nit index 26f5641..9d4cf4b 100644 --- a/src/parser/parser_abs.nit +++ b/src/parser/parser_abs.nit @@ -1,34 +1,18 @@ # Raw AST node hierarchy. # This file was generated by SableCC (http://www.sablecc.org/). -package parser_abs +module parser_abs import location -# Root of the AST hierarchy -abstract class ANode - var _location: nullable Location - - # Location is set during AST building. Once built, location cannon be null - # However, manual instanciated nodes may need mode care - fun location: Location do return _location.as(not null) -end - -# Ancestor of all tokens -abstract class Token - super ANode -end - -# Ancestor of all productions -abstract class Prod - super ANode - fun location=(loc: Location) do _location = loc -end class TEol super Token end class TComment super Token end +class TKwpackage + super Token +end class TKwmodule super Token end @@ -47,9 +31,6 @@ end class TKwenum super Token end -class TKwspecial - super Token -end class TKwend super Token end @@ -86,6 +67,9 @@ end class TKwextern super Token end +class TKwpublic + super Token +end class TKwprotected super Token end @@ -125,6 +109,9 @@ end class TKwnot super Token end +class TKwimplies + super Token +end class TKwreturn super Token end @@ -176,6 +163,9 @@ end class TKwlabel super Token end +class TKwdebug + super Token +end class TOpar super Token end @@ -260,6 +250,9 @@ end class TBang super Token end +class TAt + super Token +end class TClassid super Token end @@ -272,10 +265,10 @@ end class TNumber super Token end -class TFloat +class THexNumber super Token end -class TChar +class TFloat super Token end class TString @@ -290,13 +283,29 @@ end class TEndString super Token end +class TChar + super Token +end +class TBadString + super Token +end +class TBadChar + super Token +end +class TExternCodeSegment + super Token +end class EOF super Token -private init noinit do end end class AError super EOF -private init noinit do end +end +class ALexerError + super AError +end +class AParserError + super AError end class AModule super Prod end @@ -312,23 +321,28 @@ 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 AExprs super Prod end class AAssignOp super Prod end -class AClosureDef super Prod end -class AClosureId super Prod end class AModuleName super Prod end class AExternCalls super Prod end class AExternCall super Prod end +class AInLanguage super Prod end +class AExternCodeBlock super Prod end class AQualified super Prod end class ADoc super Prod end +class AAnnotations super Prod end +class AAnnotation super Prod end +class AAtArg super Prod end +class AAtid super Prod end class AModule super AModule readable var _n_moduledecl: nullable AModuledecl = null readable var _n_imports: List[AImport] = new List[AImport] + readable var _n_extern_code_blocks: List[AExternCodeBlock] = new List[AExternCodeBlock] readable var _n_classdefs: List[AClassdef] = new List[AClassdef] end class AModuledecl @@ -336,12 +350,14 @@ class AModuledecl readable var _n_doc: nullable ADoc = null readable var _n_kwmodule: TKwmodule readable var _n_name: AModuleName + readable var _n_annotations: nullable AAnnotations = null end class AStdImport super AImport readable var _n_visibility: AVisibility readable var _n_kwimport: TKwimport readable var _n_name: AModuleName + readable var _n_annotations: nullable AAnnotations = null end class ANoImport super AImport @@ -372,8 +388,11 @@ class AStdClassdef readable var _n_classkind: AClasskind readable var _n_id: nullable TClassid = null readable var _n_formaldefs: List[AFormaldef] = new List[AFormaldef] + readable var _n_annotations: nullable AAnnotations = null + readable var _n_extern_code_block: nullable AExternCodeBlock = null readable var _n_superclasses: List[ASuperclass] = new List[ASuperclass] readable var _n_propdefs: List[APropdef] = new List[APropdef] + readable var _n_kwend: TKwend end class ATopClassdef super AClassdef @@ -403,17 +422,19 @@ end class AExternClasskind super AClasskind readable var _n_kwextern: TKwextern + readable var _n_kwclass: nullable TKwclass = null end class AFormaldef super AFormaldef readable var _n_id: TClassid readable var _n_type: nullable AType = null + readable var _n_annotations: nullable AAnnotations = null end class ASuperclass super ASuperclass - readable var _n_kwspecial: nullable TKwspecial = null - readable var _n_kwsuper: nullable TKwsuper = null + readable var _n_kwsuper: TKwsuper readable var _n_type: AType + readable var _n_annotations: nullable AAnnotations = null end class AAttrPropdef super APropdef @@ -426,6 +447,7 @@ class AAttrPropdef readable var _n_id: nullable TAttrid = null readable var _n_id2: nullable TId = null readable var _n_type: nullable AType = null + readable var _n_annotations: nullable AAnnotations = null readable var _n_expr: nullable AExpr = null end class AMethPropdef @@ -444,6 +466,7 @@ class ADeferredMethPropdef readable var _n_kwmeth: TKwmeth readable var _n_methid: AMethid readable var _n_signature: ASignature + readable var _n_annotations: nullable AAnnotations = null end class AInternMethPropdef super APropdef @@ -464,6 +487,7 @@ class AExternMethPropdef readable var _n_signature: ASignature readable var _n_extern: nullable TString = null readable var _n_extern_calls: nullable AExternCalls = null + readable var _n_extern_code_block: nullable AExternCodeBlock = null end class AConcreteMethPropdef super APropdef @@ -473,6 +497,7 @@ class AConcreteMethPropdef readable var _n_kwmeth: TKwmeth readable var _n_methid: AMethid readable var _n_signature: ASignature + readable var _n_annotations: nullable AAnnotations = null readable var _n_block: nullable AExpr = null end class AConcreteInitPropdef @@ -483,8 +508,21 @@ class AConcreteInitPropdef readable var _n_kwinit: TKwinit readable var _n_methid: nullable AMethid = null readable var _n_signature: ASignature + readable var _n_annotations: nullable AAnnotations = null readable var _n_block: nullable AExpr = null end +class AExternInitPropdef + super APropdef + readable var _n_doc: nullable ADoc = null + readable var _n_kwredef: nullable TKwredef = null + readable var _n_visibility: AVisibility + readable var _n_kwnew: TKwnew + readable var _n_methid: nullable AMethid = null + readable var _n_signature: ASignature + readable var _n_extern: nullable TString = null + readable var _n_extern_calls: nullable AExternCalls = null + readable var _n_extern_code_block: nullable AExternCodeBlock = null +end class AMainMethPropdef super APropdef readable var _n_kwredef: nullable TKwredef = null @@ -498,6 +536,7 @@ class ATypePropdef readable var _n_kwtype: TKwtype readable var _n_id: TClassid readable var _n_type: AType + readable var _n_annotations: nullable AAnnotations = null end class AReadAble super AAble @@ -588,29 +627,24 @@ class ABraassignMethid end class ASignature super ASignature + readable var _n_opar: nullable TOpar = null readable var _n_params: List[AParam] = new List[AParam] + readable var _n_cpar: nullable TCpar = null readable var _n_type: nullable AType = null - readable var _n_closure_decls: List[AClosureDecl] = new List[AClosureDecl] end class 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 - super AClosureDecl - readable var _n_kwbreak: nullable TKwbreak = null - readable var _n_bang: TBang - readable var _n_id: TId - readable var _n_signature: ASignature - readable var _n_expr: nullable AExpr = null + readable var _n_annotations: nullable AAnnotations = null end class AType super AType readable var _n_kwnullable: nullable TKwnullable = null readable var _n_id: TClassid readable var _n_types: List[AType] = new List[AType] + readable var _n_annotations: nullable AAnnotations = null end class ALabel super ALabel @@ -620,6 +654,7 @@ end class ABlockExpr super AExpr readable var _n_expr: List[AExpr] = new List[AExpr] + readable var _n_kwend: nullable TKwend = null end class AVardeclExpr super AExpr @@ -628,6 +663,7 @@ class AVardeclExpr readable var _n_type: nullable AType = null readable var _n_assign: nullable TAssign = null readable var _n_expr: nullable AExpr = null + readable var _n_annotations: nullable AAnnotations = null end class AReturnExpr super AExpr @@ -731,17 +767,17 @@ class AOrElseExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr end -class ANotExpr +class AImpliesExpr super AExpr - readable var _n_kwnot: TKwnot readable var _n_expr: AExpr + readable var _n_expr2: AExpr end -class AEqExpr +class ANotExpr super AExpr + readable var _n_kwnot: TKwnot readable var _n_expr: AExpr - readable var _n_expr2: AExpr end -class AEeExpr +class AEqExpr super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr @@ -826,7 +862,7 @@ class ANewExpr 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] + readable var _n_args: AExprs end class AAttrExpr super AExpr @@ -851,14 +887,13 @@ class ACallExpr 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] + readable var _n_args: AExprs end class ACallAssignExpr super AExpr readable var _n_expr: AExpr readable var _n_id: TId - readable var _n_args: List[AExpr] = new List[AExpr] + readable var _n_args: AExprs readable var _n_assign: TAssign readable var _n_value: AExpr end @@ -866,7 +901,7 @@ class ACallReassignExpr super AExpr readable var _n_expr: AExpr readable var _n_id: TId - readable var _n_args: List[AExpr] = new List[AExpr] + readable var _n_args: AExprs readable var _n_assign_op: AAssignOp readable var _n_value: AExpr end @@ -874,40 +909,33 @@ class ASuperExpr super AExpr readable var _n_qualified: nullable AQualified = null readable var _n_kwsuper: TKwsuper - readable var _n_args: List[AExpr] = new List[AExpr] + readable var _n_args: AExprs end class AInitExpr super AExpr readable var _n_expr: AExpr readable var _n_kwinit: TKwinit - readable var _n_args: List[AExpr] = new List[AExpr] + readable var _n_args: AExprs end class ABraExpr 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] + readable var _n_args: AExprs end class ABraAssignExpr super AExpr readable var _n_expr: AExpr - readable var _n_args: List[AExpr] = new List[AExpr] + readable var _n_args: AExprs readable var _n_assign: TAssign readable var _n_value: AExpr end class ABraReassignExpr super AExpr readable var _n_expr: AExpr - readable var _n_args: List[AExpr] = new List[AExpr] + readable var _n_args: AExprs readable var _n_assign_op: AAssignOp readable var _n_value: AExpr end -class AClosureCallExpr - 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 super AExpr readable var _n_id: TId @@ -928,24 +956,33 @@ class ARangeExpr super AExpr readable var _n_expr: AExpr readable var _n_expr2: AExpr + readable var _n_annotations: nullable AAnnotations = null end class ACrangeExpr super AExpr + readable var _n_obra: TObra readable var _n_expr: AExpr readable var _n_expr2: AExpr + readable var _n_cbra: TCbra + readable var _n_annotations: nullable AAnnotations = null end class AOrangeExpr super AExpr + readable var _n_obra: TObra readable var _n_expr: AExpr readable var _n_expr2: AExpr + readable var _n_cbra: TObra + readable var _n_annotations: nullable AAnnotations = null end class AArrayExpr super AExpr - readable var _n_exprs: List[AExpr] = new List[AExpr] + readable var _n_exprs: AExprs + readable var _n_annotations: nullable AAnnotations = null end class ASelfExpr super AExpr readable var _n_kwself: TKwself + readable var _n_annotations: nullable AAnnotations = null end class AImplicitSelfExpr super AExpr @@ -953,30 +990,42 @@ end class ATrueExpr super AExpr readable var _n_kwtrue: TKwtrue + readable var _n_annotations: nullable AAnnotations = null end class AFalseExpr super AExpr readable var _n_kwfalse: TKwfalse + readable var _n_annotations: nullable AAnnotations = null end class ANullExpr super AExpr readable var _n_kwnull: TKwnull + readable var _n_annotations: nullable AAnnotations = null end -class AIntExpr +class ADecIntExpr super AExpr readable var _n_number: TNumber + readable var _n_annotations: nullable AAnnotations = null +end +class AHexIntExpr + super AExpr + readable var _n_hex_number: THexNumber + readable var _n_annotations: nullable AAnnotations = null end class AFloatExpr super AExpr readable var _n_float: TFloat + readable var _n_annotations: nullable AAnnotations = null end class ACharExpr super AExpr readable var _n_char: TChar + readable var _n_annotations: nullable AAnnotations = null end class AStringExpr super AExpr readable var _n_string: TString + readable var _n_annotations: nullable AAnnotations = null end class AStartStringExpr super AExpr @@ -993,23 +1042,31 @@ end class ASuperstringExpr super AExpr readable var _n_exprs: List[AExpr] = new List[AExpr] + readable var _n_annotations: nullable AAnnotations = null end class AParExpr super AExpr + readable var _n_opar: TOpar readable var _n_expr: AExpr + readable var _n_cpar: TCpar + readable var _n_annotations: nullable AAnnotations = null end class AAsCastExpr super AExpr readable var _n_expr: AExpr readable var _n_kwas: TKwas + readable var _n_opar: nullable TOpar = null readable var _n_type: AType + readable var _n_cpar: nullable TCpar = null end class AAsNotnullExpr super AExpr readable var _n_expr: AExpr readable var _n_kwas: TKwas + readable var _n_opar: nullable TOpar = null readable var _n_kwnot: TKwnot readable var _n_kwnull: TKwnull + readable var _n_cpar: nullable TCpar = null end class AIssetAttrExpr super AExpr @@ -1017,6 +1074,29 @@ class AIssetAttrExpr readable var _n_expr: AExpr readable var _n_id: TAttrid end +class ADebugTypeExpr + super AExpr + readable var _n_kwdebug: TKwdebug + readable var _n_kwtype: TKwtype + readable var _n_expr: AExpr + readable var _n_type: AType +end +class AListExprs + super AExprs + readable var _n_exprs: List[AExpr] = new List[AExpr] +end +class AParExprs + super AExprs + readable var _n_opar: TOpar + readable var _n_exprs: List[AExpr] = new List[AExpr] + readable var _n_cpar: TCpar +end +class ABraExprs + super AExprs + readable var _n_obra: TObra + readable var _n_exprs: List[AExpr] = new List[AExpr] + readable var _n_cbra: TCbra +end class APlusAssignOp super AAssignOp readable var _n_pluseq: TPluseq @@ -1025,23 +1105,6 @@ class AMinusAssignOp super AAssignOp readable var _n_minuseq: TMinuseq end -class AClosureDef - super AClosureDef - readable var _n_bang: TBang - readable var _n_id: AClosureId - readable var _n_ids: List[TId] = new List[TId] - readable var _n_kwdo: nullable TKwdo = null - readable var _n_expr: nullable AExpr = null - readable var _n_label: nullable ALabel = null -end -class ASimpleClosureId - super AClosureId - readable var _n_id: TId -end -class ABreakClosureId - super AClosureId - readable var _n_kwbreak: TKwbreak -end class AModuleName super AModuleName readable var _n_quad: nullable TQuad = null @@ -1066,17 +1129,18 @@ class ALocalPropExternCall end class AFullPropExternCall super AExternCall - readable var _n_classid: TClassid - readable var _n_quad: nullable TQuad = null + readable var _n_type: AType + readable var _n_dot: nullable TDot = null readable var _n_methid: AMethid end class AInitPropExternCall super AExternCall - readable var _n_classid: TClassid + readable var _n_type: AType end class ACastAsExternCall super AExternCall readable var _n_from_type: AType + readable var _n_dot: nullable TDot = null readable var _n_kwas: TKwas readable var _n_to_type: AType end @@ -1093,6 +1157,16 @@ class AAsNotNullableExternCall readable var _n_kwnot: TKwnot readable var _n_kwnullable: TKwnullable end +class AInLanguage + super AInLanguage + readable var _n_kwin: TKwin + readable var _n_string: TString +end +class AExternCodeBlock + super AExternCodeBlock + readable var _n_in_language: nullable AInLanguage = null + readable var _n_extern_code_segment: TExternCodeSegment +end class AQualified super AQualified readable var _n_id: List[TId] = new List[TId] @@ -1102,9 +1176,68 @@ class ADoc super ADoc readable var _n_comment: List[TComment] = new List[TComment] end +class AAnnotations + super AAnnotations + readable var _n_at: nullable TAt = null + readable var _n_opar: nullable TOpar = null + readable var _n_items: List[AAnnotation] = new List[AAnnotation] + readable var _n_cpar: nullable TCpar = null +end +class AAnnotation + super AAnnotation + readable var _n_atid: AAtid + readable var _n_opar: nullable TOpar = null + readable var _n_args: List[AAtArg] = new List[AAtArg] + readable var _n_cpar: nullable TCpar = null + readable var _n_annotations: nullable AAnnotations = null +end +class ATypeAtArg + super AAtArg + readable var _n_type: AType +end +class AExprAtArg + super AAtArg + readable var _n_expr: AExpr +end +class AAtAtArg + super AAtArg + readable var _n_annotations: AAnnotations +end +class AIdAtid + super AAtid + readable var _n_id: TId +end +class AKwexternAtid + super AAtid + readable var _n_id: TKwextern +end +class AKwinternAtid + super AAtid + readable var _n_id: TKwintern +end +class AKwreadableAtid + super AAtid + readable var _n_id: TKwreadable +end +class AKwwritableAtid + super AAtid + readable var _n_id: TKwwritable +end +class AKwimportAtid + super AAtid + readable var _n_id: TKwimport +end class Start super Prod readable var _n_base: nullable AModule readable var _n_eof: EOF + init( + n_base: nullable AModule, + n_eof: EOF) + do + _n_base = n_base + _n_eof = n_eof + end + end