~tapaal-contributor/tapaal/disappearing-tokens-1940098

« back to all changes in this revision

Viewing changes to src/dk/aau/cs/verification/UPPAAL/VerifytaOutputParser.java

  • Committer: Kenneth Yrke Jørgensen
  • Date: 2011-04-12 09:50:16 UTC
  • mfrom: (329.1.188 tapaal-1.5)
  • Revision ID: mail@yrke.dk-20110412095016-e4hqdgab5596ja09
Merged with branch addning support for new 1.5 features

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
        private static final String PROPERTY_IS_SATISFIED_STRING = "Property is satisfied";
8
8
        private boolean error = false;
9
9
 
10
 
        public boolean error(){
 
10
        public boolean error() {
11
11
                return error;
12
 
        }       
 
12
        }
13
13
 
14
14
        public QueryResult parseOutput(String output) {
15
15
                String[] lines = output.split(System.getProperty("line.separator"));
16
16
                try {
17
 
                        for(int i = 0; i < lines.length; i++){
 
17
                        for (int i = 0; i < lines.length; i++) {
18
18
                                String line = lines[i];
19
19
                                if (line.contains(PROPERTY_IS_SATISFIED_STRING)) {
20
 
                                        if(i+1 < lines.length && lines[i+1].contains("sup")){
21
 
                                                line = lines[i+2];
22
 
                                                String number = line.substring(line.lastIndexOf(" ")).trim();
 
20
 
 
21
                                        if (i + 1 < lines.length && lines[i + 1].contains("sup")) {
 
22
                                                line = lines[i + 2];
 
23
                                                String number = line.substring(line.lastIndexOf(" "))
 
24
                                                                .trim();
 
25
 
23
26
                                                return new QueryResult(Integer.parseInt(number));
24
27
                                        }
25
28
                                        return new QueryResult(true);
26
 
                                }else if(line.contains(PROPERTY_IS_NOT_SATISFIED_STRING)){
 
29
                                } else if (line.contains(PROPERTY_IS_NOT_SATISFIED_STRING)) {
27
30
                                        return new QueryResult(false);
28
31
                                }
29
32
                        }
30
 
                }catch(Exception e){
 
33
                } catch (Exception e) {
31
34
                }
32
35
                return null;
33
36
        }