generated from rnentjes/kotlin-server-web-undertow
Refactor: Restructure project package hierarchy and add initial implementation for assembler instructions, shell commands, and exception handling.
This commit is contained in:
25
src/jvmMain/kotlin/mtmc/lang/sea/ast/Statement.java
Normal file
25
src/jvmMain/kotlin/mtmc/lang/sea/ast/Statement.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package mtmc.lang.sea.ast;
|
||||
|
||||
import mtmc.lang.ParseException;
|
||||
import mtmc.lang.sea.Token;
|
||||
|
||||
public abstract sealed class Statement extends Ast permits StatementBlock, StatementBreak, StatementContinue, StatementDoWhile, StatementExpression, StatementFor, StatementGoto, StatementIf, StatementReturn, StatementSyntaxError, StatementVar, StatementWhile
|
||||
{
|
||||
private Token labelAnchor = null;
|
||||
|
||||
public Statement(Token start, Token end) {
|
||||
super(start, end);
|
||||
}
|
||||
|
||||
public void setLabelAnchor(Token labelAnchor) throws ParseException {
|
||||
if (labelAnchor == null) return;
|
||||
if (this.labelAnchor != null) {
|
||||
throw new ParseException(new ParseException.Message(labelAnchor, "this statement has been labeled twice!!"));
|
||||
}
|
||||
this.labelAnchor = labelAnchor;
|
||||
}
|
||||
|
||||
public Token getLabelAnchor() {
|
||||
return labelAnchor;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user