Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
PnmlParser.h
Go to the documentation of this file.
1#pragma once
2
3#include "storm-config.h"
4#ifdef STORM_HAVE_XERCES
5#include <string>
6#include <xercesc/parsers/XercesDOMParser.hpp>
7#include <xercesc/util/XMLString.hpp>
8
10
12
13namespace storm {
14namespace parser {
15
16/* Parses a pnml-file to a gspn.
17 IMPORTANT: The names of places, transitions and arcs must differ from each other.
18 */
19class PnmlParser {
20 public:
27 storm::gspn::GSPN* parse(xercesc::DOMElement const* elementRoot);
28
29 private:
35 void traversePnmlElement(xercesc::DOMElement const* const element);
36
42 void traverseNetOrPage(xercesc::DOMNode const* const node);
43
49 void traversePlace(xercesc::DOMNode const* const node);
50
56 void traverseTransition(xercesc::DOMNode const* const node);
57
63 void traverseArc(xercesc::DOMNode const* const node);
64
71 uint_fast64_t traverseInitialMarking(xercesc::DOMNode const* const node);
72
79 int_fast64_t traverseCapacity(xercesc::DOMNode const* const node);
80
87 uint_fast64_t traverseMultiplicity(xercesc::DOMNode const* const node);
88
95 std::string traverseTransitionValue(xercesc::DOMNode const* const node);
96
103 bool traverseTransitionType(xercesc::DOMNode const* const node);
104
111 std::string traverseArcType(xercesc::DOMNode const* const node);
112
118 uint_fast64_t traversePriority(xercesc::DOMNode const* const node);
119
120 // the constructed gspn
122
123 // default value for initial tokens
124 uint_fast64_t defaultNumberOfInitialTokens = 0;
125
126 // default value for capacities
127 int_fast64_t defaultCapacity = -1;
128
129 // default value for the transition type (false == immediate transition)
130 bool defaultTransitionType = false;
131
132 // default value for the arc type
133 std::string defaultArcType = "normal";
134
135 // default multiplicity for arcs
136 uint_fast64_t defaultMultiplicity = 1;
137
138 // default priority for transitions
139 uint_fast64_t defaultPriority = 0;
140};
141} // namespace parser
142} // namespace storm
143
144#endif
LabParser.cpp.
Definition cli.cpp:18