Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PDefs. Program ::= [Def] ;
- terminator Def "" ;
- DFun. Def ::= Type UIdent "(" [Arg] ")" "{" [Stm] "}" ;
- separator Arg "," ;
- terminator Stm "" ;
- ADecl. Arg ::= Type UIdent ;
- SExp. Stm ::= Exp ";" ;
- SDecl. Stm ::= Type UIdent ";" ;
- SDecls. Stm ::= Type UIdent "," [UIdent] ";" ;
- SInit. Stm ::= Type UIdent "=" Exp ";" ;
- SReturn. Stm ::= "return" Exp ";" ;
- SWhile. Stm ::= "while" "(" Exp ")" Stm ;
- SFor. Stm ::= "for" Exp "to" Exp "do" Stm ;
- SPass. Stm ::= "pass" ";";
- SBlock. Stm ::= "{" [Stm] "}" ;
- SIfElse. Stm ::= "if" "(" Exp ")" Stm "else" Stm ;
- SPrint. Stm ::= "Print" "(" Exp ")" ";";
- token UIdent (letter (letter|digit|'_')*) ;
- terminator UIdent "" ;
- EInt. Exp13 ::= Integer ;
- ETrue. Exp13 ::= "True" ;
- EFalse. Exp13 ::= "False" ;
- EId. Exp13 ::= UIdent ;
- EApp. Exp13 ::= UIdent "(" [Exp] ")" ;
- ETimes. Exp12 ::= Exp12 "*" Exp13 ;
- EDiv. Exp12 ::= Exp12 "/" Exp13 ;
- EPlus. Exp11 ::= Exp11 "+" Exp12 ;
- EMinus. Exp11 ::= Exp11 "-" Exp12 ;
- ELt. Exp9 ::= Exp9 "<" Exp10 ;
- EGt. Exp9 ::= Exp9 ">" Exp10 ;
- ELtEq. Exp9 ::= Exp9 "<=" Exp10 ;
- EGtWq. Exp9 ::= Exp9 ">=" Exp10 ;
- EEq. Exp8 ::= Exp8 "==" Exp9 ;
- ENEq. Exp8 ::= Exp8 "!=" Exp9 ;
- EAnd. Exp4 ::= Exp4 "and" Exp5 ;
- EOr. Exp3 ::= Exp3 "or" Exp4 ;
- EAss. Exp2 ::= Exp3 "=" Exp2 ;
- coercions Exp 13 ;
- separator Exp "," ;
- Tbool. Type ::= "Bool" ;
- Tint. Type ::= "Int" ;
- Tvoid. Type ::= "void" ;
- comment "#" ;
- comment "/*" "*/" ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement