Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: toy/fl/concrete/antlr/extracted
Source used for this grammar: Ralf Lämmel, FL.g
, 17 May – 16 July 2008 [GitHub]
program
, function
, expr
, binary
, apply
, ifThenElse
, atom
, ops
), 0 root (—), 1 top (program
), 3 bottom (ID
4, NEWLINE
, INT
).[f]
, [n]
, [a]
3, [e]
2, [b]
, [i]
2, [l]
, [o]
, [r]
, [c]
, [e1]
, [e2]
.program ::=
[f]::function
function ::= [n]::ID [a]::ID"=" [e]::expr NEWLINE
expr ::= [b]::binary [a]::apply [i]::ifThenElse
binary ::= [l]::atom[o]::ops [r]::atom
apply ::=
[i]::ID [a]::atom
ifThenElse ::= "if" [c]::expr "then" [e1]::expr "else" [e2]::expr
atom ::= ID INT "(" [e]::expr ")"
ops ::= "==" "+" "-"