summaryrefslogtreecommitdiffstats
path: root/src/syntaxParser/BooleanExpr.java
blob: 5d013f40a5664f7f8c8f5c588a63387e3e7a94d9 (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;
/**
 * BooleanExpr
 * Creation date: (3/3/2003 2:28:43 AM)
 * @author: mattia parigiani, Sorin Stancu-Mara
 */
class BooleanExpr implements IParseTreeNode {	
	CoverageExpr coverageExpr;
	String operator;
	int integerExpr;
	
	public BooleanExpr( CoverageExpr ce, String op ){	
		coverageExpr = ce;
		operator = op;
	}
	
	public BooleanExpr( CoverageExpr ce, int ie, String op ){	
		coverageExpr = ce;
		integerExpr = ie;
		operator = op;
	}
	
	public String toXML(){
		String result="";
		result += "<"+operator+">";
		if (operator.equals("bit")) {
			result += "<position>" + integerExpr +"<position>";
		}
		result += coverageExpr.toXML();			
		result += "</"+operator+">";
		return result;
	}
}