Otawa  0.10
XSLTScript.h
Go to the documentation of this file.
1 /*
2  * otawa::XSLTScript class interface
3  * Script processor implementation
4  *
5  * This file is part of OTAWA
6  * Copyright (c) 2011, IRIT UPS.
7  *
8  * OTAWA is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * OTAWA is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with OTAWA; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 #ifndef OTAWA_XSLTSCRIPT_H_
23 #define OTAWA_XSLTSCRIPT_H_
24 
25 #include <elm/xom.h>
26 #include <elm/genstruct/Vector.h>
27 #include <elm/system/Path.h>
28 #include <elm/io/Monitor.h>
29 #include <otawa/properties.h>
30 
31 namespace otawa {
32 
33 using namespace elm;
34 
35 class XSLTScript: private io::Monitor {
36 public:
37  XSLTScript(const elm::system::Path& path, Monitor& monitor = elm::monitor, bool verbosity = false) throw(otawa::Exception);
38  virtual ~XSLTScript(void);
39  xom::Document *document(void) const { return doc; }
40  void setConfiguration(cstring name = "configuration");
41  void setConfiguration(xom::Element *element);
42  void addParam(string name, String value);
43  void addParams(const PropList& props, Identifier<string>& id);
44  void addParams(const PropList& props, Identifier<Pair<string, string> >& id);
45  void transform(void) throw(otawa::Exception);
46  void fillProps(PropList& props, xom::Element *element);
47  void fillProps(PropList& props, cstring name);
48 
49 private:
50  void onWarning(xom::Node *node, const string& msg);
51  void onError(xom::Node *node, const string& msg);
52 
53  xom::Document *doc, *xsl;
54  xom::Element *temp;
55  enum {
58  TRANSFORMED
59  } state;
61  bool configured;
62  bool verbose;
63 };
64 
65 } // otawa
66 
67 
68 #endif /* OTAWA_XMLSCRIPT_H_ */
io::Monitor monitor
xom::Document * document(void) const
Definition: XSLTScript.h:39
Definition: XSLTScript.h:56
This class provides a simple way to implement OTAWA script.
Definition: XSLTScript.h:35
This class represents identifier with a typed associated value.
Definition: Identifier.h:51
genstruct::Vector< Pair< string, string > > params
Definition: XSLTScript.h:60
bool verbose
Definition: XSLTScript.h:62
cstring name
Definition: odisasm.cpp:107
This a list of properties.
Definition: PropList.h:63
bool configured
Definition: XSLTScript.h:61
Definition: XSLTScript.h:57