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 Lha_gmlparser.hpp *
24 : * Created by Benoit Barbot on 03/11/11. *
25 : *******************************************************************************
26 : */
27 :
28 :
29 : #ifndef _LHA_GML_HPP
30 : #define _LHA_GML_HPP
31 :
32 : #include "expatmodelparser.hh"
33 : #include "modelhandler.hh"
34 : #include "Lha-Reader.hpp"
35 :
36 : #include <map>
37 :
38 12 : class MyLhaModelHandler: public ModelHandler
39 : {
40 : public:
41 :
42 : MyLhaModelHandler(LhaType* ,parameters &P) ;
43 : //~MyModelHandler() { }
44 :
45 :
46 : void on_read_model(const XmlString& formalismUrl) ;
47 :
48 : void on_read_model_attribute(const Attribute& attribute) ;
49 :
50 : void on_read_node(const XmlString& id,
51 : const XmlString& nodeType,
52 : const AttributeMap& attributes,
53 : const XmlStringList& references) ;
54 :
55 : void on_read_arc(const XmlString& id,
56 : const XmlString& arcType,
57 : const XmlString& source,
58 : const XmlString& target,
59 : const AttributeMap& attributes,
60 : const XmlStringList& references);
61 :
62 : private:
63 : string simplifyString(string str);
64 : bool is_void(string str);
65 : void appendSimplify(string *st, string str);
66 : void eval_expr(bool *is_mark_dep, string *st, tree<string>::pre_order_iterator);
67 : size_t eval_marking_expr(string&, tree<string>::pre_order_iterator);
68 :
69 : void eval_term( vector<string>& , tree<string>::pre_order_iterator );
70 : void eval_linexpr(vector<string>& , tree<string>::pre_order_iterator );
71 : void eval_guard(vector<vector<string> >&,vector<string>& , vector<string>& , tree<string>::pre_order_iterator );
72 : int eval_str (string);
73 : int eval_intFormula( map<std::string,int> intconst, tree<string>::pre_order_iterator);
74 : treeSI findbranchlha(treeSI t, string branch);
75 : Eval Evaluate_gml;
76 :
77 : HaslFormulasTop* exportHASLTop(tree<string>::pre_order_iterator);
78 : string exportHASL(tree<string>::pre_order_iterator);
79 :
80 : vector<string> FuncUpdateVector;
81 :
82 : set <string> PetriTransitions;
83 : //set <string> SubSet;
84 :
85 :
86 :
87 : vector < string > CoeffsVector;
88 : vector < vector <string> > CoeffsMatrix;
89 : vector <string> CST;
90 : vector <string> comp;
91 :
92 : int countLoc;
93 : bool ParseLoc;
94 : //bool ParseDecl;
95 : map<int,int> Gml2Loc;
96 : map<int
97 : ,bool> IsPlace;
98 : LhaType* MyLHA;
99 : parameters P;
100 :
101 : };
102 :
103 :
104 :
105 :
106 :
107 :
108 :
109 :
110 : #endif
111 :
112 :
|