~verifypn-stub/verifypn/deadlock-hotfix-2.2

« back to all changes in this revision

Viewing changes to CTL/CTLParser/CTLParser.h

  • Committer: Jiri Srba
  • Date: 2017-12-04 14:01:52 UTC
  • mfrom: (181.4.11 nctl)
  • Revision ID: srba.jiri@gmail.com-20171204140152-3tjzqq6xusfq0wyj
merged in branch lp:~verifypn-stub/verifypn/new-ctl

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * To change this license header, choose License Headers in Project Properties.
3
 
 * To change this template file, choose Tools | Templates
4
 
 * and open the template in the editor.
5
 
 */
6
 
 
7
 
/* 
8
 
 * File:   CTLParser_v2.h
9
 
 * Author: mossns
10
 
 *
11
 
 * Created on April 22, 2016, 10:15 AM
12
 
 */
13
 
 
14
 
#ifndef CTLPARSER_V2_H
15
 
#define CTLPARSER_V2_H
16
 
 
17
 
#include "CTLQuery.h"
18
 
 
19
 
#include "../../PetriParse/rapidxml/rapidxml.hpp"
20
 
 
21
 
#include <vector>
22
 
#include <string>
23
 
#include <stdio.h>
24
 
#include <string.h>
25
 
 
26
 
struct QueryMeta{
27
 
    int numberof_queries = 0;
28
 
    std::vector<std::string>* model_names = new std::vector<std::string>();
29
 
};
30
 
 
31
 
struct RemoveDelimiter
32
 
{
33
 
  bool operator()(char c)
34
 
  {
35
 
    return (c =='\r' || c =='\t' || c == ' ' || c == '\n');
36
 
  }
37
 
};
38
 
 
39
 
class CTLParser {
40
 
public:
41
 
    CTLParser();
42
 
    CTLParser(const CTLParser& orig);
43
 
    virtual ~CTLParser();
44
 
    CTLQuery * ParseXMLQuery(std::vector<char> buffer, int query_number);
45
 
    CTLQuery* FormatQuery(CTLQuery* query, PetriEngine::PetriNet *net);
46
 
    std::string QueryToString(CTLQuery* query);
47
 
    QueryMeta * GetQueryMetaData(std::vector<char> buffer);
48
 
private:
49
 
    CTLQuery* xmlToCTLquery(rapidxml::xml_node<> * root);
50
 
    std::string parsePar(rapidxml::xml_node<> * parameter);
51
 
    Path getPathOperator(rapidxml::xml_node<> * quantifyer_node);
52
 
    int max_depth(int a, int b);
53
 
    std::string loperator_sym(std::string loperator);
54
 
    CTLQuery * CopyQuery(CTLQuery *source);
55
 
    
56
 
    CTLQuery* FillAtom(CTLQuery* query, PetriEngine::PetriNet *net);
57
 
    CTLQuery* ConvertAG(CTLQuery* query);
58
 
    CTLQuery* ConvertEG(CTLQuery* query);
59
 
    CTLQuery* TemporalSetting(CTLQuery* query);
60
 
    int IdSetting(CTLQuery* query, int id);
61
 
    int GetNumberofChildren(rapidxml::xml_node<>* root);
62
 
    CTLQuery* GetChildren(CTLQuery* query, rapidxml::xml_node<>* node);
63
 
    std::string choppy( char *s );
64
 
 
65
 
};
66
 
 
67
 
#endif /* CTLPARSER_V2_H */
68