mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-28 01:38:03 +00:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
f4475ae7c6
@ -47,9 +47,11 @@ public class ExpressionGenerator extends DecafBaseVisitor<Expression> {
|
|||||||
if (ctx.fieldVarAccess().recipient() != null) {
|
if (ctx.fieldVarAccess().recipient() != null) {
|
||||||
List<DecafParser.RecipientContext> recipientList = ctx.fieldVarAccess().recipient();
|
List<DecafParser.RecipientContext> recipientList = ctx.fieldVarAccess().recipient();
|
||||||
recipient = ExpressionGenerator.generateRecursiveOwnerChain(recipientList, ctx.fieldVarAccess().newCall() != null ? StatementGenerator.generateNew(ctx.fieldVarAccess().newCall()) : null, isField);
|
recipient = ExpressionGenerator.generateRecursiveOwnerChain(recipientList, ctx.fieldVarAccess().newCall() != null ? StatementGenerator.generateNew(ctx.fieldVarAccess().newCall()) : null, isField);
|
||||||
return new FieldVarAccess(true, recipient, ctx.fieldVarAccess().id().IDENTIFIER().getText());
|
|
||||||
}
|
}
|
||||||
return new FieldVarAccess(isField, recipient, ctx.fieldVarAccess().id().IDENTIFIER().getText());
|
if (recipient == null) {
|
||||||
|
return new FieldVarAccess(isField, null, ctx.fieldVarAccess().id().IDENTIFIER().getText());
|
||||||
|
}
|
||||||
|
return new FieldVarAccess(true, recipient, ctx.fieldVarAccess().id().IDENTIFIER().getText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Expression generateConstant(DecafParser.LiteralContext ctx) {
|
public static Expression generateConstant(DecafParser.LiteralContext ctx) {
|
||||||
|
@ -105,9 +105,12 @@ public class StatementGenerator extends DecafBaseVisitor<List<Statement>> {
|
|||||||
Expression recipient = null;
|
Expression recipient = null;
|
||||||
if (fieldIdContext.recipient() != null) {
|
if (fieldIdContext.recipient() != null) {
|
||||||
recipient = ExpressionGenerator.generateRecursiveOwnerChain(fieldIdContext.recipient(), null, isField);
|
recipient = ExpressionGenerator.generateRecursiveOwnerChain(fieldIdContext.recipient(), null, isField);
|
||||||
return new FieldVarAccess(true, recipient, fieldIdContext.id().IDENTIFIER().getText());
|
|
||||||
}
|
}
|
||||||
return new FieldVarAccess(isField, recipient, fieldIdContext.id().IDENTIFIER().getText());
|
if (recipient == null) {
|
||||||
|
return new FieldVarAccess(isField, null, fieldIdContext.id().IDENTIFIER().getText());
|
||||||
|
}
|
||||||
|
return new FieldVarAccess(true, recipient, fieldIdContext.id().IDENTIFIER().getText());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -130,9 +133,11 @@ public class StatementGenerator extends DecafBaseVisitor<List<Statement>> {
|
|||||||
if (ctx.methCall().recipient() != null) {
|
if (ctx.methCall().recipient() != null) {
|
||||||
List<DecafParser.RecipientContext> recipientList = ctx.methCall().recipient();
|
List<DecafParser.RecipientContext> recipientList = ctx.methCall().recipient();
|
||||||
recursiveOwnerChain = ExpressionGenerator.generateRecursiveOwnerChain(recipientList, ctx.methCall().newCall() != null ? generateNew(ctx.methCall().newCall()) : null, isField);
|
recursiveOwnerChain = ExpressionGenerator.generateRecursiveOwnerChain(recipientList, ctx.methCall().newCall() != null ? generateNew(ctx.methCall().newCall()) : null, isField);
|
||||||
return List.of(new MethodCall(new FieldVarAccess(true, recursiveOwnerChain, ctx.methCall().methName().id().IDENTIFIER().getText()), args));
|
|
||||||
}
|
}
|
||||||
return List.of(new MethodCall(new FieldVarAccess(isField, recursiveOwnerChain, ctx.methCall().methName().id().IDENTIFIER().getText()), args));
|
if (recursiveOwnerChain == null) {
|
||||||
|
return List.of(new MethodCall(new FieldVarAccess(isField, null, ctx.methCall().methName().id().IDENTIFIER().getText()), args));
|
||||||
|
}
|
||||||
|
return List.of(new MethodCall(new FieldVarAccess(true, recursiveOwnerChain, ctx.methCall().methName().id().IDENTIFIER().getText()), args));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user