This commit is contained in:
laurenz 2024-05-08 10:08:52 +02:00
commit 258819d70f
4 changed files with 1 additions and 24 deletions

View File

@ -24,7 +24,6 @@ stmt : 'if' '(' expr ')' block ('else' block)? #If
| 'return' expr ';' #Return
| 'return' ';' #ReturnVoid
| 'break' ';' #Break
| 'continue' ';' #Continue
| assign ';' #Assignment
| stmtexpr ';' #StatementExpressionstmt
;

View File

@ -61,11 +61,6 @@ public class StatementGenerator extends DecafBaseVisitor<Statement> {
return new Break();
}
@Override
public Statement visitContinue(DecafParser.ContinueContext ctx) {
return new Continue();
}
@Override
public Statement visitAssignment(DecafParser.AssignmentContext ctx) {
return generateAssign(ctx.assign());

View File

@ -1,5 +0,0 @@
package de.maishai.ast.records;
public record Continue() implements Statement {
}

View File

@ -1,16 +1,4 @@
package de.maishai.ast.records;
import de.maishai.ast.records.Break;
import de.maishai.ast.records.Continue;
import de.maishai.ast.records.DoWhile;
import de.maishai.ast.records.For;
import de.maishai.ast.records.IfElse;
import de.maishai.ast.records.MethodCall;
import de.maishai.ast.records.New;
import de.maishai.ast.records.Node;
import de.maishai.ast.records.Return;
import de.maishai.ast.records.ReturnVoid;
import de.maishai.ast.records.While;
public sealed interface Statement extends Node permits Assignment, Break, Continue, DoWhile, For, IfElse, MethodCall, New, Return, ReturnVoid, While {
public sealed interface Statement extends Node permits Assignment, Break, DoWhile, For, IfElse, MethodCall, New, Return, ReturnVoid, While {
}