literal=o;
}
- public Object getLiteral(Object o) {
+ public Object getLiteral() {
return literal;
}
public ParseNode addChild( ParseNode child ) {
if (child == null) {
- throw new NullPointerException("Can't add null node to parse tree");
+ throw new NullPointerException("Can't add null node to parse tree: "+getLabel());
}
children.addElement (child);
}
}
+ public ParseNode getFirstChild() {
+ return children.elementAt(0);
+ }
public ParseNodeVector getChildren(String label) {
int i;