Additive Expression implementieren
This commit is contained in:
parent
ed3a3909c0
commit
c747ab0885
@ -599,8 +599,8 @@ public class StatementGenerator {
|
||||
}
|
||||
|
||||
private BinaryExpr.Operator convertBinaryOperator(String operator) {
|
||||
|
||||
return null;
|
||||
//return BinaryExpr.Operator.ADD;
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private Expression convert(Java8Parser.ShiftExpressionContext expression) {
|
||||
@ -612,12 +612,15 @@ public class StatementGenerator {
|
||||
}
|
||||
|
||||
private Expression convert(Java8Parser.AdditiveExpressionContext expression) {
|
||||
if(expression.additiveExpression() != null){
|
||||
return convert(expression.additiveExpression());
|
||||
}else if(expression.multiplicativeExpression() != null){
|
||||
|
||||
if(expression.additiveExpression() == null){
|
||||
return convert(expression.multiplicativeExpression());
|
||||
}else {
|
||||
throw new NotImplementedException();
|
||||
Expression leftSide = convert(expression.additiveExpression());
|
||||
Expression rightSide = convert(expression.multiplicativeExpression());
|
||||
BinaryExpr.Operator op = convertBinaryOperator(expression.getChild(1).getText());
|
||||
Token offset = expression.getStart();
|
||||
return new BinaryExpr(op, TypePlaceholder.fresh(expression.getStart()), leftSide, rightSide, offset);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user