diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-02-15 20:57:27 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-02-15 20:57:27 +0100 |
commit | e2e32eef55406519c744002a404e7e5ca66b29a1 (patch) | |
tree | 41069921dd771cd5a308cda0a996bdb5dc1c772a /src/core/parser/stack/ImportIncludeHandler.cpp | |
parent | 7907e9407f499354e0c3a0a402217b760fab9ad7 (diff) |
Declaring States in the Handler classes
Diffstat (limited to 'src/core/parser/stack/ImportIncludeHandler.cpp')
-rw-r--r-- | src/core/parser/stack/ImportIncludeHandler.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/core/parser/stack/ImportIncludeHandler.cpp b/src/core/parser/stack/ImportIncludeHandler.cpp index 797dd8d..d1ea97d 100644 --- a/src/core/parser/stack/ImportIncludeHandler.cpp +++ b/src/core/parser/stack/ImportIncludeHandler.cpp @@ -16,12 +16,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "ImportIncludeHandler.hpp" - #include <core/model/RootNode.hpp> #include <core/parser/ParserScope.hpp> #include <core/parser/ParserContext.hpp> +#include "DomainHandler.hpp" +#include "DocumentHandler.hpp" +#include "ImportIncludeHandler.hpp" +#include "State.hpp" +#include "TypesystemHandler.hpp" + namespace ousia { namespace parser_stack { @@ -58,5 +62,21 @@ void IncludeHandler::doHandle(const Variant &fieldData, Variant::mapType &args) context().include(fieldData.asString(), args["type"].asString(), args["rel"].asString(), {&RttiTypes::Node}); } + +namespace States { +const State Import = + StateBuilder() + .parents({&Document, &Typesystem, &Domain}) + .elementHandler(ImportHandler::create) + .arguments({Argument::String("rel", ""), Argument::String("type", ""), + Argument::String("src", "")}); + +const State Include = + StateBuilder() + .parent(&All) + .elementHandler(IncludeHandler::create) + .arguments({Argument::String("rel", ""), Argument::String("type", ""), + Argument::String("src", "")}); +} } } |