Line data Source code
1 : /*******************************************************************************
2 : * *
3 : * Cosmos:(C)oncept et (O)utils (S)tatistique pour les (Mo)deles *
4 : * (S)tochastiques *
5 : * *
6 : * Copyright (C) 2009-2012 LSV & LACL *
7 : * Authors: Paolo Ballarini BenoƮt Barbot & Hilal Djafri *
8 : * Website: http://www.lsv.ens-cachan.fr/Software/cosmos *
9 : * *
10 : * This program is free software; you can redistribute it and/or modify *
11 : * it under the terms of the GNU General Public License as published by *
12 : * the Free Software Foundation; either version 3 of the License, or *
13 : * (at your option) any later version. *
14 : * *
15 : * This program is distributed in the hope that it will be useful, *
16 : * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 : * GNU General Public License for more details. *
19 : * *
20 : * You should have received a copy of the GNU General Public License along *
21 : * with this program; if not, write to the Free Software Foundation, Inc., *
22 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
23 : * file Gspn_gmlparser.hpp *
24 : * Created by Benoit Barbot on 05/10/12. *
25 : *******************************************************************************
26 : */
27 :
28 : #ifndef _SPN_GML_HPP
29 : #define _SPN_GML_HPP
30 :
31 :
32 : #include "expatmodelparser.hh"
33 : #include "modelhandler.hh"
34 : #include "Gspn-model.hpp"
35 : #include <map>
36 :
37 : #include <exception>
38 :
39 :
40 92 : class MyModelHandler: public ModelHandler
41 : {
42 : public:
43 : bool ParsePl;
44 : std::map<int,bool> IsPlace;
45 : std::map<int,int> Gml2Place;
46 : std::map<int,int> Gml2Trans;
47 : GspnType *MyGspn;
48 :
49 : MyModelHandler(GspnType&) ;
50 : MyModelHandler(GspnType&,std::map<int,bool>&,std::map<int,int>&,std::map<int,int>&);
51 : //~MyModelHandler() { }
52 :
53 :
54 : void on_read_model(const XmlString& formalismUrl) ;
55 :
56 : void on_read_model_attribute(const Attribute& attribute) ;
57 :
58 : void on_read_node(const XmlString& id,
59 : const XmlString& nodeType,
60 : const AttributeMap& attributes,
61 : const XmlStringList& references) ;
62 :
63 : void on_read_arc(const XmlString& id,
64 : const XmlString& arcType,
65 : const XmlString& source,
66 : const XmlString& target,
67 : const AttributeMap& attributes,
68 : const XmlStringList& references);
69 :
70 : private:
71 : expr eval_expr(tree<std::string>::pre_order_iterator it );
72 : int eval_intFormula( tree<std::string>::pre_order_iterator it );
73 : double eval_realFormula(tree<std::string>::pre_order_iterator it );
74 : void eval_tokenProfileArc(coloredToken& ,bool &, std::set<size_t>& , tree<std::string>::pre_order_iterator,bool isInitialMarking);
75 : expr eval_guard(tree<std::string>::pre_order_iterator);
76 :
77 : std::string simplifyString(std::string str);
78 : treeSI findbranch(treeSI t, std::string branch);
79 : };
80 :
81 :
82 :
83 :
84 :
85 :
86 :
87 :
88 : #endif
89 :
90 :
|