anchor.diff:          | for_statement
           | variable_declaration_and_initializations
           )*
  -        "endmodule" [ ":" module_name]
  +        "endmodule" [ COLON module_name]
   
       rule package_statement:
  -        "package" Package_name ';'
  +        "package" Package_name SEMICOLON
           typedef_statements
           import_statements
           interface_declarations
           module_declarations
  -        "endpackage" [ ":"  Package_name]
  -
  -#    "Rules"
  -#    "Tuple2#" "\\("t1 "," t2"\\)"  ... "Tuple7#" "\\("t1 ","... "," t7"\\)"
  -#    "int" | "Nat" | "Maybe#" "\\(" t "\\)"
  -#    Type_name
  -#    Type_name "#" "\\(" type_variable "\\)"
  -
  -#    Ifc_type ifc_name "<-" module_name "\\("parameter"\\)" ';'
  -#    Ifc_type ifc_name "<-" module_name "\\("[parameter ","
  -#        "clocked_by" clock_name ","
  -#        "reset_by" reset_name ] "\\)" ';'
  +        "endpackage" [ COLON  Package_name]
  +
  +#    Ifc_type ifc_name LARROW module_name LPARENparameterRPAREN SEMICOLON
  +#    Ifc_type ifc_name LARROW module_name LPAREN[parameter COMMA2
  +#        "clocked_by" clock_name COMMA2
  +#        "reset_by" reset_name ] RPAREN SEMICOLON
  +
  +    rule rule_statements: "RULEST"
   
       rule rule_statement:
  -        "rule" rule_name [rule_predicate] ';'
  +        "rule" rule_name [rule_predicate] SEMICOLON
           action_statements
  -        "endrule" [ ":"  rule_name ]
  +        "endrule" [ COLON  rule_name ]
   
       rule rules_statement:
  -        "rules" [ ":"  rules_name]
  -        rule_satements
  -        (variable_declaration_or_call ';')*
  -        "endrules" [ ":"  rules_name]
  +        "rules" [ COLON  rules_name]
  +        rule_statements
  +        (variable_declaration_or_call SEMICOLON)*
  +        "endrules" [ COLON  rules_name]
   
       rule action_statement:
  -        "action" [ ":"  action_name] [ ';' ]
  +        "action" [ COLON  action_name] [ SEMICOLON ]
           action_statements
  -        "endaction" [ ":" action_name]
  +        "endaction" [ COLON action_name]
   
       rule Type_name: VAR
   
       rule Type_item:
  -        ( "Bit#" | "Int#" | "Uint#" | "ComplexF#" | "Reg#" | "FIFO#" | "Maybe#" ) "\\(" expression "\\)"
  -        | "Integer" | "Bool" | "String" | "Action" | "ActionValue#" "\\(" VAR "\\)"
  +        ( "Bit#" | "Int#" | "Uint#" | "ComplexF#" | "Reg#" | "FIFO#" | "Maybe#" ) LPAREN expression RPAREN
  +        | "Integer" | "Bool" | "String" | "Action" | "ActionValue#" LPAREN VAR RPAREN
           | "Nat"
   
  -#    "type identifier "<-" expression ';'
  -#    identifier "<-" expression ';'
  +#    "type identifier LARROW expression SEMICOLON
  +#    identifier LARROW expression SEMICOLON
   
       rule let_statement:
  -        "let" VAR  ( "=" | "<-" ) expression ';'
  -
  -#    register_name "<=" expression ';'
  +        "let" VAR  ( EQUAL | LARROW ) expression SEMICOLON
  +
  +#    register_name LEQ expression SEMICOLON
   
       rule Typeclass: VAR
   
  
positive.code:         | let_statement
  
      rule goal:
          (top_level_statements)* END
  
  %%
  ############jca
  
negative.code: 
      # A factor is the product and division of terms
      rule factor<<V>>: term<<V>>           {{ v = term }}
                       ( STAR term<<V>>    {{ v = v*term }}
                       |  "/"  term<<V>>    {{ v = v/term }}
                       |  CARET  term<<V>>
                       |  LESS  term<<V>>
                       |  ">"  term<<V>>
                       |  LESSLESS  term<<V>>
                       |  ">>"  term<<V>>
                       |  EQEQ  term<<V>>
                       |  "!="  term<<V>>
                       |  QUESTION term<<V>> COLON  term<<V>>
                       )*                   {{ return v }}
  
      rule fieldname: VAR
  
      rule typefieldname: VAR
  
      rule call_arg:
          ( expr<<[]>>
          | QUESTION
          )
      # A term is a number, variable, or an expression surrounded by parentheses
      rule term<<V>>:
                 case_value
                 | NUM  [ "\\'b" NUM ]      {{ return int(NUM) }}
                 | VAR 
                      ( DOT fieldname )*
                      [ HASH ]
                      [   ( LPAREN [ call_arg ( COMMA call_arg )* ] RPAREN
                          | LBRACE typefieldname COLON expr<<V>> ( COMMA typefieldname COLON expr<<V>> )* RBRACE
                          )
                      ]
                      [ LBRACKET expr<<V>> [ COLON expr<<V>> ] RBRACKET ]
                      {{ return lookup(V, VAR) }}
                 | STR
                 | LPAREN expr<<V>> RPAREN ( DOT fieldname )*
                      [ LBRACKET expr<<V>> [ COLON expr<<V>> ] RBRACKET ]
                      {{ return expr }}
                 | LBRACE expr<<V>> ( COMMA expr<<V>> )* RBRACE
  
                 #| "let" VAR EQUAL expr<<V>>  {{ V = [(VAR, expr)] + V }}
                 #  "in" expr<<V>>           {{ return expr }}
  
  ###########jca
  