pep8analysis: update and remove old-style attributes
[nit.git] / contrib / pep8analysis / src / parser / parser_nodes.nit
index 62efb2a..97530a4 100644 (file)
@@ -6,11 +6,9 @@ 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)
+       var location: Location is writable, noinit
 end
 
 # Ancestor of all tokens
@@ -23,7 +21,6 @@ end
 # Ancestor of all productions
 abstract class Prod
        super ANode
-       fun location=(loc: Location) do _location = loc
 end
 class TEol
        super Token
@@ -81,135 +78,133 @@ class TId
 end
 class EOF
        super Token
-       #private init noinit do end
 end
 class AError
        super EOF
-       #private init noinit do end
 end
 
 class ALine
        super Prod
-       readable var _n_label_decl: nullable ALabelDecl = null
-    readable var _n_comment: nullable TComment = null
+       var n_label_decl: nullable ALabelDecl = null
+    var n_comment: nullable TComment = null
 end
 class AInstruction
        super Prod
-    readable writable var _n_id: TId
+    var n_id: TId is noinit
 end
 class AOperand
        super Prod
-    readable var _n_value: AValue
+    var n_value: AValue is noinit
 end
 class AValue super Prod end
 class ADirective super Prod end
 
 class AListing
        super Prod
-    readable var _n_lines: List[ALine] = new List[ALine]
-    readable var _n_label_decl: nullable ALabelDecl = null
-    readable var _n_end_block: TEndBlock
+    var n_lines: List[ALine] = new List[ALine]
+    var n_label_decl: nullable ALabelDecl = null
+    var n_end_block: TEndBlock is noinit
 end
 class AEmptyLine
        super ALine
-    readable var _n_eol: TEol
+    var n_eol: TEol is noinit
 end
 abstract class ANonEmptyLine
        super ALine
 end
 class AInstructionLine
        super ANonEmptyLine
-    readable var _n_instruction: AInstruction
-    readable var _n_eol: TEol
+    var n_instruction: AInstruction is noinit
+    var n_eol: TEol is noinit
 end
 class ADirectiveLine
        super ANonEmptyLine
-    readable var _n_directive: ADirective
-    readable var _n_eol: TEol
+    var n_directive: ADirective is noinit
+    var n_eol: TEol is noinit
 end
 class ALabelDecl
        super Prod
-    readable var _n_id: TId
-    readable var _n_colon: TColon
+    var n_id: TId is noinit
+    var n_colon: TColon is noinit
 end
 class AUnaryInstruction
        super AInstruction
 end
 class ABinaryInstruction
        super AInstruction
-    readable var _n_operand: AOperand
+    var n_operand: AOperand is noinit
 end
 class AImmediateOperand
        super AOperand
 end
 class AAnyOperand
        super AOperand
-    readable var _n_comma: TComma
-    readable var _n_id: TId
+    var n_comma: TComma is noinit
+    var n_id: TId is noinit
 end
 class ALabelValue
        super AValue
-    readable var _n_id: TId
+    var n_id: TId is noinit
 end
 class ANumberValue
        super AValue
-    readable var _n_number: TNumber
+    var n_number: TNumber is noinit
 end
 class ACharValue
        super AValue
-    readable var _n_char: TChar
+    var n_char: TChar is noinit
 end
 class AStringValue
        super AValue
-    readable var _n_string: TString
+    var n_string: TString is noinit
 end
 class AHexValue
        super AValue
-    readable var _n_hex: THex
+    var n_hex: THex is noinit
 end
 class AByteDirective
        super ADirective
-    readable var _n_tk_byte: TTkByte
-    readable var _n_value: AValue
+    var n_tk_byte: TTkByte is noinit
+    var n_value: AValue is noinit
 end
 class AWordDirective
        super ADirective
-    readable var _n_tk_word: TTkWord
-    readable var _n_value: AValue
+    var n_tk_word: TTkWord is noinit
+    var n_value: AValue is noinit
 end
 class ABlockDirective
        super ADirective
-    readable var _n_tk_block: TTkBlock
-    readable var _n_value: AValue
+    var n_tk_block: TTkBlock is noinit
+    var n_value: AValue is noinit
 end
 class AAsciiDirective
        super ADirective
-    readable var _n_tk_ascii: TTkAscii
-    readable var _n_value: AValue
+    var n_tk_ascii: TTkAscii is noinit
+    var n_value: AValue is noinit
 end
 class AAddrssDirective
        super ADirective
-    readable var _n_tk_addrss: TTkAddrss
-    readable var _n_value: AValue
+    var n_tk_addrss: TTkAddrss is noinit
+    var n_value: AValue is noinit
 end
 class AEquateDirective
        super ADirective
-    readable var _n_tk_equate: TTkEquate
-    readable var _n_value: AValue
+    var n_tk_equate: TTkEquate is noinit
+    var n_value: AValue is noinit
 end
 class ABurnDirective
        super ADirective
-    readable var _n_tk_burn: TTkBurn
-    readable var _n_value: AValue
+    var n_tk_burn: TTkBurn is noinit
+    var n_value: AValue is noinit
 end
 
 class Start
        super Prod
-    readable var _n_base: nullable AListing
-    readable var _n_eof: EOF
+    var n_base: nullable AListing
+    var n_eof: EOF is noinit
        init(n_base: nullable AListing, n_eof: EOF)
        do
-               super(null)
+               super
                _n_base = n_base
                _n_eof = n_eof
        end