git @ Cat's Eye Technologies Tamsin / master eg / alg-expr1.tamsin
master

Tree @master (Download .tar.gz)

alg-expr1.tamsin @masterraw · history · blame

1
2
3
4
5
6
7
# This example Tamsin program was written by Chris Pressey, and is
# hereby placed in the public domain.  It comes with NO WARRANTY.

main = (expr0 & eof & 'ok').
expr0 = expr1 & {"+" & expr1}.
expr1 = term & {"*" & term}.
term = "x" | "y" | "z" | "(" & expr0 & ")".