Present Terminals

Grammar Rules

For a grammar like: with:

  • as a non-terminal
  • as a non-terminal or terminal
expr := INT
  { $$ = new IntegerLiteral(@1, $1); };
  • First line is the grammar rule, where we produce an int token
  • $$ is the result of the production rule
  • @1 is the source location of
  • $1 is the value of , here INT