summaryrefslogtreecommitdiffstats
path: root/src/syntaxParser/ScalarLit.java
blob: c9810a8ba31b80cef5d798d6081c1ed210f59b06 (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
39
40
41
42
package syntaxParser;
/**
 * ScalarLit
 * Creation date: (3/3/2003 2:28:43 AM)
 * @author: mattia parigiani
 */
class ScalarLit {

	AtomicLit atomicLit;
	ComplexLit complexLit;
	String flag;

	/**
	 * ScalarLit constructor comment.
	 */
	public ScalarLit() {
		super();
	}
	public ScalarLit( AtomicLit al){	
		atomicLit = al;
		flag = "atomicLit";
	}
	
	public ScalarLit( ComplexLit cl){	
		complexLit = cl;
		flag = "complexLit";
	}
		
	String toXML(){
		String result="" ;
		try {
			if (flag.equals("complexLit")) {
				result += complexLit.toXML();	
			} else if (flag.equals("atomicLit")) {
				result += atomicLit.toXML();	
			}
		} catch (Exception e ) {
			e.printStackTrace();	
		}
		return result;
	}
}