anchor.diff:  parser Calculator:
       ignore:    "[ \r\t\n]+"
       ignore:    "\\/\\/.*?\r?\n"
  -    token END: "$"
  +    token BEGIN: "begin"
  +    token END: "end"
  +    token ENDTOKEN: "$"
       token NUM: "[0-9]+"
       token VAR: "[a-zA-Z_][a-zA-Z0-9_]*"
       token STR:   r'"([^\\"]+|\\.)*"'
  +    token LPAREN: "\\("
  +    token RPAREN: "\\)"
  +    token HASH: "#"
  +    token DOT: r"[\\.]"
  +    token COMMA: ','
  +    token COMMA2: ","
  +    token COLON: ':'
  +    token SEMICOLON: ';'
  +    token LBRACKET: "\\["
  +    token RBRACKET: "\\]"
  +    token LBRACE: "{"
  +    token RBRACE: "}"
  +    token QUESTION: "\\?"
  +    token CARET: "\\^"
  +    token LESS: "<"
  +    token LESSLESS: "<<"
  +    token LEQ: "<="
  +    token LARROW: "<-"
  +    token EQEQ: "=="
  +    token EQUAL: "="
  +    token STAR: "[*]"
   
       rule case_value:
  -        "case" "\\(" expression "\\)"
  -        (VAR ':' 'return' expression ';' )*
  +        "case" LPAREN expression RPAREN
  +        (VAR COLON 'return' expression SEMICOLON )*
           "endcase"
   
       # Each line can either be an expression or an assignment statement
  -    rule gggoal:   expr<<[]>> END            {{ return expr }}
  -               | "set" VAR expr<<[]>> END  {{ globalvars[VAR] = expr }}
  +    rule gggoal:   expr<<[]>> ENDTOKEN            {{ return expr }}
  +               | "set" VAR expr<<[]>> ENDTOKEN  {{ globalvars[VAR] = expr }}
                                              {{ return expr }}
   
       # An expression is the sum and difference of factors
  
positive.code: 
      # A factor is the product and division of terms
      rule factor<<V>>: term<<V>>           {{ v = term }}
                       ( "[*]" term<<V>>    {{ v = v*term }}
                       |  "/"  term<<V>>    {{ v = v/term }}
                       |  "\\^"  term<<V>>
                       |  "<"  term<<V>>
                       |  ">"  term<<V>>
                       |  "<<"  term<<V>>
                       |  ">>"  term<<V>>
                       |  "=="  term<<V>>
                       |  "!="  term<<V>>
                       |  "\\?"  term<<V>> ':'  term<<V>>
                       )*                   {{ return v }}
  
      rule fieldname: VAR
  
      rule typefieldname: VAR
  
      # A term is a number, variable, or an expression surrounded by parentheses
      rule term<<V>>:
                 case_value
                 | NUM  [ "\\'b" NUM ]      {{ return int(NUM) }}
                 | VAR 
                      ( r"[\\.]" fieldname )*
                      [ "#" ]
                      [   ( "\\("
                               ( expr<<V>> ( ',' expr<<V>> )* "\\)" ( r"[\\.]" fieldname )*
                               | "\\)" ( r"[\\.]" fieldname )*
                               )
                          | "{" typefieldname ":" expr<<V>> ( ',' typefieldname ":" expr<<V>> )* "}"
                          )
                      ]
                      [ "\\[" expr<<V>> [ ':' expr<<V>> ] "\\]" ]
                      {{ return lookup(V, VAR) }}
                 | STR
                 | "\\(" expr<<V>> "\\)"
                      [ "\\[" expr<<V>> [ ':' expr<<V>> ] "\\]" ]
                      {{ return expr }}
                 | "{" expr<<V>> ( ',' expr<<V>> )* "}"
  
                 #| "let" VAR "=" expr<<V>>  {{ V = [(VAR, expr)] + V }}
                 #  "in" expr<<V>>           {{ return expr }}
  
  ###########jca
  
negative.code: 
      rule attribute:
          "synthesize"
          | "RST_N"  EQUAL STRING
          | "CLK"  EQUAL STRING
          | "always_ready" [ EQUAL interface_method ]
          | "always_enabled" [ EQUAL interface_method ]
          | "descending" "urgency" EQUAL LBRACE rule_names RBRACE
          | "preempts" [ EQUAL ] LBRACE rule_names COMMA  LPAREN list_rule_names RPAREN RBRACE
          | "doc" EQUAL STRING
          | "ready" EQUAL STRING
          | "enable" EQUAL STRING
          | "result" EQUAL STRING
          | "prefix" EQUAL STRING
          | "port"  EQUAL STRING
          | "noinline"
          | "fire_when_enabled"
          | "no_implicit_conditions"
  
      rule attribute_statement:
           "\\([*]" attribute [ EQUAL expression ] "[*]\\)"
  
      rule Type_item_or_name:
          Type_item
          | VAR [ HASH LPAREN expression (COMMA expression )* RPAREN ]
  
      rule Ifc_type: Type_item_or_name
  
      rule import_statements:
          "import"
          ( "BDPI" [ c_function_name  EQUAL ] "function" Return_type
              function_name [ LBRACE arguments RBRACE ] RPAREN  [ provisos ] SEMICOLON
          | "BVI" [verilog_module_name]  EQUAL
              "module" [ Type ] module_name [ HASH  LPAREN parameter RPAREN ]
              LPAREN Ifc_type ifc_name RPAREN  [ provisos ] SEMICOLON
              module_statements
              importBVI_statements
              "endmodule" [ COLON  module_name ]
          | Package_name  "::"  STAR SEMICOLON
          )
  
      rule for_statement:
          "for" LPAREN
              Type_item_or_name VAR EQUAL expression SEMICOLON
              expression SEMICOLON
              variable_assignment RPAREN
          BEGIN
              ( let_statement
              | if_statement
              | variable_declaration_or_call
              )*
          END
  
      rule method_body_statements:
          ( let_statement
  