EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.pcmsolver.transformations.pcm2regex]

COVERAGE SUMMARY FOR SOURCE FILE [ExpressionPrinter.java]

nameclass, %method, %block, %line, %
ExpressionPrinter.java0%   (0/1)0%   (0/8)0%   (0/114)0%   (0/28)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ExpressionPrinter0%   (0/1)0%   (0/8)0%   (0/114)0%   (0/28)
<static initializer> 0%   (0/1)0%   (0/4)0%   (0/2)
ExpressionPrinter (): void 0%   (0/1)0%   (0/8)0%   (0/3)
caseAlternative (Alternative): Object 0%   (0/1)0%   (0/29)0%   (0/6)
caseLoop (Loop): Object 0%   (0/1)0%   (0/17)0%   (0/4)
caseSequence (Sequence): Object 0%   (0/1)0%   (0/17)0%   (0/4)
caseSymbol (Symbol): Object 0%   (0/1)0%   (0/22)0%   (0/4)
doSwitch (EObject): Object 0%   (0/1)0%   (0/13)0%   (0/4)
getOutput (): String 0%   (0/1)0%   (0/4)0%   (0/1)

1package de.uka.ipd.sdq.pcmsolver.transformations.pcm2regex;
2 
3import org.eclipse.emf.ecore.EObject;
4 
5import de.uka.ipd.sdq.spa.expression.Alternative;
6import de.uka.ipd.sdq.spa.expression.Loop;
7import de.uka.ipd.sdq.spa.expression.Sequence;
8import de.uka.ipd.sdq.spa.expression.Symbol;
9import de.uka.ipd.sdq.spa.expression.util.ExpressionSwitch;
10 
11public class ExpressionPrinter extends ExpressionSwitch{
12        
13        private static String newline = System.getProperty("line.separator");
14        
15        private StringBuilder outputStr = new StringBuilder();
16        
17        public ExpressionPrinter(){
18        }
19        
20        public String getOutput(){
21                return outputStr.toString();
22        }
23        
24        @Override
25        public Object caseAlternative(Alternative object) {
26                //System.out.print("(");
27                outputStr.append("(");
28                doSwitch(object.getLeftOption().getRegexp());
29                outputStr.append("|");
30                doSwitch(object.getRightOption().getRegexp());
31                outputStr.append(")");
32                return object;
33 
34        }
35 
36        @Override
37        public Object caseLoop(Loop object) {
38                outputStr.append("(");
39                doSwitch(object.getRegExp());
40                outputStr.append(")*");
41                return object;
42        }
43 
44        @Override
45        public Object caseSequence(Sequence object) {
46                doSwitch(object.getLeftRegExp());
47                outputStr.append("");
48                doSwitch(object.getRightRegExp());
49                return object;
50        }
51 
52        @Override
53        public Object doSwitch(EObject theEObject) {
54                if (theEObject == null){
55                        outputStr.append("!null!");
56                        return null;
57                } else {
58                        return super.doSwitch(theEObject);
59                }
60        }
61 
62        @Override
63        public Object caseSymbol(Symbol object) {
64//                outputStr.append("0");
65                
66                if (object.getName() == null || object.getName().equals("")){
67                        //System.out.print("0");
68                        outputStr.append("0");
69                } else {
70                        //System.out.print(object.getName());
71                        outputStr.append(object.getName());
72                }
73                return object;
74        }
75 
76        
77        
78}

[all classes][de.uka.ipd.sdq.pcmsolver.transformations.pcm2regex]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov