summaryrefslogtreecommitdiffstats
path: root/src/uscxml/debug
diff options
context:
space:
mode:
authorStefan Radomski <github@mintwerk.de>2016-05-19 08:03:50 (GMT)
committerStefan Radomski <github@mintwerk.de>2016-05-19 08:03:50 (GMT)
commit5de792adc6796b0f03d62124765b4af0676dde46 (patch)
treee700d6b008b21c037aebcc1882fd9286920b2987 /src/uscxml/debug
parentf8e0c96fddfdd5f086e1bd973d6b0a19c39c93da (diff)
downloaduscxml-5de792adc6796b0f03d62124765b4af0676dde46.zip
uscxml-5de792adc6796b0f03d62124765b4af0676dde46.tar.gz
uscxml-5de792adc6796b0f03d62124765b4af0676dde46.tar.bz2
Refactored for public headers and started documentation
Diffstat (limited to 'src/uscxml/debug')
-rw-r--r--src/uscxml/debug/InterpreterIssue.cpp9
-rw-r--r--src/uscxml/debug/InterpreterIssue.h35
2 files changed, 29 insertions, 15 deletions
diff --git a/src/uscxml/debug/InterpreterIssue.cpp b/src/uscxml/debug/InterpreterIssue.cpp
index ce61af6..86947c1 100644
--- a/src/uscxml/debug/InterpreterIssue.cpp
+++ b/src/uscxml/debug/InterpreterIssue.cpp
@@ -23,15 +23,14 @@
#include "uscxml/util/DOM.h"
#include "uscxml/util/String.h"
#include "uscxml/util/Predicates.h"
-//#include "uscxml/debug/Complexity.h"
-#include "uscxml/Interpreter.h"
+#include "uscxml/interpreter/InterpreterImpl.h"
#include "uscxml/plugins/Factory.h"
#include <xercesc/dom/DOMDocument.hpp>
-namespace uscxml {
+using namespace XERCESC_NS;
-using namespace xercesc;
+namespace uscxml {
InterpreterIssue::InterpreterIssue(const std::string& msg, DOMNode* node, IssueSeverity severity, const std::string& specRef) : message(msg), node(node), severity(severity), specRef(specRef) {
if (node)
@@ -181,7 +180,7 @@ std::list<InterpreterIssue> InterpreterIssue::forInterpreter(InterpreterImpl* in
std::list<DOMElement*> scxmls = nodeSets["scxml"];
scxmls.push_back(_scxml);
- std::list<xercesc::DOMElement*> reachable = getReachableStates(_scxml);
+ std::list<XERCESC_NS::DOMElement*> reachable = getReachableStates(_scxml);
std::list<DOMElement*>& states = nodeSets["state"];
std::list<DOMElement*>& parallels = nodeSets["parallel"];
diff --git a/src/uscxml/debug/InterpreterIssue.h b/src/uscxml/debug/InterpreterIssue.h
index f72a7a4..c807acc 100644
--- a/src/uscxml/debug/InterpreterIssue.h
+++ b/src/uscxml/debug/InterpreterIssue.h
@@ -2,6 +2,7 @@
* @file
* @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de)
* @copyright Simplified BSD
+ * @brief Identifies some common problems with SCXML documents
*
* @cond
* This program is free software: you can redistribute it and/or modify
@@ -20,32 +21,46 @@
#ifndef INTERPRETERISSUE_H_962CB305
#define INTERPRETERISSUE_H_962CB305
+#include "uscxml/config.h"
#include "uscxml/Common.h"
+
#include <list>
#include <iostream>
-#include <xercesc/dom/DOMNode.hpp>
+
+// forward declare
+namespace XERCESC_NS {
+ class DOMNode;
+}
namespace uscxml {
class InterpreterImpl;
+/**
+ * Identify and report syntactic and semantic problems with a SCXML state-charts.
+ * @see uscxml::Interpreter::validate()
+ */
class USCXML_API InterpreterIssue {
public:
enum IssueSeverity {
- USCXML_ISSUE_FATAL,
- USCXML_ISSUE_WARNING,
- USCXML_ISSUE_INFO
+ USCXML_ISSUE_FATAL, ///< Interpreter can not process such a document
+ USCXML_ISSUE_WARNING, ///< Document is questionable, but formally ok
+ USCXML_ISSUE_INFO ///< Indicates a possible problem, but maybe perfectly ok
};
- InterpreterIssue(const std::string& msg, xercesc::DOMNode* node, IssueSeverity severity, const std::string& specRef = "");
+ std::string xPath; ///< Where did the issue arise
+ std::string message; ///< What is the issue
+ XERCESC_NS::DOMNode* node; ///< The DOM node pertaining to the issue
+ IssueSeverity severity; ///< Severity of the issue
+ std::string specRef; ///< If applicable, the violated section from the standard
- std::string xPath;
- std::string message;
- xercesc::DOMNode* node;
- IssueSeverity severity;
- std::string specRef;
+ /**
+ * Constructor is solely used to report issues at runtime.
+ */
+ InterpreterIssue(const std::string& msg, XERCESC_NS::DOMNode* node, IssueSeverity severity, const std::string& specRef = "");
private:
+
static std::list<InterpreterIssue> forInterpreter(InterpreterImpl* interpreter);
friend class Interpreter;
};