anchor.diff:     ;
   
   asTypeClause
  -   : AS WS (NEW WS)? type (WS fieldLength)?
  +   : AS (NEW)? type (fieldLength)?
      ;
   
   baseType
  
positive.code:    ;
  
  module
     : WS? NEWLINE* (moduleHeader NEWLINE +)? moduleConfig? NEWLINE* moduleAttributes? NEWLINE* moduleOptions? NEWLINE* moduleBody? NEWLINE* WS?
     ;
  
  moduleHeader
     : VERSION WS DOUBLELITERAL WS CLASS
     ;
  
  moduleConfig
  
negative.code:    ;
  
  subStmt
     : (visibility)? (STATIC)? SUB ambiguousIdentifier (argList)? NEWLINE + (block NEWLINE +)? END_SUB
     ;
  
  timeStmt
     : TIME EQ valueStmt
     ;
  
  typeStmt
     : (visibility)? TYPE ambiguousIdentifier NEWLINE + (typeStmt_Element)* END_TYPE
     ;
  
  typeStmt_Element
     : ambiguousIdentifier (LPAREN (subscripts)? RPAREN)? (asTypeClause)? NEWLINE +
     ;
  
  typeOfStmt
     : TYPEOF valueStmt (IS type)?
     ;
  
  unloadStmt
     : UNLOAD valueStmt
     ;
  
  unlockStmt
     : UNLOCK valueStmt (COMMA valueStmt (TO valueStmt)?)?
     ;
  
  // operator precedence is represented by rule order
  valueStmt
     : literal # vsLiteral
     | implicitCallStmt_InStmt # vsICS
     | LPAREN valueStmt (COMMA valueStmt)* RPAREN # vsStruct
     | NEW valueStmt # vsNew
     | typeOfStmt # vsTypeOf
     | midStmt # vsMid
     | ADDRESSOF valueStmt # vsAddressOf
     | implicitCallStmt_InStmt ASSIGN valueStmt # vsAssign
     | valueStmt IS valueStmt # vsIs
     | valueStmt LIKE valueStmt # vsLike
     | valueStmt GEQ valueStmt # vsGeq
     | valueStmt LEQ valueStmt # vsLeq
     | valueStmt GT valueStmt # vsGt
     | valueStmt LT valueStmt # vsLt
     | valueStmt NEQ valueStmt # vsNeq
     | valueStmt EQ valueStmt # vsEq
     | valueStmt AMPERSAND valueStmt # vsAmp
     | MINUS valueStmt # vsNegation
     | PLUS valueStmt # vsPlus
     | valueStmt PLUS valueStmt # vsAdd
     | valueStmt MOD valueStmt # vsMod
     | valueStmt DIV valueStmt # vsDiv
     | valueStmt MULT valueStmt # vsMult
     | valueStmt MINUS valueStmt # vsMinus
     | valueStmt POW valueStmt # vsPow
     | valueStmt IMP valueStmt # vsImp
     | valueStmt EQV valueStmt # vsEqv
     | valueStmt XOR valueStmt # vsXor
     | valueStmt OR valueStmt # vsOr
     | valueStmt AND valueStmt # vsAnd
     | NOT valueStmt # vsNot
     ;
  
  variableStmt
     : (DIM | STATIC | visibility) (WITHEVENTS)? variableListStmt
     ;
  
  variableListStmt
     : variableSubStmt (COMMA variableSubStmt)*
     ;
  
  variableSubStmt
     : ambiguousIdentifier (LPAREN (subscripts)? RPAREN)? typeHint? (asTypeClause)?
     ;
  
  whileWendStmt
     : WHILE valueStmt NEWLINE + (block NEWLINE)* WEND
     ;
  
  widthStmt
     : WIDTH valueStmt COMMA valueStmt
     ;
  
  withStmt
     : WITH implicitCallStmt_InStmt NEWLINE + (block NEWLINE +)? END_WITH
     ;
  
  writeStmt
     : WRITE valueStmt COMMA (outputList)?
     ;
  
  // complex call statements ----------------------------------
  