implement initial basic ast
This commit is contained in:
28
src/main/java/util/ast/AST.java
Normal file
28
src/main/java/util/ast/AST.java
Normal file
@ -0,0 +1,28 @@
|
||||
package util.ast;
|
||||
|
||||
public class AST {
|
||||
|
||||
private final Node root;
|
||||
|
||||
public AST(Node root) {
|
||||
this.root = root;
|
||||
}
|
||||
|
||||
public Node getRoot() {
|
||||
return this.root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof AST) {
|
||||
return this.root.equals(((AST) obj).root);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.root.toString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user