Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: toy/fl/concrete/python/extracted
Source used for this grammar: Ruwen Hahn, parser.py
, 13 Jul 2008 [GitHub]
_Literal
, _IF
, _THEN
, _ELSE
, name
, literal
, atom
, ifThenElse
, operators
, binary
, apply
, expr
, function
, program
), 0 root (—), 2 top (_Literal
, program
), 2 bottom (Literal
, StringEnd
)._Literal ::= Literal
_IF ::=
"if"
_THEN ::=
"then"
_ELSE ::=
"else"
name ::= string
literal ::= "-" integer
atom ::= name literal "(" expr ")"
ifThenElse ::= _IF expr _THEN expr _ELSE expr
operators ::= "==" "+" "-"
binary ::= atomoperators atom
apply ::=
name atom
expr ::= binary apply ifThenElse
function ::= name name"=" expr
program ::=
function
StringEnd