SYNOPSIS
Compile this grammar with
eyapp -b '' -B '' Calc.eyp
Run it with:
./Calc.pm -t -i -c 'a = 2*3'
You'll get an output like this:
ASSIGN(VAR[a],TIMES(NUM[2],NUM[3]))
If you want to produce a YAML description of the AST use the option -y:
$ ./Calc.pm -y -c 'b = 2+a'
--- !!perl/hash:ASSIGN
children:
- !!perl/hash:VAR
attr: b
children: []
token: VAR
- !!perl/hash:PLUS
children:
- !!perl/hash:NUM
attr: 2
children: []
token: NUM
- !!perl/hash:VAR
attr: a
children: []
token: VAR
Run ./Calc.pm -h to get this help.