summaryrefslogtreecommitdiffstats
path: root/src/grammar/VariableList.java
blob: 874b3983cb3f2ddf5ef641756ce3b65b3e7e9d54 (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
38
package grammar;

/* Author: Sorin Stancu-Mara, Andrei Aiordachioaie
 * Date: 8 Feb 2008
 */

public 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;
	}

}