

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


::= [, ] | ::= | (; ) ::= {} | ::= x | y | z
::= | ::= | ::= | ::= 0 | 1 | ... | 9 ::= + | -
::= a b b | empty
::= | | empty ::= a b | empty ::= a b b | empty
::= | ::= a b | ::= a | a ::= a b b | ::= b | b
::= if then else | begin | print ::= end | ; ::= 0 | 1
if 1 then if 0 then if 1 then if 0 then if 1 then print 1 else print 0 else print 1 else print 0 else begin print 0 end else print 0
begin print 1; if 1 then begin print 1; begin print 0; end; print 0; end else print 1; end
S ::= [{empty}] | id := [expr] expr (+|-) [{[expr]}] | if expr then S [S] {;S} {elseif expr then {S;}S } [ else {S;S} S] end | loop [S[[S]]]S{;S} end | while expr do S {;S} {;S} [S] end