diff options
Diffstat (limited to 'src/uscxml/plugins')
8 files changed, 49 insertions, 49 deletions
diff --git a/src/uscxml/plugins/DataModel.cpp b/src/uscxml/plugins/DataModel.cpp index 19a01c9..1b12e88 100644 --- a/src/uscxml/plugins/DataModel.cpp +++ b/src/uscxml/plugins/DataModel.cpp @@ -31,7 +31,7 @@ bool DataModel::isValidSyntax(const std::string& expr) { } bool DataModel::isLegalDataValue(const std::string& expr) { - return _impl->isLegalDataValue(expr); + return _impl->isLegalDataValue(expr); } void DataModel::setEvent(const Event& event) { diff --git a/src/uscxml/plugins/DataModel.h b/src/uscxml/plugins/DataModel.h index 6812553..b5ab31c 100644 --- a/src/uscxml/plugins/DataModel.h +++ b/src/uscxml/plugins/DataModel.h @@ -46,8 +46,8 @@ public: virtual std::list<std::string> getNames(); /// @copydoc DataModelImpl::isValidSyntax() virtual bool isValidSyntax(const std::string& expr); - /// @copydoc DataModelImpl::isLegalDataValue() - virtual bool isLegalDataValue(const std::string& expr); + /// @copydoc DataModelImpl::isLegalDataValue() + virtual bool isLegalDataValue(const std::string& expr); /// @copydoc DataModelImpl::setEvent() virtual void setEvent(const Event& event); diff --git a/src/uscxml/plugins/DataModelImpl.h b/src/uscxml/plugins/DataModelImpl.h index b378a96..afb41bc 100644 --- a/src/uscxml/plugins/DataModelImpl.h +++ b/src/uscxml/plugins/DataModelImpl.h @@ -117,7 +117,7 @@ public: /** * Determine whether a given string constitutes valid syntax in the * data-model's language. This is only used to identify InterpreterIssues - * but may be useful to implement isLegalDataValue() as well. + * but may be useful to implement isLegalDataValue() as well. * @param expr A string, supposedly containing an expression of the data-model. * @return Whether expr is in L(DM). */ @@ -125,16 +125,16 @@ public: return true; // overwrite when datamodel supports it } - /** - * Determine whether a given string constitutes a legal data value that can appear - * at the right-hand side of an assignment. - * - * @param expr A string, supposedly containing a legal data value. - * @return Whether expr is a legal data value. - */ - virtual bool isLegalDataValue(const std::string& expr) { - return true; // overwrite when datamodel supports it - } + /** + * Determine whether a given string constitutes a legal data value that can appear + * at the right-hand side of an assignment. + * + * @param expr A string, supposedly containing a legal data value. + * @return Whether expr is a legal data value. + */ + virtual bool isLegalDataValue(const std::string& expr) { + return true; // overwrite when datamodel supports it + } /** * Set the given event as `_event` in the data-model's global scope. diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp index 3932961..69ed632 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp @@ -669,9 +669,9 @@ bool JSCDataModel::isValidSyntax(const std::string& expr) { } bool JSCDataModel::isLegalDataValue(const std::string& expr) { - return isValidSyntax("var __tmp = " + expr); + return isValidSyntax("var __tmp = " + expr); } - + bool JSCDataModel::isDeclared(const std::string& expr) { JSStringRef scriptJS = JSStringCreateWithUTF8CString(expr.c_str()); JSValueRef exception = NULL; diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h index 38b0ca5..dbe37e6 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h @@ -64,7 +64,7 @@ public: return names; } - virtual bool isLegalDataValue(const std::string& expr); + virtual bool isLegalDataValue(const std::string& expr); virtual bool isValidSyntax(const std::string& expr); virtual void setEvent(const Event& event); diff --git a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp index 15cbf9d..ad4fb40 100644 --- a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp +++ b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp @@ -63,17 +63,17 @@ using namespace XERCESC_NS; #else #include "LuaEvent.cpp.inc" #endif - + namespace uscxml { - + #ifdef BUILD_AS_PLUGINS - PLUMA_CONNECTOR - bool pluginConnect(pluma::Host& host) { - host.add( new LuaDataModelProvider() ); - return true; - } +PLUMA_CONNECTOR +bool pluginConnect(pluma::Host& host) { + host.add( new LuaDataModelProvider() ); + return true; +} #endif - + static int luaEval(lua_State* luaState, const std::string& expr) { int preStack = lua_gettop(luaState); int error = luaL_loadstring(luaState, expr.c_str()) || lua_pcall(luaState, 0, LUA_MULTRET, 0); @@ -97,12 +97,12 @@ static Data getLuaAsData(lua_State* _luaState, const luabridge::LuaRef& lua) { data.type = Data::INTERPRETED; } else if(lua.isLightUserdata() || lua.isUserdata()) { #ifndef NO_XERCESC - int err = SWIG_Lua_ConvertPtr(_luaState, 0, (void**)&(data.node), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_POINTER_DISOWN); - if (err == SWIG_ERROR) - data.node = NULL; + int err = SWIG_Lua_ConvertPtr(_luaState, 0, (void**)&(data.node), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_POINTER_DISOWN); + if (err == SWIG_ERROR) + data.node = NULL; #endif - - } else if(lua.isThread()) { + + } else if(lua.isThread()) { // not sure what to do } else if(lua.type() == LUA_TBOOLEAN) { // why is there no isBoolean in luabridge? @@ -121,7 +121,7 @@ static Data getLuaAsData(lua_State* _luaState, const luabridge::LuaRef& lua) { } else if(lua.isString()) { data.atom = lua.cast<std::string>(); data.type = Data::VERBATIM; - } else if(lua.isTable()) { + } else if(lua.isTable()) { // check whether it is to be interpreted as a map or an array bool isArray = true; std::map<std::string, luabridge::LuaRef> luaItems; @@ -161,13 +161,13 @@ static luabridge::LuaRef getDataAsLua(lua_State* _luaState, const Data& data) { if (data.node) { #ifndef NO_XERCESC - SWIG_Lua_NewPointerObj(_luaState, data.node, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_POINTER_DISOWN); - luaData = luabridge::LuaRef::fromStack(_luaState, 1); - return luaData; + SWIG_Lua_NewPointerObj(_luaState, data.node, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_POINTER_DISOWN); + luaData = luabridge::LuaRef::fromStack(_luaState, 1); + return luaData; #else - ERROR_EXECUTION_THROW("No DOM support in Lua datamodel"); + ERROR_EXECUTION_THROW("No DOM support in Lua datamodel"); #endif - } + } if (data.compound.size() > 0) { luaData = luabridge::newTable(_luaState); std::map<std::string, Data>::const_iterator compoundIter = data.compound.begin(); @@ -257,8 +257,8 @@ void LuaDataModel::setup() { _luaState = luaL_newstate(); luaL_openlibs(_luaState); - SWIG_init(_luaState); - + SWIG_init(_luaState); + #if 0 try { const luabridge::LuaRef& requireFunc = luabridge::getGlobal(_luaState, "require"); @@ -277,7 +277,7 @@ void LuaDataModel::setup() { LOG(_callbacks->getLogger(), USCXML_INFO) << e.what() << std::endl; } #endif - + luabridge::getGlobalNamespace(_luaState).beginClass<LuaDataModel>("DataModel").endClass(); luabridge::setGlobal(_luaState, this, "__datamodel"); @@ -351,10 +351,10 @@ void LuaDataModel::setEvent(const Event& event) { if (event.data.node) { #ifndef NO_XERCESC - SWIG_Lua_NewPointerObj(_luaState, event.data.node, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_POINTER_DISOWN); - luaEvent["data"] = luabridge::LuaRef::fromStack(_luaState, 1); + SWIG_Lua_NewPointerObj(_luaState, event.data.node, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_POINTER_DISOWN); + luaEvent["data"] = luabridge::LuaRef::fromStack(_luaState, 1); #else - ERROR_EXECUTION_THROW("No DOM support in Lua datamodel"); + ERROR_EXECUTION_THROW("No DOM support in Lua datamodel"); #endif } else { // _event.data is KVP @@ -409,7 +409,7 @@ void LuaDataModel::eval(const std::string& content) { } bool LuaDataModel::isLegalDataValue(const std::string& expr) { - return isValidSyntax("local __tmp = " + expr); + return isValidSyntax("local __tmp = " + expr); } bool LuaDataModel::isValidSyntax(const std::string& expr) { @@ -510,9 +510,9 @@ void LuaDataModel::assign(const std::string& location, const Data& data, const s if (data.node) { #ifndef NO_XERCESC - SWIG_Lua_NewPointerObj(_luaState, data.node, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_POINTER_DISOWN); - lua_setglobal(_luaState, "__tmpAssign"); - eval(location + "= __tmpAssign"); + SWIG_Lua_NewPointerObj(_luaState, data.node, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_POINTER_DISOWN); + lua_setglobal(_luaState, "__tmpAssign"); + eval(location + "= __tmpAssign"); #else ERROR_EXECUTION_THROW("Cannot assign xml nodes in lua datamodel"); #endif diff --git a/src/uscxml/plugins/datamodel/lua/LuaDataModel.h b/src/uscxml/plugins/datamodel/lua/LuaDataModel.h index 84633f1..9b4917b 100644 --- a/src/uscxml/plugins/datamodel/lua/LuaDataModel.h +++ b/src/uscxml/plugins/datamodel/lua/LuaDataModel.h @@ -62,7 +62,7 @@ public: } virtual bool isValidSyntax(const std::string& expr); - virtual bool isLegalDataValue(const std::string& expr); + virtual bool isLegalDataValue(const std::string& expr); virtual void setEvent(const Event& event); diff --git a/src/uscxml/plugins/datamodel/promela/PromelaDataModel.cpp b/src/uscxml/plugins/datamodel/promela/PromelaDataModel.cpp index 9f4f22f..c12491b 100644 --- a/src/uscxml/plugins/datamodel/promela/PromelaDataModel.cpp +++ b/src/uscxml/plugins/datamodel/promela/PromelaDataModel.cpp @@ -707,8 +707,8 @@ void PromelaDataModel::setEvent(const Event& event) { void PromelaDataModel::assign(const std::string& location, const Data& data, const std::map<std::string, std::string>& attr) { PromelaParser parser(location); if (data.atom.size() > 0 && data.type == Data::INTERPRETED) { - // e.g. Var1 = Var1 + 1 - setVariable(parser.ast, evalAsData(data.atom)); + // e.g. Var1 = Var1 + 1 + setVariable(parser.ast, evalAsData(data.atom)); } else { setVariable(parser.ast, data); } |