summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-11 17:51:50 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-11 17:51:50 +0100
commitf812e01570aedd5033245a76846b5afc0063bc17 (patch)
tree012cbf8bc2dc482be094d789dd433ec4523c120b /src/plugins
parent5659292bf1a317235a51a946df640376f325b124 (diff)
made isSubtree (fieldType) and primitivity orthogonal concepts: PRIMITIVE is no FieldType anymore.
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/xml/XmlParser.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/plugins/xml/XmlParser.cpp b/src/plugins/xml/XmlParser.cpp
index e8e97e2..22498f4 100644
--- a/src/plugins/xml/XmlParser.cpp
+++ b/src/plugins/xml/XmlParser.cpp
@@ -575,7 +575,7 @@ public:
Rooted<Descriptor> parent = scope().selectOrThrow<Descriptor>();
Rooted<FieldDescriptor> field = parent->createFieldDescriptor(
- type, args["name"].asString(), args["optional"].asBool());
+ logger(), type, args["name"].asString(), args["optional"].asBool());
field->setLocation(location());
scope().push(field);
@@ -624,8 +624,16 @@ public:
{
Rooted<Descriptor> parent = scope().selectOrThrow<Descriptor>();
+ FieldDescriptor::FieldType fieldType;
+ if (args["isSubtree"].asBool()) {
+ fieldType = FieldDescriptor::FieldType::SUBTREE;
+ } else {
+ fieldType = FieldDescriptor::FieldType::TREE;
+ }
+
Rooted<FieldDescriptor> field = parent->createPrimitiveFieldDescriptor(
- nullptr, args["name"].asString(), args["optional"].asBool());
+ nullptr, logger(), fieldType, args["name"].asString(),
+ args["optional"].asBool());
field->setLocation(location());
const std::string &type = args["type"].asString();
@@ -742,7 +750,7 @@ public:
if (parent != nullptr) {
Rooted<FieldDescriptor> field =
parent.cast<Descriptor>()->createFieldDescriptor(
- type, name, optional);
+ logger, type, name, optional);
field->addChild(strct.cast<StructuredClass>());
}
});
@@ -978,6 +986,7 @@ static const ParserState DomainStructPrimitive =
.createdNodeType(&RttiTypes::FieldDescriptor)
.elementHandler(DomainPrimitiveHandler::create)
.arguments({Argument::String("name", DEFAULT_FIELD_NAME),
+ Argument::Bool("isSubtree", false),
Argument::Bool("optional", false),
Argument::String("type")});