From d8122087126048f39bbd9db21bf3470559f8be8d Mon Sep 17 00:00:00 2001 From: ahmad Date: Wed, 1 May 2024 11:03:05 +0200 Subject: [PATCH] Added Classes Type and TypedNode --- src/main/java/de/maishai/typedast/Type.java | 8 +++++++ .../java/de/maishai/typedast/TypedNode.java | 21 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/main/java/de/maishai/typedast/Type.java create mode 100644 src/main/java/de/maishai/typedast/TypedNode.java diff --git a/src/main/java/de/maishai/typedast/Type.java b/src/main/java/de/maishai/typedast/Type.java new file mode 100644 index 0000000..f1f01a8 --- /dev/null +++ b/src/main/java/de/maishai/typedast/Type.java @@ -0,0 +1,8 @@ +package de.maishai.typedast; + +public enum Type { + INT, + BOOL, + CHAR, + VOID +} diff --git a/src/main/java/de/maishai/typedast/TypedNode.java b/src/main/java/de/maishai/typedast/TypedNode.java new file mode 100644 index 0000000..eac7dd2 --- /dev/null +++ b/src/main/java/de/maishai/typedast/TypedNode.java @@ -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; + } + + +}