anchor.diff:          |   '\t'
           |   '\f'
           )
  -        { _ttype = Token.SKIP; }
  +        { $setType(SKIP); }
       ;
   
   EOL
  
positive.code: 	k = 3;
  }
  
  start: (statement)* EOF;
  
  statement: labels tail EOL;
  
  labels	: (symbol COLON) => (symbol COLON^ labels)
  	| /* no label */
  	;
  
  tail	: /* empty statement */
  	| DIRECTIVE^ (~EOL)*
  	| prefixed_instruction
  	;
  
  prefixed_instruction
  	: (instruction) => instruction
  	| INSTRUCTION instruction
  	;
  instruction: INSTRUCTION^ (operand (COMMA! operand)* )?;
   
  operand	: (memory) => memory
  	| constant
  	| immediate 
  	| register 
  	;
  
  immediate: DOLLAR^ constant;
  
  register: PERCENTAGE^ symbol;
  
  memory: (disp:constant)? LPAR! (base:register)? (COMMA! (index:register)? (COMMA! (scale:integer)? )? )? RPAR!;
  
  constant: symbol | integer;
  
  symbol: DIRECTIVE | INSTRUCTION;
  
  integer	: BINARY
  	| OCTAL 
  	| DECIMAL
  	| HEXADECIMAL
  	| MINUS^ integer
  	;
  
  
negative.code: }
  
  header "asmParser.__main__" {
      from asmLexer import Lexer
      from aterm import Factory
      
      factory = Factory()
      lexer = Lexer()
      parser = Parser(lexer, factory = factory)
      term = parser.start()
      print str(term)
      ast = parser.getAST()
      print ast.toStringList()
  }
  
  header "asmParser.__init__" {
      self.factory = kwargs["factory"]
  }
  
  options {
  