blob: d10834ecf15c130dbae9c0e4ca780536258ea4da (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
package syntaxParser;
/* Author: Sorin Stancu-Mara
* Date: 9 Feb 2008
* Outside the other Lists becasuse this one works with strings.
*/
class CrsList implements IParseTreeNode {
String elem;
String tag;
CrsList next;
public CrsList(String e) {
elem = e;
}
public CrsList(String e, CrsList n) {
elem = e;
next = n;
}
public void setTag(String newTag) {
tag =newTag;
if (next != null) {
next.setTag(tag);
}
}
public String toXML() {
String result = "";
if (tag != null) result += "<" + tag + ">" + elem + "</" + tag + ">";
else result += elem;
if (next != null)
result += next.toXML();
return result;
}
}
|