summaryrefslogtreecommitdiffstats
path: root/src/uscxml/Interpreter.h
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-08-21 15:14:55 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-08-21 15:14:55 (GMT)
commitf7ad82f972bf46571bb5229205f877f8ab31069d (patch)
treee83110054a551053a68fb93d7061709808a19a0d /src/uscxml/Interpreter.h
parenta3fb1daf5b4e58471cc714853636025b6cac9aed (diff)
downloaduscxml-f7ad82f972bf46571bb5229205f877f8ab31069d.zip
uscxml-f7ad82f972bf46571bb5229205f877f8ab31069d.tar.gz
uscxml-f7ad82f972bf46571bb5229205f877f8ab31069d.tar.bz2
New Interpreter::validate() to identify issues with a document before running it
Diffstat (limited to 'src/uscxml/Interpreter.h')
-rw-r--r--src/uscxml/Interpreter.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/uscxml/Interpreter.h b/src/uscxml/Interpreter.h
index 70fb888..f82d095 100644
--- a/src/uscxml/Interpreter.h
+++ b/src/uscxml/Interpreter.h
@@ -211,9 +211,25 @@ enum InterpreterState {
USCXML_MICROSTEPPED = 2, ///< processed one transition set
USCXML_MACROSTEPPED = 4, ///< processed all transition sets and reached a stable configuration
};
+USCXML_API std::ostream& operator<< (std::ostream& os, const InterpreterState& interpreterState);
+class USCXML_API InterpreterIssue {
+public:
+ enum IssueSeverity {
+ USCXML_ISSUE_FATAL,
+ USCXML_ISSUE_WARNING,
+ USCXML_ISSUE_INFO
+ };
+
+ InterpreterIssue(const std::string& msg, Arabica::DOM::Node<std::string> node, IssueSeverity severity);
+
+ std::string xPath;
+ std::string message;
+ Arabica::DOM::Node<std::string> node;
+ IssueSeverity severity;
+};
+USCXML_API std::ostream& operator<< (std::ostream& os, const InterpreterIssue& issue);
-USCXML_API std::ostream& operator<< (std::ostream& os, const InterpreterState& interpreterState);
class USCXML_API InterpreterImpl : public boost::enable_shared_from_this<InterpreterImpl> {
public:
@@ -453,6 +469,8 @@ protected:
void setupDOM();
virtual void setupIOProcessors();
+ std::list<InterpreterIssue> validate();
+
void initializeData(const Arabica::DOM::Element<std::string>& data);
void finalizeAndAutoForwardCurrentEvent();
@@ -615,6 +633,10 @@ public:
return _impl->step(0);
};
+ std::list<InterpreterIssue> validate() {
+ return _impl->validate();
+ }
+
InterpreterState getState() {
return _impl->getInterpreterState();
}