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