@@ -17,7 +17,7 @@ ExpAdRF ::= ExpAdR | "λ"
1717ExpAdR ::= OpAd ExpMul ExpAdRF
1818ExpAd ::= ExpMul ExpAdRF
1919ExpAndF ::= ExpAndR | "λ"
20- ExpAndR ::= "&&" {st.expWrapBin(List.of("&&" ))} ExpEq ExpAndF
20+ ExpAndR ::= "&&" {st.expWrapBin(List.of(v_0 ))} ExpEq ExpAndF
2121ExpAnd ::= ExpEq ExpAndF
2222ExpEqRF ::= ExpEqR | "λ"
2323ExpEqR ::= OpEq {st.expWrapBin(v_0)} ExpRel ExpEqRF
@@ -26,7 +26,7 @@ ExpMulF ::= ExpMulR | "λ"
2626ExpMulR ::= OpMul ExpUn ExpMulF
2727ExpMul ::= ExpUn ExpMulF
2828ExpOrF ::= ExpOrR | "λ"
29- ExpOrR ::= "||" {st.expWrapBin(List.of("||" ))} ExpAnd ExpOrF
29+ ExpOrR ::= "||" {st.expWrapBin(List.of(v_0 ))} ExpAnd ExpOrF
3030ExpOr ::= ExpAnd ExpOrF
3131ExpRelF ::= OpRel {st.expWrapBin(v_0)} ExpAd | "λ"
3232ExpRel ::= ExpAd ExpRelF
@@ -68,7 +68,13 @@ StmtFFF ::= "λ" | "ELSE" {st.ifElse()} Stmt
6868StmtF ::= ";" | ExpOr ";"
6969Stmt_starF ::= Stmt_star | "λ"
7070Stmt_star ::= Stmt Stmt_starF
71- Stmt ::= "{" MethodF | {st.newIf()} "IF" "(" ExpOr ")" {st.ifBlock()} Stmt StmtFFF {st.end()} | {st.newReturn()} "RETURN" StmtF {st.end()} | {st.newEmpty()} ";" {st.end()} | {st.newAssign()} Assign ";" {st.end()} | {st.newExpr()} "(" ExpOr ")" ";" {st.end()} | {st.newWhile()} "WHILE" "(" ExpOr ")"{st.whileBody()} Stmt {st.end()}
71+ Stmt ::= "{" MethodF \
72+ | {st.newIf()} "IF" "(" ExpOr ")" {st.ifBlock()} Stmt StmtFFF {st.end()} \
73+ | {st.newReturn()} "RETURN" StmtF {st.end()} \
74+ | {st.newEmpty()} ";" {st.end()} \
75+ | {st.newAssign()} Assign ";" {st.end()} \
76+ | {st.newExpr()} "(" ExpOr ")" ";" {st.end()} \
77+ | {st.newWhile()} "WHILE" "(" ExpOr ")"{st.whileBody()} Stmt {st.end()}
7278Type ::= PrimType {!v_0} | "CLASS_ID" {!} | "ARRAY" PrimType {!Utils.concat(v_0, v_1)}
7379VarF ::= "λ" | Chain | "[" ExpOr "]"
7480VarsF ::= "λ" {!List.of()} | "," Vars {!v_1}
0 commit comments