blob: 94d41675135e56a674fab7a8c3a822fbfc7bfdfe (
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
|
package syntaxParser;
/**
* UnaryArithmeticExpr
* Creation date: (3/3/2003 2:28:43 AM)
* @author: mattia parigiani, Sorin Stancu-Mara
*/
class UnaryArithMeticExpr implements IParseTreeNode {
String operator;
CoverageExpr coverageExpr;
public UnaryArithMeticExpr( CoverageExpr ce, String op){
operator = op;
coverageExpr = ce;
}
public String toXML(){
String result= "" ;
String op;
if (operator.equals("+")) {
op = "unaryPlus";
} else if (operator.equals("-")) {
op = "unaryMinus";
} else {
op = operator;
}
result += "<" + op + ">\n";
result += coverageExpr.toXML() ;
result += "</" + op + ">\n";
return result;
}
}
|