mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-27 09:48:03 +00:00
Added Classes Type and TypedNode
This commit is contained in:
parent
5fa439ec90
commit
d812208712
8
src/main/java/de/maishai/typedast/Type.java
Normal file
8
src/main/java/de/maishai/typedast/Type.java
Normal file
@ -0,0 +1,8 @@
|
||||
package de.maishai.typedast;
|
||||
|
||||
public enum Type {
|
||||
INT,
|
||||
BOOL,
|
||||
CHAR,
|
||||
VOID
|
||||
}
|
21
src/main/java/de/maishai/typedast/TypedNode.java
Normal file
21
src/main/java/de/maishai/typedast/TypedNode.java
Normal file
@ -0,0 +1,21 @@
|
||||
package de.maishai.typedast;
|
||||
|
||||
import de.maishai.ast.Node;
|
||||
|
||||
public class TypedNode {
|
||||
|
||||
public Node node;
|
||||
public Type type;
|
||||
|
||||
public TypedNode(Node node, Type type) {
|
||||
this.node = node;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return node.toString() + " : " + type;
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user