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/DocumentHandler.cpp | |
parent | 7907e9407f499354e0c3a0a402217b760fab9ad7 (diff) |
Declaring States in the Handler classes
Diffstat (limited to 'src/core/parser/stack/DocumentHandler.cpp')
-rw-r--r-- | src/core/parser/stack/DocumentHandler.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/core/parser/stack/DocumentHandler.cpp b/src/core/parser/stack/DocumentHandler.cpp index b28f0fb..9fedabb 100644 --- a/src/core/parser/stack/DocumentHandler.cpp +++ b/src/core/parser/stack/DocumentHandler.cpp @@ -16,8 +16,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "DocumentHandler.hpp" - #include <algorithm> #include <core/common/RttiBuilder.hpp> @@ -30,6 +28,9 @@ #include <core/parser/ParserScope.hpp> #include <core/parser/ParserContext.hpp> +#include "DocumentHandler.hpp" +#include "State.hpp" + namespace ousia { namespace parser_stack { @@ -274,6 +275,22 @@ bool DocumentChildHandler::data(Variant &data) } return true; } + +namespace States { +const State Document = StateBuilder() + .parent(&None) + .createdNodeType(&RttiTypes::Document) + .elementHandler(DocumentHandler::create) + .arguments({Argument::String("name", "")}); + +const State DocumentChild = + StateBuilder() + .parents({&Document, &DocumentChild}) + .createdNodeTypes({&RttiTypes::StructureNode, + &RttiTypes::AnnotationEntity, + &RttiTypes::DocumentField}) + .elementHandler(DocumentChildHandler::create); +} } namespace RttiTypes { |