summaryrefslogtreecommitdiffstats
path: root/src/syntaxParser/VariableList.java
blob: f41d0a76591e71ee5a4047a6d5fed79f95634f07 (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
34
35
36
37
package syntaxParser;
/* Author: Sorin Stancu-Mara
 * Date: 8 Feb 2008
 */

class VariableList implements IParseTreeNode {
	String axisType, iteratorName;
	String lo,hi;
	VariableList next;

	public VariableList(String type, String name, String lo, String hi) {
		axisType = type;
		iteratorName = name;
		this.lo = lo;
		this.hi = hi;
		next = null;
	}

	public VariableList(String type, String name, String lo, String hi, VariableList next) {
		axisType = type;
		iteratorName = name;
		this.lo = lo;
		this.hi = hi;
		this.next = next;
	}

	public String toXML() {
		String result = "<axisIterator><axisType>" + axisType + "</axisType>" +
						"<iteratorVar>" + iteratorName + "</iteratorVar>" + 
						"<coord>" + lo + "</coord>" +
						"<coord>" + hi + "</coord></axisIterator>";
		
		if (next != null) result += next.toXML();
		return result;
	}

}