Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

No Format
e   :   e '^' e // right associative
    |   e '*' e
    |   '++' e
    |   '-' e
    |   e ('-' e
    |   e '+'+'|'-') e
    |   e '.' ID
    |   e '[' e ']'
    |   e '(' e (',' e)* ')'
    |   e '++'
    |   '(' e ')'
    |   INT
    |   ID
    ;

...

No Format
e   :   e '^' e // right associative
    |   e '*' e
    |   unary
    |   e ('-' e
    |   e '+'+'|'-') e
    |   e '.' ID
    |   suffix
    |   primary
    ;

unary:  '++' e
    |   '-' e
    ;

suffix
    :   e '[' e ']'
    |   e '(' e (',' e)* ')'
    |   e '++'
    ;

primary
    :   '(' e ')'
    |   INT
    |   ID
    ;

once I had identified these elements, I could generate something like the following:

...