Commit f6f9792c authored by petter's avatar petter

right location bug in XMLElement fixed, accessor methods for tagname and variant added

git-svn-id: https://www2.in.tum.de/repos/cup/develop@68 f8377d4f-c7f8-0310-b030-a31f13008fac
parent 428a0c03
......@@ -72,6 +72,7 @@ public abstract class XMLElement {
writer.close();
}
protected String tagname;
public String getTagname() { return tagname; }
public abstract Location right();
public abstract Location left();
protected abstract void dump(XMLStreamWriter writer) throws XMLStreamException;
......@@ -92,6 +93,9 @@ public abstract class XMLElement {
return response;
}
private int variant;
public int getVariant() {
return variant;
}
LinkedList<XMLElement> list;
public NonTerminal(String tagname, int variant, XMLElement... l) {
this.tagname=tagname;
......@@ -108,7 +112,7 @@ public abstract class XMLElement {
}
public Location right() {
for (Iterator<XMLElement> it = list.descendingIterator();it.hasNext();){
Location loc = it.next().left();
Location loc = it.next().right();
if (loc!=null) return loc;
}
return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment