mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-28 17:08:03 +00:00
minor generator changes
This commit is contained in:
parent
c2ce7ff80f
commit
535c712421
@ -37,16 +37,13 @@ public class ExpressionGenerator extends DecafBaseVisitor<Expression> {
|
||||
@Override
|
||||
public Expression visitExpression(DecafParser.ExpressionContext ctx) {
|
||||
//ParseTree for ( expr )
|
||||
//Just pass it down to the inner expr:
|
||||
// pass it down to the inner expr:
|
||||
return this.visit(ctx.expr());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression visitIdentifier(DecafParser.IdentifierContext ctx){
|
||||
Boolean isField = false;
|
||||
if(ctx.fieldId().THIS() != null){
|
||||
isField = true;
|
||||
}
|
||||
boolean isField = ctx.fieldId().THIS() != null;
|
||||
Expression recipient = null;
|
||||
if(ctx.fieldId().recipient() != null){
|
||||
List<DecafParser.RecipientContext> recipientList = ctx.fieldId().recipient();
|
||||
@ -89,10 +86,7 @@ public class ExpressionGenerator extends DecafBaseVisitor<Expression> {
|
||||
|
||||
@Override
|
||||
public Expression visitMethodCall(DecafParser.MethodCallContext ctx) {
|
||||
Boolean isField = false;
|
||||
if(ctx.methCall().THIS() != null){
|
||||
isField = true;
|
||||
}
|
||||
boolean isField = ctx.methCall().THIS() != null;
|
||||
Expression recipient = null;
|
||||
if(ctx.methCall().recipient() != null){
|
||||
List<DecafParser.RecipientContext> recipientList = ctx.methCall().recipient();
|
||||
|
@ -77,14 +77,11 @@ public class StatementGenerator extends DecafBaseVisitor<Statement> {
|
||||
//StatementExpression
|
||||
@Override
|
||||
public Statement visitMethodCall(DecafParser.MethodCallContext ctx) {
|
||||
Boolean isField = false;
|
||||
if(ctx.methCall().THIS() != null){
|
||||
isField = true;
|
||||
}
|
||||
boolean isField = ctx.methCall().THIS() != null;
|
||||
Expression recipient = null;
|
||||
if(ctx.methCall().recipient() != null){
|
||||
List<DecafParser.RecipientContext> recipientList = ctx.methCall().recipient();
|
||||
recipient = new ExpressionGenerator().generateRecipient(recipientList, null);
|
||||
recipient = ExpressionGenerator.generateRecipient(recipientList, null);
|
||||
}
|
||||
Id id = new Id(ctx.methCall().methName().id().getText());
|
||||
List<Expression> args = new ArrayList<>();
|
||||
|
Loading…
Reference in New Issue
Block a user