-- ordinary rules
+
+True. Bool ::= "true" ;
+False. Bool ::= "false" ;
+
+TInt. Type ::= "int" ;
+TBool. Type ::= "bool" ;
+
Program. Stms ::= [Stm] ;
-SExp. Stm ::= Exp ";" ;
-SBlock. Stm ::= "{" [Stm] "}" ;
-SDecl. Stm ::= Type Ident "=" Exp ";" ;
-decl. Stm ::= Type Ident ";" ;
-define decl t v = SDecl t v EDefault ;
+SExp. Stm ::= Exp ";" ;
+SBlock. Stm ::= "{" [Stm] "}" ;
+declIntE. Stm ::= "int" Ident "=" Exp ";" ;
+declBoolE. Stm ::= "bool" Ident "=" Exp ";" ;
+define declIntE x e = SDecl TInt x e;
+define declBoolE x e = SDecl TBool x e;
+declInt. Stm ::= "int" Ident ";" ;
+declBool. Stm ::= "bool" Ident ";" ;
+define declInt x = SDecl TInt x (EInt 0);
+define declBool x = SDecl TBool x (EBool False);
+
SWhile. Stm ::= "while" "(" Exp ")" Stm ;
SIf. Stm ::= "if" "(" Exp ")" Stm "else" Stm ;
_. Op ::= Op0;
-True. Bool ::= "true" ;
-False. Bool ::= "false" ;
-
-TInt. Type ::= "int" ;
-TBool. Type ::= "bool" ;
-
-- pragmas
-internal ExpT. Exp ::= Type Exp ;
-internal SNoop. Stm ::= ;
-internal EDefault. Exp ::= ;
+-- internal ExpT. Exp ::= Type Exp ;
+-- internal EDefault. Exp ::= ;
internal BiOpExp. Exp ::= Exp Op Exp ;
-internal NoType. Type ::= ;
+-- internal NoType. Type ::= ;
internal EPost. Exp ::= Ident Op1 ;
+internal SNoop. Stm ::= ;
+internal SDecl. Stm ::= Type Ident "=" Exp ";" ;
+
comment "/*" "*/" ;
comment "//" ;