parser: split `AIntExpr` and `ADecIntExpr`
[nit.git] / src / parser / parser_abs.nit
index 16fe07d..2493164 100644 (file)
@@ -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
@@ -275,9 +268,6 @@ end
 class TFloat
        super Token
 end
-class TChar
-       super Token
-end
 class TString
        super Token
 end
@@ -290,19 +280,29 @@ end
 class TEndString
        super Token
 end
-class TBadChar
+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
@@ -318,24 +318,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
@@ -343,12 +347,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
@@ -379,6 +385,8 @@ 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
@@ -411,17 +419,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
@@ -434,6 +444,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
@@ -452,6 +463,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
@@ -472,6 +484,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
@@ -481,6 +494,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
@@ -491,6 +505,7 @@ 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
@@ -503,6 +518,7 @@ class AExternInitPropdef
     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
@@ -517,6 +533,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
@@ -607,29 +624,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
@@ -648,6 +660,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
@@ -751,17 +764,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
@@ -872,7 +885,6 @@ class ACallExpr
     readable var _n_expr: AExpr
     readable var _n_id: TId
     readable var _n_args: AExprs
-    readable var _n_closure_defs: List[AClosureDef] = new List[AClosureDef]
 end
 class ACallAssignExpr
        super AExpr
@@ -906,7 +918,6 @@ class ABraExpr
        super AExpr
     readable var _n_expr: AExpr
     readable var _n_args: AExprs
-    readable var _n_closure_defs: List[AClosureDef] = new List[AClosureDef]
 end
 class ABraAssignExpr
        super AExpr
@@ -922,12 +933,6 @@ class ABraReassignExpr
     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: AExprs
-    readable var _n_closure_defs: List[AClosureDef] = new List[AClosureDef]
-end
 class AVarExpr
        super AExpr
     readable var _n_id: TId
@@ -948,6 +953,7 @@ 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
@@ -955,6 +961,7 @@ class ACrangeExpr
     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
@@ -962,14 +969,17 @@ class AOrangeExpr
     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: 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
@@ -977,30 +987,37 @@ 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 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
@@ -1017,29 +1034,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: TOpar
+    readable var _n_opar: nullable TOpar = null
     readable var _n_type: AType
-    readable var _n_cpar: TCpar
+    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: TOpar
+    readable var _n_opar: nullable TOpar = null
     readable var _n_kwnot: TKwnot
     readable var _n_kwnull: TKwnull
-    readable var _n_cpar: TCpar
+    readable var _n_cpar: nullable TCpar = null
 end
 class AIssetAttrExpr
        super AExpr
@@ -1047,6 +1066,13 @@ 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]
@@ -1071,23 +1097,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
@@ -1112,17 +1121,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
@@ -1139,6 +1149,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]
@@ -1148,9 +1168,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