Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: toy/pico/unknown/sdf/extracted
Source used for this grammar: Jurgen Vinju, Pico.sdf
, Identifiers.sdf
, Types.sdf
, February 2006 – September 2007
PROGRAM
, DECLS
, ID-TYPE
, STATEMENT
, EXP
, TYPE
), 0 root (—), 1 top (PROGRAM
), 3 bottom (StrCon
, PICO-ID
3, NatCon
).PROGRAM ::= "begin" DECLS STATEMENT ";" STATEMENT "end"
DECLS ::= "declare" ID-TYPE "," ID-TYPE ";"
ID-TYPE ::=
PICO-ID ":" TYPE
STATEMENT ::=
PICO-ID ":=" EXP
STATEMENT ::= "if" EXP "then" STATEMENT ";" STATEMENT "else" STATEMENT ";" STATEMENT "fi"
STATEMENT ::= "while" EXP "do" STATEMENT ";" STATEMENT "od"
EXP ::= PICO-ID
EXP ::= NatCon
EXP ::= StrCon
EXP ::=
EXP "+" EXP
EXP ::=
EXP "-" EXP
EXP ::=
EXP "||" EXP
EXP ::= "(" EXP ")"
TYPE ::=
"natural"
TYPE ::=
"string"
TYPE ::=
"nil-type"