Refactor: Restructure project package hierarchy and add initial implementation for assembler instructions, shell commands, and exception handling.

This commit is contained in:
2025-08-13 21:42:49 +02:00
parent b103631133
commit 12027fe740
135 changed files with 10835 additions and 31 deletions

View 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;
}
}