|
|
@ -403,7 +403,7 @@ literal ::= NONE:n {: RESULT = new NoneLi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* expr */
|
|
|
|
/* expr */
|
|
|
|
expr ::= pexpr:ce {: RESULT = ce; :}
|
|
|
|
expr ::= cexpr:ce {: RESULT = ce; :}
|
|
|
|
| NOT:n expr:exp {: RESULT = new UnaryExpr(nxleft, expxright, n, exp); :}
|
|
|
|
| NOT:n expr:exp {: RESULT = new UnaryExpr(nxleft, expxright, n, exp); :}
|
|
|
|
| expr:e1 AND:a expr:e2 {: RESULT = new BinaryExpr(e1xleft, e2xright, e1, a, e2); :}
|
|
|
|
| expr:e1 AND:a expr:e2 {: RESULT = new BinaryExpr(e1xleft, e2xright, e1, a, e2); :}
|
|
|
|
| expr:e1 OR:o expr:e2 {: RESULT = new BinaryExpr(e1xleft, e2xright, e1, o, e2); :}
|
|
|
|
| expr:e1 OR:o expr:e2 {: RESULT = new BinaryExpr(e1xleft, e2xright, e1, o, e2); :}
|
|
|
@ -412,29 +412,23 @@ expr ::= pexpr:ce {: RESULT = ce; :}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* cexpr */
|
|
|
|
/* cexpr */
|
|
|
|
/*
|
|
|
|
cexpr ::= pexpr:pe {: RESULT = pe; :}
|
|
|
|
cexpr ::= pexpr:pe {: RESULT = new Expr(pexleft, pexright); :}
|
|
|
|
| pexpr:p1 comp_op:co cexpr:p2 {: RESULT = new BinaryExpr(p1xleft, p2xright, p1, co.value, p2); :}
|
|
|
|
| cmp_pexpr:cp {: RESULT = new Expr(cpxleft, cpxright); :}
|
|
|
|
|
|
|
|
;
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmp_pexpr ::= pexpr:p comp_op:co cmp_pexpr:p2 {: RESULT = new BinaryExpr(p1xleft, p2xright, p1, co, p2); :}
|
|
|
|
|
|
|
|
| pexpr:p {: RESULT = new Expr(pxleft, pxright); :}
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* pexpr */
|
|
|
|
/* pexpr */
|
|
|
|
pexpr ::= identifier:id {: RESULT = id; :}
|
|
|
|
pexpr ::= identifier:id {: RESULT = id; :}
|
|
|
|
| literal:l {: RESULT = l; :}
|
|
|
|
| literal:l {: RESULT = l; :}
|
|
|
|
| LBR:lbr expr_list:l RBR:rbr {: RESULT = new ListExpr(lbrxleft, rbrxright, l); :}
|
|
|
|
| LBR:lbr expr_list:l RBR:rbr {: RESULT = new ListExpr(lbrxleft, rbrxright, l); :}
|
|
|
|
| LPAR:lpar expr:e RPAR:rpar {: RESULT = e; :}
|
|
|
|
| LPAR:lpar expr:e RPAR:rpar {: RESULT = e; :}
|
|
|
|
| member_expr:m {: RESULT = m; :}
|
|
|
|
| member_expr:m {: RESULT = m; :}
|
|
|
|
| index_expr:i {: RESULT = i; :}
|
|
|
|
| index_expr:i {: RESULT = i; :}
|
|
|
|
| member_expr:m LPAR expr_list:l RPAR:rpar {: RESULT = new MethodCallExpr(mxleft, rparxright, m, l); :}
|
|
|
|
| member_expr:m LPAR expr_list:l RPAR:rpar {: RESULT = new MethodCallExpr(mxleft, rparxright, m, l); :}
|
|
|
|
| identifier:id LPAR expr_list:l RPAR:rpar {: RESULT = new CallExpr(idxleft, rparxright, id, l); :}
|
|
|
|
| identifier:id LPAR expr_list:l RPAR:rpar {: RESULT = new CallExpr(idxleft, rparxright, id, l); :}
|
|
|
|
| pexpr:p1 bin_op:bo pexpr:p2 {: RESULT = new BinaryExpr(p1xleft, p2xright, p1, bo.value, p2); :}
|
|
|
|
| pexpr:p1 bin_op:bo pexpr:p2 {: RESULT = new BinaryExpr(p1xleft, p2xright, p1, bo.value, p2); :}
|
|
|
|
| MINUS:m pexpr:p {: RESULT = new UnaryExpr(mxleft, pxright, m, p); :}
|
|
|
|
| MINUS:m pexpr:p {: RESULT = new UnaryExpr(mxleft, pxright, m, p); :}
|
|
|
|
| pexpr:p1 comp_op:co pexpr:p2 {: RESULT = new BinaryExpr(p1xleft, p2xright, p1, co.value, p2); :}
|
|
|
|
|
|
|
|
;
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
expr_list ::= expr:e {: RESULT = single(e); :}
|
|
|
|
expr_list ::= expr:e {: RESULT = single(e); :}
|
|
|
|