mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-28 17:28:03 +00:00
Merge branch 'main' of https://github.com/JonathanFleischmann/CompilerULTIMATE
This commit is contained in:
commit
258819d70f
@ -24,7 +24,6 @@ stmt : 'if' '(' expr ')' block ('else' block)? #If
|
|||||||
| 'return' expr ';' #Return
|
| 'return' expr ';' #Return
|
||||||
| 'return' ';' #ReturnVoid
|
| 'return' ';' #ReturnVoid
|
||||||
| 'break' ';' #Break
|
| 'break' ';' #Break
|
||||||
| 'continue' ';' #Continue
|
|
||||||
| assign ';' #Assignment
|
| assign ';' #Assignment
|
||||||
| stmtexpr ';' #StatementExpressionstmt
|
| stmtexpr ';' #StatementExpressionstmt
|
||||||
;
|
;
|
||||||
|
@ -61,11 +61,6 @@ public class StatementGenerator extends DecafBaseVisitor<Statement> {
|
|||||||
return new Break();
|
return new Break();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Statement visitContinue(DecafParser.ContinueContext ctx) {
|
|
||||||
return new Continue();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Statement visitAssignment(DecafParser.AssignmentContext ctx) {
|
public Statement visitAssignment(DecafParser.AssignmentContext ctx) {
|
||||||
return generateAssign(ctx.assign());
|
return generateAssign(ctx.assign());
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
package de.maishai.ast.records;
|
|
||||||
|
|
||||||
|
|
||||||
public record Continue() implements Statement {
|
|
||||||
}
|
|
@ -1,16 +1,4 @@
|
|||||||
package de.maishai.ast.records;
|
package de.maishai.ast.records;
|
||||||
|
|
||||||
import de.maishai.ast.records.Break;
|
public sealed interface Statement extends Node permits Assignment, Break, DoWhile, For, IfElse, MethodCall, New, Return, ReturnVoid, While {
|
||||||
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 {
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user