diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-07-01 22:51:30 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-07-01 22:51:30 (GMT) |
commit | 945160d0539ad119ffc986fac712db76c7203e84 (patch) | |
tree | c43e4a7db898026bc62cc20af5061d07736f847e /src/uscxml/plugins/datamodel/promela/PromelaParser.cpp | |
parent | c70d02010ea99e6c8e35da3b767f41f1ee5dce56 (diff) | |
download | uscxml-945160d0539ad119ffc986fac712db76c7203e84.zip uscxml-945160d0539ad119ffc986fac712db76c7203e84.tar.gz uscxml-945160d0539ad119ffc986fac712db76c7203e84.tar.bz2 |
More polishing for bindings C# and Java
Diffstat (limited to 'src/uscxml/plugins/datamodel/promela/PromelaParser.cpp')
-rw-r--r-- | src/uscxml/plugins/datamodel/promela/PromelaParser.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/uscxml/plugins/datamodel/promela/PromelaParser.cpp b/src/uscxml/plugins/datamodel/promela/PromelaParser.cpp index cd3bbaf..d12b7fc 100644 --- a/src/uscxml/plugins/datamodel/promela/PromelaParser.cpp +++ b/src/uscxml/plugins/datamodel/promela/PromelaParser.cpp @@ -19,6 +19,7 @@ #include "PromelaParser.h" #include "parser/promela.tab.hpp" +#include "uscxml/messages/Event.h" #include <iostream> @@ -35,10 +36,7 @@ int promela_lex_destroy (void*); void promela_error (uscxml::PromelaParser* ctx, void* yyscanner, const char* err) { // mark as pending exception as we cannot throw from constructor and have the destructor called - uscxml::Event excEvent; - excEvent.data.compound["exception"] = uscxml::Data(err, uscxml::Data::VERBATIM); - excEvent.name = "error.execution"; - excEvent.eventType = uscxml::Event::PLATFORM; + ERROR_EXECUTION(excEvent, err); ctx->pendingException = excEvent; } @@ -53,12 +51,7 @@ PromelaParser::PromelaParser(const std::string& expr, Type expectedType) { if (type != expectedType) { std::stringstream ss; ss << "Promela syntax type mismatch: Expected " << typeToDesc(expectedType) << " but got " << typeToDesc(type); - - uscxml::Event excEvent; - excEvent.data.compound["exception"] = uscxml::Data(ss.str(), uscxml::Data::VERBATIM); - excEvent.name = "error.execution"; - excEvent.eventType = uscxml::Event::PLATFORM; - throw excEvent; + ERROR_EXECUTION_THROW(ss.str()); } } |