Reintroduce binary type in express parser

This commit is contained in:
Thomas Krijnen
2015-05-21 12:53:17 +00:00
parent 37d4e9bcbd
commit 3d6b330366
4 changed files with 13 additions and 3 deletions
+1
View File
@@ -114,6 +114,7 @@ actions = {
'aggregation_types' : "lambda t: AggregationType(t)",
'general_aggregation_types' : "lambda t: AggregationType(t)",
'select_type' : "lambda t: SelectType(t)",
'binary_type' : "lambda t: BinaryType(t)",
'subtype_declaration' : "lambda t: SubtypeExpression(t)",
'derive_clause' : "lambda t: AttributeList('derive', t)",
'derived_attr' : "lambda t: DerivedAttribute(t)",
+3 -1
View File
@@ -77,7 +77,7 @@ class Mapping:
def make_argument_entity(self, attr):
type = attr.type if hasattr(attr, 'type') else attr
while isinstance(type, nodes.AggregationType): type = type.type
if type in self.express_to_cpp_typemapping: return "Type::UNDEFINED"
if str(type) in self.express_to_cpp_typemapping: return "Type::UNDEFINED"
else: return "Type::%s" % type
def make_argument_type(self, attr):
@@ -88,6 +88,8 @@ class Mapping:
return "ENTITY_INSTANCE"
elif self.schema.is_type(type):
return _make_argument_type(self.schema.types[type].type.type)
elif isinstance(type, nodes.BinaryType):
return "BINARY"
elif isinstance(type, nodes.EnumerationType):
return "ENUMERATION"
elif isinstance(type, nodes.AggregationType):
+7
View File
@@ -145,6 +145,13 @@ class DerivedAttribute(Node):
return str(self.name)
class BinaryType(Node):
def init(self):
pass
def __repr__(self):
return "binary"
class BoundSpecification(Node):
lower = property(lambda self: self.tokens[1])
upper = property(lambda self: self.tokens[3])
+2 -2
View File
@@ -7366,8 +7366,8 @@ bool IfcPropertySetDefinitionSet::is(Type::Enum v) const { return v == IfcProper
Type::Enum IfcPropertySetDefinitionSet::type() const { return Type::IfcPropertySetDefinitionSet; }
Type::Enum IfcPropertySetDefinitionSet::Class() { return Type::IfcPropertySetDefinitionSet; }
IfcPropertySetDefinitionSet::IfcPropertySetDefinitionSet(IfcAbstractEntity* e) { entity = e; }
IfcPropertySetDefinitionSet::IfcPropertySetDefinitionSet(IfcTemplatedEntityList< IfcPropertySetDefinition >::ptr v) { IfcWritableEntity* e = new IfcWritableEntity(Type::IfcPropertySetDefinitionSet); e->setArgument(0, v); entity = e; }
IfcPropertySetDefinitionSet::operator IfcTemplatedEntityList< IfcPropertySetDefinition >::ptr() const { return *entity->getArgument(0); }
IfcPropertySetDefinitionSet::IfcPropertySetDefinitionSet(IfcTemplatedEntityList< IfcPropertySetDefinition >::ptr v) { IfcWritableEntity* e = new IfcWritableEntity(Type::IfcPropertySetDefinitionSet); e->setArgument(0, v->generalize()); entity = e; }
IfcPropertySetDefinitionSet::operator IfcTemplatedEntityList< IfcPropertySetDefinition >::ptr() const { IfcEntityList::ptr es = *entity->getArgument(0); return es->as<IfcPropertySetDefinition>(); }
// Function implementations for IfcRadioActivityMeasure
IfcUtil::ArgumentType IfcRadioActivityMeasure::getArgumentType(unsigned int i) const { if (i == 0) { return IfcUtil::Argument_DOUBLE; } else { throw IfcParse::IfcException("argument out of range"); } }