summaryrefslogtreecommitdiff
path: root/src/core/parser/stack/OntologyHandler.hpp
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-03-01 20:47:25 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-03-01 20:47:25 +0100
commita7019614896fdd3e29b9a28f6a8cfd2c1b365983 (patch)
tree8a9f102649e88ebf24de0a07cf5f348804a6212d /src/core/parser/stack/OntologyHandler.hpp
parent0d4ce5c555a1ba3a87cb9a1e350854eda7a243e1 (diff)
Renamed domain to ontology.
Diffstat (limited to 'src/core/parser/stack/OntologyHandler.hpp')
-rw-r--r--src/core/parser/stack/OntologyHandler.hpp257
1 files changed, 257 insertions, 0 deletions
diff --git a/src/core/parser/stack/OntologyHandler.hpp b/src/core/parser/stack/OntologyHandler.hpp
new file mode 100644
index 0000000..caeacc7
--- /dev/null
+++ b/src/core/parser/stack/OntologyHandler.hpp
@@ -0,0 +1,257 @@
+/*
+ Ousía
+ Copyright (C) 2014, 2015 Benjamin Paaßen, Andreas Stöckel
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * @file OntologyHandler.hpp
+ *
+ * Contains the Handler classes used for parsing Ontology descriptors. This
+ * includes the "ontology" tag and all describing tags below the "ontology" tag.
+ *
+ * @author Benjamin Paaßen (bpaassen@techfak.uni-bielefeld.de)
+ */
+
+#ifndef _OUSIA_DOMAIN_HANDLER_HPP_
+#define _OUSIA_DOMAIN_HANDLER_HPP_
+
+#include <core/common/Variant.hpp>
+#include <core/model/Node.hpp>
+
+#include "Handler.hpp"
+
+namespace ousia {
+
+// Forward declarations
+class Rtti;
+
+namespace parser_stack {
+
+// TODO: Documentation
+
+class OntologyHandler : public StaticHandler {
+public:
+ using StaticHandler::StaticHandler;
+
+ bool start(Variant::mapType &args) override;
+ void end() override;
+
+ static Handler *create(const HandlerData &handlerData)
+ {
+ return new OntologyHandler{handlerData};
+ }
+};
+
+class OntologyStructHandler : public StaticHandler {
+public:
+ using StaticHandler::StaticHandler;
+
+ bool start(Variant::mapType &args) override;
+ void end() override;
+
+ static Handler *create(const HandlerData &handlerData)
+ {
+ return new OntologyStructHandler{handlerData};
+ }
+};
+
+class OntologyAnnotationHandler : public StaticHandler {
+public:
+ using StaticHandler::StaticHandler;
+
+ bool start(Variant::mapType &args) override;
+ void end() override;
+
+ static Handler *create(const HandlerData &handlerData)
+ {
+ return new OntologyAnnotationHandler{handlerData};
+ }
+};
+
+class OntologyAttributesHandler : public StaticHandler {
+public:
+ using StaticHandler::StaticHandler;
+
+ bool start(Variant::mapType &args) override;
+ void end() override;
+
+ static Handler *create(const HandlerData &handlerData)
+ {
+ return new OntologyAttributesHandler{handlerData};
+ }
+};
+
+class OntologyFieldHandler : public StaticHandler {
+public:
+ using StaticHandler::StaticHandler;
+
+ bool start(Variant::mapType &args) override;
+ void end() override;
+
+ static Handler *create(const HandlerData &handlerData)
+ {
+ return new OntologyFieldHandler{handlerData};
+ }
+};
+
+class OntologyFieldRefHandler : public StaticHandler {
+public:
+ using StaticHandler::StaticHandler;
+
+ bool start(Variant::mapType &args) override;
+ void end() override;
+
+ static Handler *create(const HandlerData &handlerData)
+ {
+ return new OntologyFieldRefHandler{handlerData};
+ }
+};
+
+class OntologyPrimitiveHandler : public StaticHandler {
+public:
+ using StaticHandler::StaticHandler;
+
+ bool start(Variant::mapType &args) override;
+ void end() override;
+
+ static Handler *create(const HandlerData &handlerData)
+ {
+ return new OntologyPrimitiveHandler{handlerData};
+ }
+};
+
+class OntologyChildHandler : public StaticHandler {
+public:
+ using StaticHandler::StaticHandler;
+
+ bool start(Variant::mapType &args) override;
+
+ static Handler *create(const HandlerData &handlerData)
+ {
+ return new OntologyChildHandler{handlerData};
+ }
+};
+
+class OntologyParent : public Node {
+public:
+ using Node::Node;
+};
+
+class OntologyParentHandler : public StaticHandler {
+public:
+ using StaticHandler::StaticHandler;
+
+ bool start(Variant::mapType &args) override;
+ void end() override;
+
+ static Handler *create(const HandlerData &handlerData)
+ {
+ return new OntologyParentHandler{handlerData};
+ }
+};
+
+class OntologyParentFieldHandler : public StaticHandler {
+public:
+ using StaticHandler::StaticHandler;
+
+ bool start(Variant::mapType &args) override;
+
+ static Handler *create(const HandlerData &handlerData)
+ {
+ return new OntologyParentFieldHandler{handlerData};
+ }
+};
+
+class OntologyParentFieldRefHandler : public StaticHandler {
+public:
+ using StaticHandler::StaticHandler;
+
+ bool start(Variant::mapType &args) override;
+
+ static Handler *create(const HandlerData &handlerData)
+ {
+ return new OntologyParentFieldRefHandler{handlerData};
+ }
+};
+
+namespace States {
+/**
+ * State representing a "ontology" struct.
+ */
+extern const State Ontology;
+
+/**
+ * State representing a "struct" tag within a ontology description.
+ */
+extern const State OntologyStruct;
+
+/**
+ * State representing an "annotation" tag within a ontology description.
+ */
+extern const State OntologyAnnotation;
+
+/**
+ * State representing an "attributes" tag within a structure or annotation.
+ */
+extern const State OntologyAttributes;
+
+/**
+ * State representing an "attribute" tag within the "attributes".
+ */
+extern const State OntologyAttribute;
+
+/**
+ * State representing a "field" tag within a structure or annotation.
+ */
+extern const State OntologyField;
+
+/**
+ * State representing a "fieldref" tag within a structure or annotation.
+ */
+extern const State OntologyFieldRef;
+
+/**
+ * State representing a "primitive" tag within a structure or annotation.
+ */
+extern const State OntologyStructPrimitive;
+
+/**
+ * State representing a "child" tag within a structure or annotation.
+ */
+extern const State OntologyStructChild;
+
+/**
+ * State representing a "parent" tag within a structure or annotation.
+ */
+extern const State OntologyStructParent;
+
+/**
+ * State representing a "field" tag within a "parent" tag.
+ */
+extern const State OntologyStructParentField;
+
+/**
+ * State representing a "fieldRef" tag within a "parent" tag.
+ */
+extern const State OntologyStructParentFieldRef;
+}
+}
+
+namespace RttiTypes {
+extern const Rtti OntologyParent;
+}
+}
+#endif