1
0
mirror of https://github.com/PDP-10/its.git synced 2026-01-18 09:12:08 +00:00
PDP-10.its/src/c/expr2.grammr
Lars Brinkhoff aec62f3117 Edit SAIL files to be like the originals from ITS.
Rename according to SAIL file C.LIB[C,SYS].  Fix E stuff and remove
trailing ^C and ^@s.
2018-10-30 08:36:56 +01:00

18 lines
276 B
Plaintext

'+' '-' '*' '/' '(' ')' int
\< '+' '-'
\< '*' '/'
\\
s: e {printf (1, "%d\n",#1);}
e: e '+' e {val = #1 + #3;}
| e '-' e {val = #1 - #3;}
| e '*' e {val = #1 * #3;}
| e '/' e {val = #1 / #3;}
| p
p: '-' p {val = - #2;}
| '(' e ')' {val = #2;}
| int