X-Git-Url: https://ruin.nu/git/?p=proglang.git;a=blobdiff_plain;f=syntax.cf;h=dc7e65960cacd24d1430ed90c02bf9ba07c69c8a;hp=fae1234c287f73180e784eb039d7a68169a81bb8;hb=33370917adde77f98b0955843b3222d9838a3fe8;hpb=b33c4977fff6bad375551eaf4fed0aa06daf1c88 diff --git a/syntax.cf b/syntax.cf index fae1234..dc7e659 100644 --- a/syntax.cf +++ b/syntax.cf @@ -16,6 +16,7 @@ SWhile. Stm ::= "while" "(" Exp ")" Stm ; -- SFor. Stm ::= "for" "(" Stm Exp ";" Exp ")" Stm ; SPrint. Stm ::= "print" Exp ";" ; +EAss. Exp ::= Ident "=" Exp; BExp. Exp ::= Exp1 BOp Exp1 ; op1. Exp1 ::= Exp1 Op1 Exp2 ; define op1 e1 o e2 = OpExp e1 o e2 ; @@ -26,7 +27,6 @@ define postIncr i = EPost i Plus ; postDecr. Exp3 ::= Ident "--" ; define postDecr i = EPost i Minus ; EVar. Exp3 ::= Ident ; -EAss. Exp3 ::= Ident "=" Exp; EInt. Exp3 ::= Integer ; ENeg. Exp3 ::= "-" Exp3 ; EBool. Exp3 ::= Bool ; @@ -36,7 +36,7 @@ EReadB. Exp3 ::= "readBool" ; coercions Exp 3 ; -_. Stm ::= Stm ";" ; +-- _. Stm ::= Stm ";" ; terminator Stm "" ;