Versions Compared

Key

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

...

No Format
e   :   primary
    |   primary '^' e // right associative
    |   e '*++' e
    |   ('++'|'-') e
    |   e ('+'|'-') esuffix
    |  | e '*' suffixe
    |   e ('++'|'-') e
    ;

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

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

...

No Format
e   :   primary
    |   exponent
    |   e '*' e
    |   ('++'|'-')
e     |   e ('++'|'-') e
    |   e '.' ID // higher than array/method call
    |   suffix
    |   e '*' e
    |   e ('++''|'-') e
    ;

exponent
options {associativity = right;}
    :   e '^' e
    ;

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

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

...