mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-27 08:18:03 +00:00
Andis ast records
This commit is contained in:
parent
8a11d9273f
commit
55a15e8bda
7
src/main/java/de/maishai/ast/Assignment.java
Normal file
7
src/main/java/de/maishai/ast/Assignment.java
Normal file
@ -0,0 +1,7 @@
|
||||
package de.maishai.ast;
|
||||
|
||||
import de.dhbw.horb.ast.Expression;
|
||||
import de.dhbw.horb.ast.Statement;
|
||||
|
||||
public record Assignment(Location loc, Expression value) implements Statement {
|
||||
}
|
7
src/main/java/de/maishai/ast/Binary.java
Normal file
7
src/main/java/de/maishai/ast/Binary.java
Normal file
@ -0,0 +1,7 @@
|
||||
package de.maishai.ast;
|
||||
|
||||
import de.dhbw.horb.ast.Expression;
|
||||
import de.dhbw.horb.ast.Operator;
|
||||
|
||||
public record Binary(Expression left, Operator op, Expression right) implements Expression{
|
||||
}
|
9
src/main/java/de/maishai/ast/Block.java
Normal file
9
src/main/java/de/maishai/ast/Block.java
Normal file
@ -0,0 +1,9 @@
|
||||
package de.maishai.ast;
|
||||
|
||||
import de.dhbw.horb.ast.Node;
|
||||
import de.dhbw.horb.ast.Statement;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record Block(List<Variable> vars, List<Statement> stmts) implements Node {
|
||||
}
|
6
src/main/java/de/maishai/ast/BoolConstant.java
Normal file
6
src/main/java/de/maishai/ast/BoolConstant.java
Normal file
@ -0,0 +1,6 @@
|
||||
package de.maishai.ast;
|
||||
|
||||
import de.dhbw.horb.ast.Expression;
|
||||
|
||||
public record BoolConstant(Boolean value) implements Expression {
|
||||
}
|
6
src/main/java/de/maishai/ast/Break.java
Normal file
6
src/main/java/de/maishai/ast/Break.java
Normal file
@ -0,0 +1,6 @@
|
||||
package de.maishai.ast;
|
||||
|
||||
import de.dhbw.horb.ast.Statement;
|
||||
|
||||
public record Break() implements Statement {
|
||||
}
|
6
src/main/java/de/maishai/ast/Continue.java
Normal file
6
src/main/java/de/maishai/ast/Continue.java
Normal file
@ -0,0 +1,6 @@
|
||||
package de.maishai.ast;
|
||||
|
||||
import de.dhbw.horb.ast.Statement;
|
||||
|
||||
public record Continue() implements Statement {
|
||||
}
|
9
src/main/java/de/maishai/ast/Function.java
Normal file
9
src/main/java/de/maishai/ast/Function.java
Normal file
@ -0,0 +1,9 @@
|
||||
package de.maishai.ast;
|
||||
|
||||
import de.dhbw.horb.ast.Node;
|
||||
import de.dhbw.horb.ast.Type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record Function(Type type, String name, List<Variable> params, Block block) implements Node {
|
||||
}
|
9
src/main/java/de/maishai/ast/FunctionCall.java
Normal file
9
src/main/java/de/maishai/ast/FunctionCall.java
Normal file
@ -0,0 +1,9 @@
|
||||
package de.maishai.ast;
|
||||
|
||||
import de.dhbw.horb.ast.Expression;
|
||||
import de.dhbw.horb.ast.Statement;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record FunctionCall(String name, List<Expression> args) implements Expression, Statement {
|
||||
}
|
7
src/main/java/de/maishai/ast/IfElse.java
Normal file
7
src/main/java/de/maishai/ast/IfElse.java
Normal file
@ -0,0 +1,7 @@
|
||||
package de.maishai.ast;
|
||||
|
||||
import de.dhbw.horb.ast.Expression;
|
||||
import de.dhbw.horb.ast.Statement;
|
||||
|
||||
public record IfElse(Expression cond, Block ifBlock, Block elseBlock) implements Statement {
|
||||
}
|
6
src/main/java/de/maishai/ast/IntConstant.java
Normal file
6
src/main/java/de/maishai/ast/IntConstant.java
Normal file
@ -0,0 +1,6 @@
|
||||
package de.maishai.ast;
|
||||
|
||||
import de.dhbw.horb.ast.Expression;
|
||||
|
||||
public record IntConstant(Integer value) implements Expression {
|
||||
}
|
6
src/main/java/de/maishai/ast/Location.java
Normal file
6
src/main/java/de/maishai/ast/Location.java
Normal file
@ -0,0 +1,6 @@
|
||||
package de.maishai.ast;
|
||||
|
||||
import de.dhbw.horb.ast.Expression;
|
||||
|
||||
public record Location(String name) implements Expression {
|
||||
}
|
8
src/main/java/de/maishai/ast/Program.java
Normal file
8
src/main/java/de/maishai/ast/Program.java
Normal file
@ -0,0 +1,8 @@
|
||||
package de.maishai.ast;
|
||||
|
||||
import de.dhbw.horb.ast.Node;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record Program(List<Variable> variables, List<Function> methods) implements Node {
|
||||
}
|
7
src/main/java/de/maishai/ast/Return.java
Normal file
7
src/main/java/de/maishai/ast/Return.java
Normal file
@ -0,0 +1,7 @@
|
||||
package de.maishai.ast;
|
||||
|
||||
import de.dhbw.horb.ast.Expression;
|
||||
import de.dhbw.horb.ast.Statement;
|
||||
|
||||
public record Return(Expression ret) implements Statement {
|
||||
}
|
6
src/main/java/de/maishai/ast/ReturnVoid.java
Normal file
6
src/main/java/de/maishai/ast/ReturnVoid.java
Normal file
@ -0,0 +1,6 @@
|
||||
package de.maishai.ast;
|
||||
|
||||
import de.dhbw.horb.ast.Statement;
|
||||
|
||||
public record ReturnVoid() implements Statement {
|
||||
}
|
7
src/main/java/de/maishai/ast/Variable.java
Normal file
7
src/main/java/de/maishai/ast/Variable.java
Normal file
@ -0,0 +1,7 @@
|
||||
package de.maishai.ast;
|
||||
|
||||
import de.dhbw.horb.ast.Node;
|
||||
import de.dhbw.horb.ast.Type;
|
||||
|
||||
public record Variable(String name, Type type) implements Node {
|
||||
}
|
6
src/main/java/de/maishai/ast/VoidFunctionCall.java
Normal file
6
src/main/java/de/maishai/ast/VoidFunctionCall.java
Normal file
@ -0,0 +1,6 @@
|
||||
package de.maishai.ast;
|
||||
|
||||
import de.dhbw.horb.ast.Statement;
|
||||
|
||||
public record VoidFunctionCall(FunctionCall expr) implements Statement {
|
||||
}
|
7
src/main/java/de/maishai/ast/While.java
Normal file
7
src/main/java/de/maishai/ast/While.java
Normal file
@ -0,0 +1,7 @@
|
||||
package de.maishai.ast;
|
||||
|
||||
import de.dhbw.horb.ast.Expression;
|
||||
import de.dhbw.horb.ast.Statement;
|
||||
|
||||
public record While(Expression cond, Block block) implements Statement {
|
||||
}
|
Loading…
Reference in New Issue
Block a user