correction bug Op
This commit is contained in:
@@ -67,8 +67,8 @@ expression [SymTable table] returns [Type return_Type, Expression out]:
|
||||
(op=(PLUS | MINUS) right=td_expression[table] {
|
||||
$out = new BinopExpression(
|
||||
switch($op.getType()) {
|
||||
case PLUS -> PLUS;
|
||||
case MINUS -> MINUS;
|
||||
case PLUS -> Op.PLUS;
|
||||
case MINUS -> Op.MINUS;
|
||||
default -> throw new IllegalArgumentException("Unknown operator");
|
||||
},
|
||||
$left.out,
|
||||
@@ -86,8 +86,8 @@ td_expression [SymTable table] returns [Type return_Type, Expression out]:
|
||||
(op=(TIMES | DIV) right=lit {
|
||||
$out = new Program.BinopExpression(
|
||||
switch($op.getType()) {
|
||||
case TIMES -> TIMES;
|
||||
case DIV -> DIV;
|
||||
case TIMES -> Op.TIMES;
|
||||
case DIV -> Op.DIV;
|
||||
default -> throw new IllegalArgumentException("Unknown operator");
|
||||
},
|
||||
$left.out,
|
||||
|
||||
Reference in New Issue
Block a user