diff --git a/src/main/java/de/maishai/ast/Expression.java b/src/main/java/de/maishai/ast/Expression.java index 7e11bae..a113f28 100644 --- a/src/main/java/de/maishai/ast/Expression.java +++ b/src/main/java/de/maishai/ast/Expression.java @@ -1,6 +1,14 @@ package de.maishai.ast; +import de.maishai.ast.records.Assignment; +import de.maishai.ast.records.Binary; +import de.maishai.ast.records.BoolConstant; +import de.maishai.ast.records.CharConstant; +import de.maishai.ast.records.Id; +import de.maishai.ast.records.IntConstant; +import de.maishai.ast.records.MethodCall; +import de.maishai.ast.records.New; -public interface Expression extends Node { +public sealed interface Expression extends Node permits Assignment, Binary, BoolConstant, CharConstant, Id, IntConstant, MethodCall, New { } diff --git a/src/main/java/de/maishai/ast/Node.java b/src/main/java/de/maishai/ast/Node.java index b07e221..0c68bd6 100644 --- a/src/main/java/de/maishai/ast/Node.java +++ b/src/main/java/de/maishai/ast/Node.java @@ -1,4 +1,12 @@ package de.maishai.ast; -public interface Node { +import de.maishai.ast.records.Block; +import de.maishai.ast.records.Class; +import de.maishai.ast.records.MainMethod; +import de.maishai.ast.records.Method; +import de.maishai.ast.records.Parameter; +import de.maishai.ast.records.Program; +import de.maishai.ast.records.Variable; + +public sealed interface Node permits Expression, Statement, Block, Class, MainMethod, Method, Parameter, Program, Variable { } diff --git a/src/main/java/de/maishai/ast/Statement.java b/src/main/java/de/maishai/ast/Statement.java index c9e690c..191bea6 100644 --- a/src/main/java/de/maishai/ast/Statement.java +++ b/src/main/java/de/maishai/ast/Statement.java @@ -1,3 +1,15 @@ package de.maishai.ast; -public interface Statement extends Node { + +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.Return; +import de.maishai.ast.records.ReturnVoid; +import de.maishai.ast.records.While; + +public sealed interface Statement extends Node permits Break, Continue, DoWhile, For, IfElse, MethodCall, New, Return, ReturnVoid, While { }