cleanup: remove old 'special' keyword
[nit.git] / src / parser / parser_nodes.nit
index 009773d..c58c66a 100644 (file)
@@ -29,6 +29,13 @@ abstract class ANode
        fun location: Location do return _location.as(not null)
        # The location of the important part of the node (identifier or whatever)
        fun hot_location: Location do return location
+       init do end
+
+       # Display a message for the colored location of the node
+       fun debug(message: String)
+       do
+               print "{hot_location} {self.class_name}: {message}\n{hot_location.colored_line("0;32")}"
+       end
 end
 
 # Ancestor of all tokens
@@ -56,7 +63,7 @@ end
 class TComment
        super Token
 end
-class TokenKeyword
+abstract class TokenKeyword
        super Token
        redef fun to_s
        do
@@ -210,6 +217,9 @@ end
 class TKwlabel
        super TokenKeyword
 end
+class TKwdebug
+       super Token
+end
 class TOpar
        super Token
 end
@@ -234,7 +244,7 @@ end
 class TAssign
        super Token
 end
-class TokenOperator
+abstract class TokenOperator
        super Token
        redef fun to_s
        do
@@ -322,7 +332,7 @@ class TAttrid
                do return "attribute '{text}'"
        end
 end
-class TokenLiteral
+abstract class TokenLiteral
        super Token
        redef fun to_s
        do
@@ -364,6 +374,9 @@ class TBadChar
                do return "malformed character {text}"
        end
 end
+class TExternCodeSegment
+       super Token
+end
 class EOF
        super Token
 private init noinit do end
@@ -381,6 +394,7 @@ class AModule
        super Prod
     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
@@ -389,7 +403,7 @@ class AModuledecl
     readable var _n_kwmodule: TKwmodule
     readable var _n_name: AModuleName
 end
-class AImport super Prod end
+abstract class AImport super Prod end
 class AStdImport
        super AImport
     readable var _n_visibility: AVisibility
@@ -402,7 +416,7 @@ class ANoImport
     readable var _n_kwimport: TKwimport
     readable var _n_kwend: TKwend
 end
-class AVisibility super Prod end
+abstract class AVisibility super Prod end
 class APublicVisibility
        super AVisibility
 end
@@ -418,7 +432,9 @@ class AIntrudeVisibility
        super AVisibility
     readable var _n_kwintrude: TKwintrude
 end
-class AClassdef super Prod end
+abstract class AClassdef super Prod
+    readable var _n_propdefs: List[APropdef] = new List[APropdef]
+end
 class AStdClassdef
        super AClassdef
     readable var _n_doc: nullable ADoc = null
@@ -427,20 +443,18 @@ 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_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
     redef fun hot_location do return n_id.location
 end
 class ATopClassdef
        super AClassdef
-    readable var _n_propdefs: List[APropdef] = new List[APropdef]
 end
 class AMainClassdef
        super AClassdef
-    readable var _n_propdefs: List[APropdef] = new List[APropdef]
 end
-class AClasskind super Prod end
+abstract class AClasskind super Prod end
 class AConcreteClasskind
        super AClasskind
     readable var _n_kwclass: TKwclass
@@ -473,7 +487,7 @@ class ASuperclass
     readable var _n_kwsuper: nullable TKwsuper = null
     readable var _n_type: AType
 end
-class APropdef super Prod
+abstract class APropdef super Prod
     readable var _n_doc: nullable ADoc = null
 end
 class AAttrPropdef
@@ -492,7 +506,7 @@ class AAttrPropdef
            if n_id != null then return n_id.location else return n_id2.location
     end
 end
-class AMethPropdef
+abstract class AMethPropdef
        super APropdef
     readable var _n_kwredef: nullable TKwredef = null
     readable var _n_visibility: nullable AVisibility
@@ -515,10 +529,11 @@ class AInternMethPropdef
        super AMethPropdef
     readable var _n_kwmeth: TKwmeth
 end
-class AExternPropdef
+abstract class AExternPropdef
        super AMethPropdef
     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 AExternMethPropdef
        super AMethPropdef
@@ -530,19 +545,18 @@ class AConcreteMethPropdef
     readable var _n_kwmeth: nullable TKwmeth
     readable var _n_block: nullable AExpr = null
 end
-class AInitPropdef
+abstract class AInitPropdef
+       super AMethPropdef
 end
 class AConcreteInitPropdef
        super AConcreteMethPropdef
        super AInitPropdef
-    init do end
     readable var _n_kwinit: TKwinit
     redef fun hot_location do return n_kwinit.location
 end
 class AExternInitPropdef
        super AExternPropdef
        super AInitPropdef
-    init do end
     readable var _n_kwnew: TKwnew
 end
 class AMainMethPropdef
@@ -553,47 +567,47 @@ class AExternCalls
     readable var _n_kwimport: TKwimport
     readable var _n_extern_calls: List[AExternCall] = new List[AExternCall]
 end
-class AExternCall
+abstract class AExternCall
        super Prod
 end
-class APropExternCall
-special AExternCall
+abstract class APropExternCall
+super AExternCall
 end
 class ALocalPropExternCall
-special APropExternCall
+super APropExternCall
     readable var _n_methid: AMethid
 end
 class AFullPropExternCall
-special APropExternCall
+super APropExternCall
     readable var _n_classid: TClassid
     readable var _n_quad: nullable TQuad = null
     readable var _n_methid: AMethid
 end
 class AInitPropExternCall
-special APropExternCall
+super APropExternCall
     readable var _n_classid: TClassid
 end
 class ASuperExternCall
-special AExternCall
+super AExternCall
     readable var _n_kwsuper: TKwsuper
 end
-class ACastExternCall
-special AExternCall
+abstract class ACastExternCall
+super AExternCall
 end
 class ACastAsExternCall
-special ACastExternCall
+super ACastExternCall
     readable var _n_from_type: AType
     readable var _n_kwas: TKwas
     readable var _n_to_type: AType
 end
 class AAsNullableExternCall
-special ACastExternCall
+super ACastExternCall
     readable var _n_type: AType
     readable var _n_kwas: TKwas
     readable var _n_kwnullable: TKwnullable
 end
 class AAsNotNullableExternCall
-special ACastExternCall
+super ACastExternCall
     readable var _n_type: AType
     readable var _n_kwas: TKwas
     readable var _n_kwnot: TKwnot
@@ -607,7 +621,7 @@ class ATypePropdef
     readable var _n_id: TClassid
     readable var _n_type: AType
 end
-class AAble super Prod
+abstract class AAble super Prod
     readable var _n_visibility: nullable AVisibility = null
     readable var _n_kwredef: nullable TKwredef = null
 end
@@ -619,7 +633,7 @@ class AWriteAble
        super AAble
     readable var _n_kwwritable: TKwwritable
 end
-class AMethid super Prod end
+abstract class AMethid super Prod end
 class AIdMethid
        super AMethid
     readable var _n_id: TId
@@ -729,7 +743,7 @@ class ALabel
     readable var _n_kwlabel: TKwlabel
     readable var _n_id: TId
 end
-class AExpr super Prod end
+abstract class AExpr super Prod end
 class ABlockExpr
        super AExpr
     readable var _n_expr: List[AExpr] = new List[AExpr]
@@ -748,7 +762,7 @@ class AReturnExpr
     readable var _n_kwreturn: nullable TKwreturn = null
     readable var _n_expr: nullable AExpr = null
 end
-class ALabelable
+abstract class ALabelable
        super Prod
     readable var _n_label: nullable ALabel = null
 end
@@ -820,12 +834,12 @@ class AAssertExpr
     readable var _n_expr: AExpr
     readable var _n_else: nullable AExpr = null
 end
-class AAssignFormExpr
+abstract class AAssignFormExpr
        super AExpr
     readable var _n_assign: TAssign
     readable var _n_value: AExpr
 end
-class AReassignFormExpr
+abstract class AReassignFormExpr
        super AExpr
     readable var _n_assign_op: AAssignOp
     readable var _n_value: AExpr
@@ -834,16 +848,16 @@ class AOnceExpr
        super AProxyExpr
     readable var _n_kwonce: TKwonce
 end
-class ASendExpr
+abstract class ASendExpr
        super AExpr
     readable var _n_expr: AExpr
     readable var _n_closure_defs: List[AClosureDef] = new List[AClosureDef]
 end
-class ABinopExpr
+abstract class ABinopExpr
        super ASendExpr
     readable var _n_expr2: AExpr
 end
-class ABoolExpr
+abstract class ABoolExpr
        super AExpr
 end
 class AOrExpr
@@ -929,7 +943,7 @@ class ANewExpr
     readable var _n_id: nullable TId = null
     readable var _n_args: AExprs
 end
-class AAttrFormExpr
+abstract class AAttrFormExpr
        super AExpr
     readable var _n_expr: AExpr
     readable var _n_id: TAttrid
@@ -941,11 +955,15 @@ class AAttrAssignExpr
        super AAttrFormExpr
        super AAssignFormExpr
 end
-class ACallFormExpr
+abstract class ACallFormExpr
        super ASendExpr
     readable var _n_id: TId
     readable var _n_args: AExprs
 end
+abstract class ASendReassignFormExpr
+       super ASendExpr
+       super AReassignFormExpr
+end
 class AAttrReassignExpr
        super AExpr
        super AAttrFormExpr
@@ -961,7 +979,7 @@ end
 class ACallReassignExpr
        super AExpr
        super ACallFormExpr
-       super AReassignFormExpr
+       super ASendReassignFormExpr
 end
 class ASuperExpr
        super AExpr
@@ -974,7 +992,7 @@ class AInitExpr
     readable var _n_kwinit: TKwinit
     readable var _n_args: AExprs
 end
-class ABraFormExpr
+abstract class ABraFormExpr
        super ASendExpr
     readable var _n_args: AExprs
 end
@@ -985,13 +1003,13 @@ class ABraAssignExpr
        super ABraFormExpr
        super AAssignFormExpr
 end
-class AVarFormExpr
+abstract class AVarFormExpr
        super AExpr
     readable var _n_id: TId
 end
 class ABraReassignExpr
        super ABraFormExpr
-       super AReassignFormExpr
+       super ASendReassignFormExpr
 end
 class AClosureCallExpr
        super AExpr
@@ -1010,7 +1028,7 @@ class AVarReassignExpr
        super AVarFormExpr
        super AReassignFormExpr
 end
-class ARangeExpr
+abstract class ARangeExpr
        super AExpr
     readable var _n_expr: AExpr
     readable var _n_expr2: AExpr
@@ -1060,7 +1078,7 @@ class ACharExpr
        super AExpr
     readable var _n_char: TChar
 end
-class AStringFormExpr
+abstract class AStringFormExpr
        super AExpr
 end
 class AStringExpr
@@ -1088,7 +1106,7 @@ class AParExpr
     readable var _n_opar: TOpar
     readable var _n_cpar: TCpar
 end
-class AProxyExpr
+abstract class AProxyExpr
        super AExpr
     readable var _n_expr: AExpr
 end
@@ -1113,10 +1131,17 @@ class AIssetAttrExpr
        super AAttrFormExpr
     readable var _n_kwisset: TKwisset
 end
-class AExprs
+abstract class AExprs
        super Prod 
     readable var _n_exprs: List[AExpr] = new List[AExpr]
 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
 end
@@ -1130,7 +1155,7 @@ class ABraExprs
     readable var _n_obra: TObra
     readable var _n_cbra: TCbra
 end
-class AAssignOp super Prod end
+abstract class AAssignOp super Prod end
 class APlusAssignOp
        super AAssignOp
     readable var _n_pluseq: TPluseq
@@ -1148,7 +1173,7 @@ class AClosureDef
     readable var _n_expr: nullable AExpr = null
     redef fun hot_location do return n_id.location
 end
-class AClosureId
+abstract class AClosureId
        super Prod
 end
 class ASimpleClosureId
@@ -1160,11 +1185,21 @@ class ABreakClosureId
     readable var _n_kwbreak: TKwbreak
 end
 class AModuleName
-special Prod
+super Prod
     readable var _n_quad: nullable TQuad = null
     readable var _n_path: List[TId] = new List[TId]
     readable var _n_id: TId
 end
+class AInLanguage
+       super Prod
+    readable var _n_kwin: TKwin
+    readable var _n_string: TString
+end
+class AExternCodeBlock
+       super Prod
+    readable var _n_in_language: nullable AInLanguage = null
+    readable var _n_extern_code_segment: TExternCodeSegment
+end
 class AQualified
        super Prod
     readable var _n_quad: nullable TQuad = null
@@ -1180,4 +1215,9 @@ class Start
        super Prod
     readable var _n_base: nullable AModule
     readable var _n_eof: EOF
+    init(n_base: nullable AModule, n_eof: EOF)
+    do
+           self._n_base = n_base
+           self._n_eof = n_eof
+    end
 end