correction bug Op
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
// Generated from /home/tuanvu/Desktop/M1/S8/PDS/tp2-vsl-pds/src/main/antlr/VSLLexer.g by ANTLR 4.13.1
|
// Generated from c:/Users/Thibaut/Documents/Git/PDS/tp2-vsl-pds/src/main/antlr/VSLLexer.g by ANTLR 4.13.1
|
||||||
|
|
||||||
package TP2;
|
package TP2;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Generated from /home/tuanvu/Desktop/M1/S8/PDS/tp2-vsl-pds/src/main/antlr/VSLParser.g by ANTLR 4.13.1
|
// Generated from c:/Users/Thibaut/Documents/Git/PDS/tp2-vsl-pds/src/main/antlr/VSLParser.g by ANTLR 4.13.1
|
||||||
|
|
||||||
package TP2;
|
package TP2;
|
||||||
import TP2.asd.Program.*;
|
import TP2.asd.Program.*;
|
||||||
@@ -383,8 +383,8 @@ public class VSLParser extends Parser {
|
|||||||
|
|
||||||
((ExpressionContext)_localctx).out = new BinopExpression(
|
((ExpressionContext)_localctx).out = new BinopExpression(
|
||||||
switch(((ExpressionContext)_localctx).op.getType()) {
|
switch(((ExpressionContext)_localctx).op.getType()) {
|
||||||
case PLUS -> PLUS;
|
case PLUS -> Op.PLUS;
|
||||||
case MINUS -> MINUS;
|
case MINUS -> Op.MINUS;
|
||||||
default -> throw new IllegalArgumentException("Unknown operator");
|
default -> throw new IllegalArgumentException("Unknown operator");
|
||||||
},
|
},
|
||||||
((ExpressionContext)_localctx).left.out,
|
((ExpressionContext)_localctx).left.out,
|
||||||
@@ -476,8 +476,8 @@ public class VSLParser extends Parser {
|
|||||||
|
|
||||||
((Td_expressionContext)_localctx).out = new Program.BinopExpression(
|
((Td_expressionContext)_localctx).out = new Program.BinopExpression(
|
||||||
switch(((Td_expressionContext)_localctx).op.getType()) {
|
switch(((Td_expressionContext)_localctx).op.getType()) {
|
||||||
case TIMES -> TIMES;
|
case TIMES -> Op.TIMES;
|
||||||
case DIV -> DIV;
|
case DIV -> Op.DIV;
|
||||||
default -> throw new IllegalArgumentException("Unknown operator");
|
default -> throw new IllegalArgumentException("Unknown operator");
|
||||||
},
|
},
|
||||||
((Td_expressionContext)_localctx).left.out,
|
((Td_expressionContext)_localctx).left.out,
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ expression [SymTable table] returns [Type return_Type, Expression out]:
|
|||||||
(op=(PLUS | MINUS) right=td_expression[table] {
|
(op=(PLUS | MINUS) right=td_expression[table] {
|
||||||
$out = new BinopExpression(
|
$out = new BinopExpression(
|
||||||
switch($op.getType()) {
|
switch($op.getType()) {
|
||||||
case PLUS -> PLUS;
|
case PLUS -> Op.PLUS;
|
||||||
case MINUS -> MINUS;
|
case MINUS -> Op.MINUS;
|
||||||
default -> throw new IllegalArgumentException("Unknown operator");
|
default -> throw new IllegalArgumentException("Unknown operator");
|
||||||
},
|
},
|
||||||
$left.out,
|
$left.out,
|
||||||
@@ -86,8 +86,8 @@ td_expression [SymTable table] returns [Type return_Type, Expression out]:
|
|||||||
(op=(TIMES | DIV) right=lit {
|
(op=(TIMES | DIV) right=lit {
|
||||||
$out = new Program.BinopExpression(
|
$out = new Program.BinopExpression(
|
||||||
switch($op.getType()) {
|
switch($op.getType()) {
|
||||||
case TIMES -> TIMES;
|
case TIMES -> Op.TIMES;
|
||||||
case DIV -> DIV;
|
case DIV -> Op.DIV;
|
||||||
default -> throw new IllegalArgumentException("Unknown operator");
|
default -> throw new IllegalArgumentException("Unknown operator");
|
||||||
},
|
},
|
||||||
$left.out,
|
$left.out,
|
||||||
|
|||||||
Reference in New Issue
Block a user