mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
Work towards v1.0 data model with encapsulated weak_ptr as basis for instances
This commit is contained in:
@@ -26,16 +26,14 @@ import documentation
|
||||
|
||||
from collections import defaultdict
|
||||
|
||||
USE_VIRTUAL_INHERITANCE = True
|
||||
|
||||
class Header(codegen.Base):
|
||||
def __init__(self, mapping):
|
||||
declarations = []
|
||||
|
||||
case_lookup = lambda nm: [k for k in mapping.schema.keys if k.lower() == nm.lower()][0]
|
||||
case_normalize = lambda nm: nm if nm.startswith("IfcUtil::") else case_lookup(nm)
|
||||
case_normalize = lambda nm: nm if nm.startswith("express::") else case_lookup(nm)
|
||||
create_supertype_statement = lambda nms: ", ".join(
|
||||
"public %s %s" % ("" if c.startswith("IfcUtil::") else "", c) for c in nms
|
||||
"public %s %s" % ("" if c.startswith("express::") else "", c) for c in nms
|
||||
)
|
||||
|
||||
write = lambda str, **kwargs: declarations.append(
|
||||
@@ -43,7 +41,7 @@ class Header(codegen.Base):
|
||||
% dict({"documentation": templates.multi_line_comment(documentation.description(kwargs["name"]))}, **kwargs)
|
||||
)
|
||||
|
||||
forward_names = list(mapping.schema.entities.keys()) + list(mapping.schema.simpletypes.keys())
|
||||
forward_names = list(mapping.schema.entities.keys()) + list(mapping.schema.simpletypes.keys()) + list(mapping.schema.selects.keys())
|
||||
forward_definitions = "".join(["class %s; " % n for n in forward_names])
|
||||
|
||||
select_super_types = defaultdict(list)
|
||||
@@ -51,7 +49,20 @@ class Header(codegen.Base):
|
||||
for name, type in mapping.schema.selects.items():
|
||||
for nm in type.values:
|
||||
select_super_types[str(nm).lower()].append(name)
|
||||
write(templates.select_virtual if USE_VIRTUAL_INHERITANCE else templates.select_plain, name=name)
|
||||
|
||||
# Previously we used (virtual) inheritance, now we use casts to go from Base to Select.
|
||||
# Casts only go one conversion step deep, so we need to explicitly all descendant selected leafs.
|
||||
def visit_select(s):
|
||||
for x in map(str, s.values):
|
||||
yield x
|
||||
if mapping.schema.is_select(x):
|
||||
yield from visit_select(mapping.schema.selects[x])
|
||||
|
||||
write(templates.select,
|
||||
name=name,
|
||||
template_items="\n".join(templates.select_list_item % {'item_name': nm} for nm in visit_select(type)),
|
||||
cast_functions="\n".join(templates.select_cast_function % {'name': name, 'item_name': nm} for nm in visit_select(type)),
|
||||
)
|
||||
|
||||
def get_select_super_types(nm, bases=[]):
|
||||
x = list(select_super_types[nm.lower()])
|
||||
@@ -82,13 +93,15 @@ class Header(codegen.Base):
|
||||
all_superclasses.append(superclass)
|
||||
superclass = mapping.simple_type_parent(superclass)
|
||||
else:
|
||||
superclasses.append("IfcUtil::IfcBaseType")
|
||||
superclasses.append("express::DeclaredType")
|
||||
|
||||
if USE_VIRTUAL_INHERITANCE:
|
||||
superclasses.extend(get_select_super_types(name, bases=all_superclasses))
|
||||
# This is no longer used, previously virtual inheritance was used, now
|
||||
# a variant-like approach is used instead, so the definition of selects
|
||||
# is on the other side again, as it is in Express.
|
||||
# superclasses.extend(get_select_super_types(name, bases=all_superclasses))
|
||||
|
||||
is_emitted = (
|
||||
lambda nm: nm == "IfcUtil::IfcBaseType"
|
||||
lambda nm: nm == "express::DeclaredType"
|
||||
or nm in mapping.schema.selects
|
||||
or nm.lower() in emitted_simpletypes
|
||||
)
|
||||
@@ -99,7 +112,9 @@ class Header(codegen.Base):
|
||||
|
||||
emitted_simpletypes.add(name.lower())
|
||||
|
||||
superclass_statement = create_supertype_statement(superclasses)
|
||||
# with the v1 data model we're back to exactly one supertype, no more virtual inheritance to handle selects
|
||||
assert len(superclasses) == 1
|
||||
superclass_statement = superclasses[0]
|
||||
|
||||
write(
|
||||
templates.simpletype, name=name, type=type_str, attr_type=attr_type, superclass=superclass_statement
|
||||
@@ -128,7 +143,11 @@ class Header(codegen.Base):
|
||||
type_str = mapping.get_parameter_type(attr)
|
||||
if mapping.make_argument_type(attr) != "IfcUtil::Argument_UNKNOWN":
|
||||
attr_lines.append("%s %s() const;" % (type_str, attr.name))
|
||||
attr_lines.append("void set%s(%s v);" % (attr.name, type_str))
|
||||
attr_lines.append("void set%s(const %s& v);" % (attr.name, type_str))
|
||||
if type_str == 'std::optional< std::string >':
|
||||
# because a 2-step char[] -> std::string -> optional<string> is not allowed
|
||||
# attr_lines.append("void set%s(const %s& v);" % (attr.name, 'std::string'))
|
||||
pass
|
||||
|
||||
[write_method(attr) for attr in type.attributes]
|
||||
|
||||
@@ -157,11 +176,11 @@ class Header(codegen.Base):
|
||||
all_supertypes.append(tt.supertypes[0])
|
||||
tt = mapping.schema.entities[tt.supertypes[0]]
|
||||
|
||||
supertypes = list(type.supertypes) if len(type.supertypes) else ["IfcUtil::IfcBaseEntity"]
|
||||
if USE_VIRTUAL_INHERITANCE:
|
||||
supertypes.extend(get_select_super_types(name, bases=all_supertypes))
|
||||
supertypes = list(type.supertypes) if len(type.supertypes) else ["express::Entity"]
|
||||
# supertypes.extend(get_select_super_types(name, bases=all_supertypes))
|
||||
supertypes = list(map(case_normalize, supertypes))
|
||||
superclass = create_supertype_statement(supertypes)
|
||||
assert len(supertypes) == 1
|
||||
superclass = supertypes[0]
|
||||
|
||||
argument_count = mapping.argument_count(type)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ ENTITY file_name;
|
||||
organization : LIST [1:?] OF STRING (256);
|
||||
preprocessor_version : STRING (256);
|
||||
originating_system : STRING (256);
|
||||
authorisation : STRING (256);
|
||||
authorization : STRING (256);
|
||||
END_ENTITY;
|
||||
|
||||
ENTITY file_description;
|
||||
|
||||
@@ -22,8 +22,6 @@ import templates
|
||||
|
||||
from schema import OrderedCaseInsensitiveDict
|
||||
|
||||
from header import USE_VIRTUAL_INHERITANCE
|
||||
|
||||
|
||||
class Implementation(codegen.Base):
|
||||
def __init__(self, mapping):
|
||||
@@ -70,15 +68,14 @@ class Implementation(codegen.Base):
|
||||
),
|
||||
)
|
||||
|
||||
if USE_VIRTUAL_INHERITANCE:
|
||||
for name, enum in mapping.schema.selects.items():
|
||||
write(
|
||||
templates.select_function,
|
||||
name=name,
|
||||
schema_name=schema_name,
|
||||
schema_name_upper=schema_name_upper,
|
||||
index_in_schema=self.names.index(str(name)),
|
||||
)
|
||||
for name, enum in mapping.schema.selects.items():
|
||||
write(
|
||||
templates.select_function,
|
||||
name=name,
|
||||
schema_name=schema_name,
|
||||
schema_name_upper=schema_name_upper,
|
||||
index_in_schema=self.names.index(str(name)),
|
||||
)
|
||||
|
||||
write = lambda str, **kwargs: entity_implementations.append(str % kwargs)
|
||||
|
||||
@@ -101,7 +98,6 @@ class Implementation(codegen.Base):
|
||||
|
||||
def find_template(arg):
|
||||
simple = mapping.schema.is_simpletype(arg["list_instance_type"])
|
||||
select = arg["list_instance_type"] == "IfcUtil::IfcBaseClass"
|
||||
express = (
|
||||
mapping.flatten_type_string(arg["list_instance_type"]) in mapping.express_to_cpp_typemapping
|
||||
)
|
||||
@@ -109,9 +105,9 @@ class Implementation(codegen.Base):
|
||||
return templates.get_attr_stmt_enum
|
||||
elif arg["is_nested"] and arg["is_templated_list"]:
|
||||
return templates.get_attr_stmt_nested_array
|
||||
elif arg["is_templated_list"] and not (select or simple or express):
|
||||
elif arg["is_templated_list"] and not (simple or express):
|
||||
return templates.get_attr_stmt_array
|
||||
elif arg["non_optional_type"].endswith("*"):
|
||||
elif arg["argument_type_enum"] == 'IfcUtil::Argument_ENTITY_INSTANCE':
|
||||
return templates.get_attr_stmt_entity
|
||||
else:
|
||||
return templates.get_attr_stmt
|
||||
@@ -122,10 +118,10 @@ class Implementation(codegen.Base):
|
||||
"if(get_attribute_value(%d).isNull()) { return %%s; }"
|
||||
% (arg["index"] - 1,)
|
||||
)
|
||||
if "boost::optional" in arg["full_type"]:
|
||||
null_check = attr_check % "boost::none"
|
||||
if "std::optional" in arg["full_type"]:
|
||||
null_check = attr_check % "std::nullopt"
|
||||
else:
|
||||
null_check = attr_check % "nullptr"
|
||||
null_check = attr_check % (arg['full_type'] + "{}")
|
||||
|
||||
tmpl = find_template(arg)
|
||||
write_attr(
|
||||
@@ -151,13 +147,14 @@ class Implementation(codegen.Base):
|
||||
|
||||
def find_template(arg):
|
||||
simple = mapping.schema.is_simpletype(arg["list_instance_type"])
|
||||
select = arg["list_instance_type"] == "IfcUtil::IfcBaseClass"
|
||||
express = arg["list_instance_type"] in mapping.express_to_cpp_typemapping
|
||||
if arg["is_enum"]:
|
||||
return templates.set_attr_stmt_enum
|
||||
elif arg["is_templated_list"] and not (select or simple or express):
|
||||
elif arg["is_nested"] and arg["is_templated_list"]:
|
||||
return templates.set_attr_stmt_nested_array
|
||||
elif arg["is_templated_list"] and not (simple or express):
|
||||
return templates.set_attr_stmt_array
|
||||
elif arg["full_type"].endswith('*'):
|
||||
elif arg["argument_type_enum"] == 'IfcUtil::Argument_ENTITY_INSTANCE':
|
||||
return templates.set_attr_instance
|
||||
else:
|
||||
return templates.set_attr_stmt
|
||||
@@ -167,7 +164,7 @@ class Implementation(codegen.Base):
|
||||
templates.function,
|
||||
class_name=name,
|
||||
name="set%s" % arg["name"],
|
||||
arguments="%s v" % arg["full_type"],
|
||||
arguments="const %s& v" % arg["full_type"],
|
||||
return_type="void",
|
||||
schema_name=schema_name,
|
||||
schema_name_upper=schema_name_upper,
|
||||
@@ -176,10 +173,10 @@ class Implementation(codegen.Base):
|
||||
"index": arg["index"] - 1,
|
||||
"type": arg["full_type"].replace("::Value", ""),
|
||||
"non_optional_type": arg["non_optional_type"].replace("::Value", ""),
|
||||
"star_if_optional": "*" if "boost::optional" in arg["full_type"] else "",
|
||||
"check_optional_set_begin": "if (v) {" if "boost::optional" in arg["full_type"] else "",
|
||||
"check_optional_set_else": "} else {" if "boost::optional" in arg["full_type"] else "if constexpr (false)",
|
||||
"check_optional_set_end": "}" if "boost::optional" in arg["full_type"] else "",
|
||||
"star_if_optional": "*" if "std::optional" in arg["full_type"] else "",
|
||||
"check_optional_set_begin": "if (v) {" if "std::optional" in arg["full_type"] else "",
|
||||
"check_optional_set_else": "} else {" if "std::optional" in arg["full_type"] else "if constexpr (false)",
|
||||
"check_optional_set_end": "}" if "std::optional" in arg["full_type"] else "",
|
||||
},
|
||||
)
|
||||
|
||||
@@ -226,7 +223,7 @@ class Implementation(codegen.Base):
|
||||
"schema_name_upper": schema_name_upper,
|
||||
"name": i.name,
|
||||
"arguments": "",
|
||||
"return_type": "::%s::%s::list::ptr" % (schema_name, i.entity),
|
||||
"return_type": "std::vector<::%s::%s>" % (schema_name, i.entity),
|
||||
"body": templates.get_inverse
|
||||
% {
|
||||
"type": i.entity,
|
||||
@@ -240,15 +237,15 @@ class Implementation(codegen.Base):
|
||||
]
|
||||
|
||||
superclass = (
|
||||
"%s(std::move(e))" % type.supertypes[0]
|
||||
"%s(e)" % type.supertypes[0]
|
||||
if len(type.supertypes) == 1
|
||||
else "IfcUtil::IfcBaseEntity(std::move(e))"
|
||||
else "express::Entity(e)"
|
||||
)
|
||||
|
||||
superclass_num_attrs = (
|
||||
"%s(IfcEntityInstanceData(in_memory_attribute_storage(%%d)))" % type.supertypes[0]
|
||||
"%s(const std::weak_ptr<InstanceData>&(in_memory_attribute_storage(%%d)))" % type.supertypes[0]
|
||||
if len(type.supertypes) == 1
|
||||
else "IfcUtil::IfcBaseEntity(IfcEntityInstanceData(in_memory_attribute_storage(%d)))"
|
||||
else "express::Entity(const std::weak_ptr<InstanceData>&(in_memory_attribute_storage(%d)))"
|
||||
) % len(constructor_arguments)
|
||||
|
||||
write(
|
||||
@@ -313,7 +310,7 @@ class Implementation(codegen.Base):
|
||||
for class_name, type in mapping.schema.simpletypes.items():
|
||||
type_str = mapping.make_type_string(mapping.flatten_type_string(type))
|
||||
attr_type = mapping.make_argument_type(type)
|
||||
superclass = mapping.simple_type_parent(class_name) or "IfcUtil::IfcBaseType"
|
||||
superclass = mapping.simple_type_parent(class_name) or "express::DeclaredType"
|
||||
|
||||
simpletype_impl_is = (
|
||||
templates.simpletype_impl_is_with_supertype
|
||||
@@ -358,24 +355,24 @@ class Implementation(codegen.Base):
|
||||
(),
|
||||
templates.simpletype_impl_class,
|
||||
),
|
||||
(
|
||||
"",
|
||||
"declaration",
|
||||
templates.const_function,
|
||||
"const IfcParse::type_declaration&",
|
||||
(),
|
||||
templates.simpletype_impl_declaration,
|
||||
),
|
||||
(
|
||||
"std::move(e)",
|
||||
"",
|
||||
constructor,
|
||||
"",
|
||||
("IfcEntityInstanceData&& e",),
|
||||
"",
|
||||
),
|
||||
("", "", constructor, "", ("%s v" % type_str,), ("set_attribute_value(0, v%s);" % ("->generalize()" if mapping.is_templated_list(type) else ""))) if mapping.simple_type_parent(class_name) is None else \
|
||||
("v", "", constructor, "", ("%s v" % type_str,), ""),
|
||||
# (
|
||||
# "",
|
||||
# "declaration",
|
||||
# templates.const_function,
|
||||
# "const IfcParse::type_declaration&",
|
||||
# (),
|
||||
# templates.simpletype_impl_declaration,
|
||||
# ),
|
||||
# (
|
||||
# "e",
|
||||
# "",
|
||||
# constructor,
|
||||
# "",
|
||||
# ("const std::weak_ptr<InstanceData>& e",),
|
||||
# "",
|
||||
# ),
|
||||
# ("", "", constructor, "", ("%s v" % type_str,), ("set_attribute_value(0, v%s);" % ("->generalize()" if mapping.is_templated_list(type) else ""))) if mapping.simple_type_parent(class_name) is None else \
|
||||
# ("v", "", constructor, "", ("%s v" % type_str,), ""),
|
||||
("", "", templates.cast_function, type_str, (), simpletype_impl_cast),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -23,8 +23,6 @@ import nodes
|
||||
import templates
|
||||
import schema
|
||||
|
||||
from header import USE_VIRTUAL_INHERITANCE
|
||||
|
||||
class Mapping:
|
||||
|
||||
express_to_cpp_typemapping = {
|
||||
@@ -177,15 +175,8 @@ class Mapping:
|
||||
elif isinstance(type_str, nodes.AggregationType):
|
||||
is_nested_list = isinstance(attr_type.type, nodes.AggregationType)
|
||||
ty = self.get_parameter_type(attr_type.type if is_nested_list else attr_type)
|
||||
# We do not use pointers in aggregate_of<T>. aggregate_of has member vector<T*>
|
||||
ty = ty.replace("*", "")
|
||||
|
||||
# https://github.com/IfcOpenShell/IfcOpenShell/issues/2805
|
||||
# We do support statically typed select types as aggregates when USE_VIRTUAL_INHERITANCE=True
|
||||
|
||||
if not USE_VIRTUAL_INHERITANCE and self.schema.is_select(attr_type.type):
|
||||
type_str = templates.untyped_list
|
||||
elif self.schema.is_simpletype(ty) or str(ty) in self.express_to_cpp_typemapping.values():
|
||||
if self.schema.is_simpletype(ty) or str(ty) in self.express_to_cpp_typemapping.values():
|
||||
tmpl = templates.nested_array_type if is_nested_list else templates.array_type
|
||||
bounds = (attr_type.bounds.lower, attr_type.bounds.upper) if attr_type.bounds else (-1, -1)
|
||||
type_str = tmpl % {"instance_type": ty, "lower": bounds[0], "upper": bounds[1]}
|
||||
@@ -193,11 +184,11 @@ class Mapping:
|
||||
tmpl = templates.list_list_type if is_nested_list else templates.list_type
|
||||
type_str = tmpl % {"instance_type": ty}
|
||||
elif self.schema.is_entity(type_str) or self.schema.is_select(type_str):
|
||||
type_str = "::%s::%s*" % (self.schema.name.capitalize(), attr_type)
|
||||
type_str = "::%s::%s" % (self.schema.name.capitalize(), attr_type)
|
||||
is_ptr = True
|
||||
if allow_optional and attr.optional and not is_ptr:
|
||||
# pointers are still handled with nullptr for the time being
|
||||
type_str = "boost::optional< %s >" % type_str
|
||||
type_str = "std::optional< %s >" % type_str
|
||||
return type_str
|
||||
|
||||
def argument_count(self, t):
|
||||
@@ -224,8 +215,6 @@ class Mapping:
|
||||
isinstance(v, nodes.SimpleType) and isinstance(v.type, nodes.StringType)
|
||||
):
|
||||
return "string"
|
||||
if not USE_VIRTUAL_INHERITANCE and self.schema.is_select(v):
|
||||
return "IfcUtil::IfcBaseClass"
|
||||
if str(v) in self.schema.types or str(v) in self.schema.entities:
|
||||
return "::%s::%s" % (self.schema.name.capitalize(), v)
|
||||
else:
|
||||
@@ -254,8 +243,8 @@ class Mapping:
|
||||
arr = self.is_array(attr_type)
|
||||
simple = self.schema.is_simpletype(ty)
|
||||
express = self.flatten_type_string(ty) in self.express_to_cpp_typemapping
|
||||
select = ty == "IfcUtil::IfcBaseClass"
|
||||
return arr and not simple and not express and not select
|
||||
# select = ty == "IfcUtil::IfcBaseClass"
|
||||
return arr and not simple and not express
|
||||
|
||||
def get_assignable_arguments(self, t, include_derived=False):
|
||||
count = self.argument_count(t)
|
||||
|
||||
@@ -738,7 +738,7 @@ class AttributeGetattrTransformer(ast.NodeTransformer):
|
||||
while n := getattr(n, "parent", 0):
|
||||
parents.append(n)
|
||||
|
||||
custom_funcs = "is_entity", "usedin", "express_len", "express_getitem", "typeof"
|
||||
custom_funcs = "is_entity", "usedin", "express_len", "express_getitem", "typeof", "express_getattr"
|
||||
function_defs = [p.name for p in parents if isinstance(p, ast.FunctionDef)]
|
||||
if any(fn in function_defs for fn in custom_funcs):
|
||||
return node
|
||||
@@ -755,7 +755,7 @@ class AttributeGetattrTransformer(ast.NodeTransformer):
|
||||
# Replace the Attribute node with a call to the built-in `getattr` function
|
||||
return ast.copy_location(
|
||||
ast.Call(
|
||||
func=ast.Name(id="getattr", ctx=ast.Load()),
|
||||
func=ast.Name(id="express_getattr", ctx=ast.Load()),
|
||||
args=[
|
||||
new_value,
|
||||
ast.Str(s=node.attr),
|
||||
@@ -772,7 +772,7 @@ class AttributeGetattrTransformer(ast.NodeTransformer):
|
||||
while n := getattr(n, "parent", 0):
|
||||
parents.append(n)
|
||||
|
||||
custom_funcs = "is_entity", "usedin", "express_len", "express_getitem", "typeof"
|
||||
custom_funcs = "is_entity", "usedin", "express_len", "express_getitem", "typeof", "express_getattr"
|
||||
function_defs = [p.name for p in parents if isinstance(p, ast.FunctionDef)]
|
||||
if any(fn in function_defs for fn in custom_funcs):
|
||||
return node
|
||||
@@ -937,6 +937,14 @@ def express_getitem(aggr, idx, default):
|
||||
except IndexError as e: return None
|
||||
|
||||
|
||||
def express_getattr(aggr, name, default):
|
||||
v = getattr(aggr, name, default)
|
||||
if v is None:
|
||||
return default
|
||||
else:
|
||||
return v
|
||||
|
||||
|
||||
EXPRESS_ONE_BASED_INDEXING = 1
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ from codegen import indent
|
||||
|
||||
|
||||
def reverse_compile(s):
|
||||
return re.sub(
|
||||
return re.sub(r'\bself\b', 'SELF', re.sub(
|
||||
r"\s*\-\s*EXPRESS_ONE_BASED_INDEXING",
|
||||
"",
|
||||
re.sub(
|
||||
@@ -22,11 +22,11 @@ def reverse_compile(s):
|
||||
.replace("len(", "SIZEOF(")
|
||||
.replace("assert ", "")
|
||||
.replace(" is not False", "")
|
||||
.replace("getattr(", "")
|
||||
.replace("express_getattr(", "")
|
||||
.replace("express_getitem(", ""),
|
||||
)[::-1],
|
||||
)[::-1],
|
||||
)
|
||||
))
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
@@ -2,173 +2,173 @@
|
||||
|
||||
:: python bootstrap.py express.bnf > express_parser.py
|
||||
|
||||
IF EXIST IFC2X3_TC1.exp (
|
||||
python express_parser.py IFC2X3_TC1.exp header implementation schema_class definitions
|
||||
|
||||
IF EXIST Ifc2x3-schema.cpp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc2x3.cpp txt/header_ifc2x3.txt Ifc2x3.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc2x3.h txt/header_ifc2x3.txt Ifc2x3.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc2x3-schema.cpp txt/header_ifc2x3.txt Ifc2x3-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc2x3-definitions.h txt/header_ifc2x3.txt Ifc2x3-definitions.h
|
||||
) ELSE (
|
||||
:: v0.5.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc2x3.cpp txt/header_ifc2x3.txt txt/ifndef_ifc4.txt Ifc2x3.cpp txt/endif.txt
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc2x3.h txt/header_ifc2x3.txt Ifc2x3.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc2x3enum.h txt/header_ifc2x3.txt Ifc2x3enum.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc2x3-latebound.cpp txt/header_ifc2x3.txt txt/ifndef_ifc4.txt Ifc2x3-latebound.cpp txt/endif.txt
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc2x3-latebound.h txt/header_ifc2x3.txt Ifc2x3-latebound.h
|
||||
)
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
IF EXIST IFC4_ADD2TC1.exp (
|
||||
python express_parser.py IFC4_ADD2TC1.exp header implementation schema_class definitions
|
||||
|
||||
IF EXIST Ifc4-schema.cpp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4.cpp txt/header_ifc4.txt Ifc4.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4.h txt/header_ifc4.txt Ifc4.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4-schema.cpp txt/header_ifc4.txt Ifc4-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4-definitions.h txt/header_ifc4.txt Ifc4-definitions.h
|
||||
) ELSE (
|
||||
:: v0.5.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4.cpp txt/header_ifc4.txt txt/ifdef_ifc4.txt Ifc4.cpp txt/endif.txt
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4.h txt/header_ifc4.txt Ifc4.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4enum.h txt/header_ifc4.txt Ifc4enum.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4-latebound.cpp txt/header_ifc4.txt txt/ifdef_ifc4.txt Ifc4-latebound.cpp txt/endif.txt
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4-latebound.h txt/header_ifc4.txt Ifc4-latebound.h
|
||||
)
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
IF EXIST IFC4x1.exp (
|
||||
python express_parser.py IFC4x1.exp header implementation schema_class definitions
|
||||
|
||||
IF EXIST Ifc4x1-schema.cpp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x1.cpp txt/header_ifc4x1.txt Ifc4x1.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x1.h txt/header_ifc4x1.txt Ifc4x1.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x1-schema.cpp txt/header_ifc4x1.txt Ifc4x1-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x1-definitions.h txt/header_ifc4x1.txt Ifc4x1-definitions.h
|
||||
)
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
IF EXIST IFC4x2.exp (
|
||||
python express_parser.py IFC4x2.exp header implementation schema_class definitions
|
||||
|
||||
IF EXIST Ifc4x2-schema.cpp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x2.cpp txt/header_ifc4x2.txt Ifc4x2.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x2.h txt/header_ifc4x2.txt Ifc4x2.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x2-schema.cpp txt/header_ifc4x2.txt Ifc4x2-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x2-definitions.h txt/header_ifc4x2.txt Ifc4x2-definitions.h
|
||||
)
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
IF EXIST IFC4x3_RC1.exp (
|
||||
python express_parser.py IFC4x3_RC1.exp header implementation schema_class definitions
|
||||
|
||||
IF EXIST Ifc4x3_rc1-schema.cpp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1.cpp txt/header_ifc4x3_rc1.txt Ifc4x3_rc1.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1.h txt/header_ifc4x3_rc1.txt Ifc4x3_rc1.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1-schema.cpp txt/header_ifc4x3_rc1.txt Ifc4x3_rc1-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1-definitions.h txt/header_ifc4x3_rc1.txt Ifc4x3_rc1-definitions.h
|
||||
)
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
IF EXIST IFC4x3_RC2.exp (
|
||||
python express_parser.py IFC4x3_RC2.exp header implementation schema_class definitions
|
||||
|
||||
IF EXIST Ifc4x3_rc2-schema.cpp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc2.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc2.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc2-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2-definitions.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc2-definitions.h
|
||||
)
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
IF EXIST IFC4x3_RC3.exp (
|
||||
python express_parser.py IFC4x3_RC3.exp header implementation schema_class definitions
|
||||
|
||||
IF EXIST Ifc4x3_rc3-schema.cpp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc3.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc3.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc3-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3-definitions.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc3-definitions.h
|
||||
)
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
IF EXIST IFC4x3_RC4.exp (
|
||||
python express_parser.py IFC4x3_RC4.exp header implementation schema_class definitions
|
||||
|
||||
IF EXIST Ifc4x3_rc4-schema.cpp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc4.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc4.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc4-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4-definitions.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc4-definitions.h
|
||||
)
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
IF EXIST IFC4X3.exp (
|
||||
python express_parser.py IFC4X3.exp header implementation schema_class definitions
|
||||
|
||||
IF EXIST Ifc4x3-schema.cpp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3.cpp txt/header_ifc4x3_rc2.txt Ifc4x3.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3.h txt/header_ifc4x3_rc2.txt Ifc4x3.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3-definitions.h txt/header_ifc4x3_rc2.txt Ifc4x3-definitions.h
|
||||
)
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
IF EXIST IFC4X3_TC1.exp (
|
||||
python express_parser.py IFC4X3_TC1.exp header implementation schema_class definitions
|
||||
|
||||
IF EXIST Ifc4x3_tc1-schema.cpp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1.cpp txt/header_ifc4x3_tc1.txt Ifc4x3_tc1.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1.h txt/header_ifc4x3_tc1.txt Ifc4x3_tc1.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1-schema.cpp txt/header_ifc4x3_tc1.txt Ifc4x3_tc1-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1-definitions.h txt/header_ifc4x3_tc1.txt Ifc4x3_tc1-definitions.h
|
||||
)
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
IF EXIST IFC4X3_ADD1.exp (
|
||||
python express_parser.py IFC4X3_ADD1.exp header implementation schema_class definitions
|
||||
|
||||
IF EXIST Ifc4x3_add1-schema.cpp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1.cpp txt/header_ifc4x3_add1.txt Ifc4x3_add1.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1.h txt/header_ifc4x3_add1.txt Ifc4x3_add1.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1-schema.cpp txt/header_ifc4x3_add1.txt Ifc4x3_add1-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1-definitions.h txt/header_ifc4x3_add1.txt Ifc4x3_add1-definitions.h
|
||||
)
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
:: IF EXIST IFC2X3_TC1.exp (
|
||||
:: python express_parser.py IFC2X3_TC1.exp header implementation schema_class definitions
|
||||
::
|
||||
:: IF EXIST Ifc2x3-schema.cpp (
|
||||
:: :: v0.6.0
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc2x3.cpp txt/header_ifc2x3.txt Ifc2x3.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc2x3.h txt/header_ifc2x3.txt Ifc2x3.h
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc2x3-schema.cpp txt/header_ifc2x3.txt Ifc2x3-schema.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc2x3-definitions.h txt/header_ifc2x3.txt Ifc2x3-definitions.h
|
||||
:: ) ELSE (
|
||||
:: :: v0.5.0
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc2x3.cpp txt/header_ifc2x3.txt txt/ifndef_ifc4.txt Ifc2x3.cpp txt/endif.txt
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc2x3.h txt/header_ifc2x3.txt Ifc2x3.h
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc2x3enum.h txt/header_ifc2x3.txt Ifc2x3enum.h
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc2x3-latebound.cpp txt/header_ifc2x3.txt txt/ifndef_ifc4.txt Ifc2x3-latebound.cpp txt/endif.txt
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc2x3-latebound.h txt/header_ifc2x3.txt Ifc2x3-latebound.h
|
||||
:: )
|
||||
::
|
||||
:: del *.cpp *.h
|
||||
:: )
|
||||
::
|
||||
:: IF EXIST IFC4_ADD2TC1.exp (
|
||||
:: python express_parser.py IFC4_ADD2TC1.exp header implementation schema_class definitions
|
||||
::
|
||||
:: IF EXIST Ifc4-schema.cpp (
|
||||
:: :: v0.6.0
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4.cpp txt/header_ifc4.txt Ifc4.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4.h txt/header_ifc4.txt Ifc4.h
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4-schema.cpp txt/header_ifc4.txt Ifc4-schema.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4-definitions.h txt/header_ifc4.txt Ifc4-definitions.h
|
||||
:: ) ELSE (
|
||||
:: :: v0.5.0
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4.cpp txt/header_ifc4.txt txt/ifdef_ifc4.txt Ifc4.cpp txt/endif.txt
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4.h txt/header_ifc4.txt Ifc4.h
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4enum.h txt/header_ifc4.txt Ifc4enum.h
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4-latebound.cpp txt/header_ifc4.txt txt/ifdef_ifc4.txt Ifc4-latebound.cpp txt/endif.txt
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4-latebound.h txt/header_ifc4.txt Ifc4-latebound.h
|
||||
:: )
|
||||
::
|
||||
:: del *.cpp *.h
|
||||
:: )
|
||||
::
|
||||
:: IF EXIST IFC4x1.exp (
|
||||
:: python express_parser.py IFC4x1.exp header implementation schema_class definitions
|
||||
::
|
||||
:: IF EXIST Ifc4x1-schema.cpp (
|
||||
:: :: v0.6.0
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x1.cpp txt/header_ifc4x1.txt Ifc4x1.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x1.h txt/header_ifc4x1.txt Ifc4x1.h
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x1-schema.cpp txt/header_ifc4x1.txt Ifc4x1-schema.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x1-definitions.h txt/header_ifc4x1.txt Ifc4x1-definitions.h
|
||||
:: )
|
||||
::
|
||||
:: del *.cpp *.h
|
||||
:: )
|
||||
::
|
||||
:: IF EXIST IFC4x2.exp (
|
||||
:: python express_parser.py IFC4x2.exp header implementation schema_class definitions
|
||||
::
|
||||
:: IF EXIST Ifc4x2-schema.cpp (
|
||||
:: :: v0.6.0
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x2.cpp txt/header_ifc4x2.txt Ifc4x2.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x2.h txt/header_ifc4x2.txt Ifc4x2.h
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x2-schema.cpp txt/header_ifc4x2.txt Ifc4x2-schema.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x2-definitions.h txt/header_ifc4x2.txt Ifc4x2-definitions.h
|
||||
:: )
|
||||
::
|
||||
:: del *.cpp *.h
|
||||
:: )
|
||||
::
|
||||
:: IF EXIST IFC4x3_RC1.exp (
|
||||
:: python express_parser.py IFC4x3_RC1.exp header implementation schema_class definitions
|
||||
::
|
||||
:: IF EXIST Ifc4x3_rc1-schema.cpp (
|
||||
:: :: v0.6.0
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1.cpp txt/header_ifc4x3_rc1.txt Ifc4x3_rc1.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1.h txt/header_ifc4x3_rc1.txt Ifc4x3_rc1.h
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1-schema.cpp txt/header_ifc4x3_rc1.txt Ifc4x3_rc1-schema.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1-definitions.h txt/header_ifc4x3_rc1.txt Ifc4x3_rc1-definitions.h
|
||||
:: )
|
||||
::
|
||||
:: del *.cpp *.h
|
||||
:: )
|
||||
::
|
||||
:: IF EXIST IFC4x3_RC2.exp (
|
||||
:: python express_parser.py IFC4x3_RC2.exp header implementation schema_class definitions
|
||||
::
|
||||
:: IF EXIST Ifc4x3_rc2-schema.cpp (
|
||||
:: :: v0.6.0
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc2.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc2.h
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc2-schema.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2-definitions.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc2-definitions.h
|
||||
:: )
|
||||
::
|
||||
:: del *.cpp *.h
|
||||
:: )
|
||||
::
|
||||
:: IF EXIST IFC4x3_RC3.exp (
|
||||
:: python express_parser.py IFC4x3_RC3.exp header implementation schema_class definitions
|
||||
::
|
||||
:: IF EXIST Ifc4x3_rc3-schema.cpp (
|
||||
:: :: v0.6.0
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc3.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc3.h
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc3-schema.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3-definitions.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc3-definitions.h
|
||||
:: )
|
||||
::
|
||||
:: del *.cpp *.h
|
||||
:: )
|
||||
::
|
||||
:: IF EXIST IFC4x3_RC4.exp (
|
||||
:: python express_parser.py IFC4x3_RC4.exp header implementation schema_class definitions
|
||||
::
|
||||
:: IF EXIST Ifc4x3_rc4-schema.cpp (
|
||||
:: :: v0.6.0
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc4.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc4.h
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc4-schema.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4-definitions.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc4-definitions.h
|
||||
:: )
|
||||
::
|
||||
:: del *.cpp *.h
|
||||
:: )
|
||||
::
|
||||
:: IF EXIST IFC4X3.exp (
|
||||
:: python express_parser.py IFC4X3.exp header implementation schema_class definitions
|
||||
::
|
||||
:: IF EXIST Ifc4x3-schema.cpp (
|
||||
:: :: v0.6.0
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3.cpp txt/header_ifc4x3_rc2.txt Ifc4x3.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3.h txt/header_ifc4x3_rc2.txt Ifc4x3.h
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3-schema.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3-definitions.h txt/header_ifc4x3_rc2.txt Ifc4x3-definitions.h
|
||||
:: )
|
||||
::
|
||||
:: del *.cpp *.h
|
||||
:: )
|
||||
::
|
||||
:: IF EXIST IFC4X3_TC1.exp (
|
||||
:: python express_parser.py IFC4X3_TC1.exp header implementation schema_class definitions
|
||||
::
|
||||
:: IF EXIST Ifc4x3_tc1-schema.cpp (
|
||||
:: :: v0.6.0
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1.cpp txt/header_ifc4x3_tc1.txt Ifc4x3_tc1.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1.h txt/header_ifc4x3_tc1.txt Ifc4x3_tc1.h
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1-schema.cpp txt/header_ifc4x3_tc1.txt Ifc4x3_tc1-schema.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1-definitions.h txt/header_ifc4x3_tc1.txt Ifc4x3_tc1-definitions.h
|
||||
:: )
|
||||
::
|
||||
:: del *.cpp *.h
|
||||
:: )
|
||||
::
|
||||
:: IF EXIST IFC4X3_ADD1.exp (
|
||||
:: python express_parser.py IFC4X3_ADD1.exp header implementation schema_class definitions
|
||||
::
|
||||
:: IF EXIST Ifc4x3_add1-schema.cpp (
|
||||
:: :: v0.6.0
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1.cpp txt/header_ifc4x3_add1.txt Ifc4x3_add1.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1.h txt/header_ifc4x3_add1.txt Ifc4x3_add1.h
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1-schema.cpp txt/header_ifc4x3_add1.txt Ifc4x3_add1-schema.cpp
|
||||
:: python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1-definitions.h txt/header_ifc4x3_add1.txt Ifc4x3_add1-definitions.h
|
||||
:: )
|
||||
::
|
||||
:: del *.cpp *.h
|
||||
:: )
|
||||
|
||||
IF EXIST IFC4X3_ADD2.exp (
|
||||
python express_parser.py IFC4X3_ADD2.exp header implementation schema_class definitions
|
||||
@@ -183,3 +183,17 @@ IF EXIST IFC4X3_ADD2.exp (
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
IF EXIST header_schema.exp (
|
||||
python express_parser.py header_schema.exp header implementation schema_class definitions
|
||||
|
||||
IF EXIST Header_section_schema-schema.cpp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Header_section_schema.cpp Header_section_schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Header_section_schema.h Header_section_schema.h
|
||||
python cat.py -o ..\..\..\ifcparse\Header_section_schema-schema.cpp Header_section_schema-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Header_section_schema-definitions.h Header_section_schema-definitions.h
|
||||
)
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
@@ -178,7 +178,7 @@ class EarlyBoundCodeWriter:
|
||||
num_names = len(self.names)
|
||||
self.statements.append("declaration* %(schema_name)s_types[%(num_names)d] = {nullptr};" % locals())
|
||||
|
||||
self.statements.append("{factory_placeholder}")
|
||||
# self.statements.append("{factory_placeholder}")
|
||||
|
||||
# self.statements.append(
|
||||
# """
|
||||
@@ -285,7 +285,7 @@ class EarlyBoundCodeWriter:
|
||||
declarations = ",".join(_())
|
||||
schema_name_ref = self.strings.append(schema_name)
|
||||
self.statements.append(
|
||||
' return new schema_definition(%(schema_name_ref)s, {%(declarations)s}, new %(schema_name)s_instance_factory());'
|
||||
' return new schema_definition(%(schema_name_ref)s, {%(declarations)s});'
|
||||
% locals()
|
||||
)
|
||||
self.statements.append("}");
|
||||
@@ -340,16 +340,17 @@ class EarlyBoundCodeWriter:
|
||||
)
|
||||
)
|
||||
|
||||
self.statements[self.statements.index("{factory_placeholder}")] = (
|
||||
"""
|
||||
class %(schema_name)s_instance_factory : public IfcParse::instance_factory {
|
||||
virtual IfcUtil::IfcBaseClass* operator()(const IfcParse::declaration* decl, IfcEntityInstanceData&& data) const {
|
||||
%(instance_mapping)s
|
||||
}
|
||||
};
|
||||
"""
|
||||
% locals()
|
||||
)
|
||||
# Factor no longer exists because we don't have virtual methods anymore.
|
||||
# self.statements[self.statements.index("{factory_placeholder}")] = (
|
||||
# """
|
||||
# class %(schema_name)s_instance_factory : public IfcParse::instance_factory {
|
||||
# virtual IfcUtil::IfcBaseClass* operator()(const IfcParse::declaration* decl, const std::weak_ptr<InstanceData>& data) const {
|
||||
# %(instance_mapping)s
|
||||
# }
|
||||
# };
|
||||
# """
|
||||
# % locals()
|
||||
# )
|
||||
|
||||
""
|
||||
self.statements[self.statements.index("{string_pool_placeholder}")] = (
|
||||
|
||||
@@ -23,17 +23,20 @@ header = """
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include "../ifcparse/ifc_parse_api.h"
|
||||
|
||||
#include "../ifcparse/aggregate_of_instance.h"
|
||||
#include "../ifcparse/IfcBaseClass.h"
|
||||
#include "../ifcparse/express.h"
|
||||
#include "../ifcparse/IfcSchema.h"
|
||||
#include "../ifcparse/IfcException.h"
|
||||
#include "../ifcparse/Argument.h"
|
||||
|
||||
namespace IfcParse {
|
||||
class IfcFile;
|
||||
class IfcSpfHeader;
|
||||
} // namespace IfcParse
|
||||
|
||||
struct %(schema_name)s {
|
||||
|
||||
IFC_PARSE_API static const IfcParse::schema_definition& get_schema();
|
||||
@@ -60,7 +63,7 @@ enum_header = """
|
||||
#include "../ifcparse/ifc_parse_api.h"
|
||||
|
||||
#include <string>
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#endif
|
||||
"""
|
||||
@@ -108,12 +111,14 @@ derived_field_statement = " {std::set<int> idxs; %(statements)sderived_map[Ty
|
||||
derived_field_statement_attrs = "idxs.insert(%d); "
|
||||
|
||||
simpletype = """%(documentation)s
|
||||
class IFC_PARSE_API %(name)s : %(superclass)s {
|
||||
class IFC_PARSE_API %(name)s : public %(superclass)s {
|
||||
public:
|
||||
virtual const IfcParse::type_declaration& declaration() const;
|
||||
%(name)s() {}
|
||||
explicit %(name)s (const std::weak_ptr<InstanceData>& data) : %(superclass)s(data) {}
|
||||
|
||||
// virtual const IfcParse::type_declaration& declaration() const;
|
||||
static const IfcParse::type_declaration& Class();
|
||||
explicit %(name)s (IfcEntityInstanceData&& e);
|
||||
%(name)s (%(type)s v);
|
||||
// %(name)s (%(type)s v);
|
||||
operator %(type)s() const;
|
||||
};
|
||||
"""
|
||||
@@ -127,51 +132,60 @@ simpletype_impl_type = "return *((IfcParse::type_declaration*)%(schema_name_uppe
|
||||
simpletype_impl_class = "return *((IfcParse::type_declaration*)%(schema_name_upper)s_types[%(index_in_schema)d]);"
|
||||
simpletype_impl_explicit_constructor = "data_ = e;"
|
||||
simpletype_impl_constructor = (
|
||||
"data_ = new IfcEntityInstanceData(%(schema_name_upper)s_types[%(index_in_schema)d]); set_attribute_value(0, v);"
|
||||
"data_ = new const std::weak_ptr<InstanceData>&(%(schema_name_upper)s_types[%(index_in_schema)d]); set_attribute_value(0, v);"
|
||||
)
|
||||
simpletype_impl_constructor_templated = "data_ = new IfcEntityInstanceData(%(schema_name_upper)s_types[%(index_in_schema)d]); set_attribute_value(0, v->generalize());"
|
||||
simpletype_impl_constructor_templated = "data_ = new const std::weak_ptr<InstanceData>&(%(schema_name_upper)s_types[%(index_in_schema)d]); set_attribute_value(0, v->generalize());"
|
||||
simpletype_impl_cast = "return get_attribute_value(0);"
|
||||
simpletype_impl_cast_templated = (
|
||||
"aggregate_of_instance::ptr es = get_attribute_value(0); return es->as< %(underlying_type)s >();"
|
||||
)
|
||||
simpletype_impl_cast_templated = "std::vector<express::Base> es = get_attribute_value(0); return cast_vector<%(underlying_type)s>(es);"
|
||||
|
||||
simpletype_impl_declaration = "return *((IfcParse::type_declaration*)%(schema_name_upper)s_types[%(index_in_schema)d]);"
|
||||
|
||||
select_virtual = """%(documentation)s
|
||||
class IFC_PARSE_API %(name)s : public virtual IfcUtil::IfcBaseInterface {
|
||||
select = """%(documentation)s
|
||||
class IFC_PARSE_API %(name)s : public express::Select {
|
||||
public:
|
||||
%(name)s() {}
|
||||
explicit %(name)s(const express::Base& c) : express::Select(c) {}
|
||||
|
||||
static const IfcParse::select_type& Class();
|
||||
typedef aggregate_of< %(name)s > list;
|
||||
%(template_items)s
|
||||
%(cast_functions)s
|
||||
};
|
||||
"""
|
||||
|
||||
select_plain = """%(documentation)s
|
||||
typedef IfcUtil::IfcBaseClass %(name)s;
|
||||
select_list_item = """ template<class T, std::enable_if_t<std::is_same_v<T, %(item_name)s>, int> = 0>
|
||||
%(item_name)s as() const { return express::Base::as<%(item_name)s>(); }
|
||||
"""
|
||||
|
||||
enumeration = """class IFC_PARSE_API %(name)s : public IfcUtil::IfcBaseType {
|
||||
%(documentation)s
|
||||
select_cast_function = """ %(name)s(const %(item_name)s& c) : express::Select(c) {};
|
||||
"""
|
||||
|
||||
enumeration = """%(documentation)s
|
||||
class IFC_PARSE_API %(name)s : public express::DeclaredType {
|
||||
public:
|
||||
%(name)s() {}
|
||||
explicit %(name)s (const std::weak_ptr<InstanceData>& data) : express::DeclaredType(data) {}
|
||||
|
||||
typedef enum {%(values)s} Value;
|
||||
static const char* ToString(Value v);
|
||||
static Value FromString(const std::string& s);
|
||||
|
||||
virtual const IfcParse::enumeration_type& declaration() const;
|
||||
// virtual const IfcParse::enumeration_type& declaration() const;
|
||||
static const IfcParse::enumeration_type& Class();
|
||||
%(name)s (IfcEntityInstanceData&& e);
|
||||
%(name)s (Value v);
|
||||
%(name)s (const std::string& v);
|
||||
// %(name)s (Value v);
|
||||
// %(name)s (const std::string& v);
|
||||
operator Value() const;
|
||||
};
|
||||
"""
|
||||
|
||||
entity = """%(documentation)s
|
||||
class IFC_PARSE_API %(name)s : %(superclass)s {
|
||||
class IFC_PARSE_API %(name)s : public %(superclass)s {
|
||||
public:
|
||||
%(attributes)s %(inverse)s virtual const IfcParse::entity& declaration() const;
|
||||
%(name)s() {}
|
||||
explicit %(name)s (const std::weak_ptr<InstanceData>& data) : %(superclass)s(data) {}
|
||||
|
||||
%(attributes)s %(inverse)s // virtual const IfcParse::entity& declaration() const;
|
||||
static const IfcParse::entity& Class();
|
||||
%(name)s (IfcEntityInstanceData&& e);
|
||||
%(name)s (%(constructor_arguments)s);
|
||||
typedef aggregate_of< %(name)s > list;
|
||||
// %(name)s (%(constructor_arguments)s);
|
||||
};
|
||||
"""
|
||||
|
||||
@@ -180,20 +194,22 @@ const IfcParse::select_type& %(schema_name)s::%(name)s::Class() { return *((IfcP
|
||||
"""
|
||||
|
||||
enumeration_function = """
|
||||
const IfcParse::enumeration_type& %(schema_name)s::%(name)s::declaration() const { return *((IfcParse::enumeration_type*)%(schema_name_upper)s_types[%(index_in_schema)d]); }
|
||||
// const IfcParse::enumeration_type& %(schema_name)s::%(name)s::declaration() const { return *((IfcParse::enumeration_type*)%(schema_name_upper)s_types[%(index_in_schema)d]); }
|
||||
const IfcParse::enumeration_type& %(schema_name)s::%(name)s::Class() { return *((IfcParse::enumeration_type*)%(schema_name_upper)s_types[%(index_in_schema)d]); }
|
||||
|
||||
%(schema_name)s::%(name)s::%(name)s(IfcEntityInstanceData&& e)
|
||||
: IfcBaseType(std::move(e))
|
||||
/*
|
||||
%(schema_name)s::%(name)s::%(name)s(const std::weak_ptr<InstanceData>& e)
|
||||
: express::DeclaredType(e)
|
||||
{}
|
||||
|
||||
%(schema_name)s::%(name)s::%(name)s(Value v) {
|
||||
set_attribute_value(0, EnumerationReference(&declaration(), static_cast<size_t>(v)));
|
||||
set_attribute_value(0, EnumerationReference(&Class(), static_cast<size_t>(v)));
|
||||
}
|
||||
|
||||
%(schema_name)s::%(name)s::%(name)s(const std::string& v) {
|
||||
set_attribute_value(0, EnumerationReference(&declaration(), declaration().lookup_enum_offset(v)));
|
||||
set_attribute_value(0, EnumerationReference(&Class(), Class().lookup_enum_offset(v)));
|
||||
}
|
||||
*/
|
||||
|
||||
const char* %(schema_name)s::%(name)s::ToString(Value v) {
|
||||
return %(schema_name)s::%(name)s::%(name)s::Class().lookup_enum_value((size_t)v);
|
||||
@@ -211,14 +227,14 @@ const char* %(schema_name)s::%(name)s::ToString(Value v) {
|
||||
entity_implementation = """// Function implementations for %(name)s
|
||||
%(attributes)s
|
||||
%(inverse)s
|
||||
const IfcParse::entity& %(schema_name)s::%(name)s::declaration() const { return *((IfcParse::entity*)%(schema_name_upper)s_types[%(index_in_schema)d]); }
|
||||
// const IfcParse::entity& %(schema_name)s::%(name)s::declaration() const { return *((IfcParse::entity*)%(schema_name_upper)s_types[%(index_in_schema)d]); }
|
||||
const IfcParse::entity& %(schema_name)s::%(name)s::Class() { return *((IfcParse::entity*)%(schema_name_upper)s_types[%(index_in_schema)d]); }
|
||||
%(schema_name)s::%(name)s::%(name)s(IfcEntityInstanceData&& e) : %(superclass)s { }
|
||||
%(schema_name)s::%(name)s::%(name)s(%(constructor_arguments)s) : %(superclass_num_attrs)s { %(constructor_implementation)s; populate_derived(); }
|
||||
// %(schema_name)s::%(name)s::%(name)s(const std::weak_ptr<InstanceData>& e) : %(superclass)s { }
|
||||
// %(schema_name)s::%(name)s::%(name)s(%(constructor_arguments)s) : %(superclass_num_attrs)s { %(constructor_implementation)s; populate_derived(); }
|
||||
"""
|
||||
|
||||
# data_ = e;
|
||||
# data_ = new IfcEntityInstanceData(%(schema_name_upper)s_types[%(index_in_schema)d]);
|
||||
# data_ = new const std::weak_ptr<InstanceData>&(%(schema_name_upper)s_types[%(index_in_schema)d]);
|
||||
|
||||
optional_attribute_description = "/// Whether the optional attribute %s is defined for this %s"
|
||||
|
||||
@@ -232,10 +248,10 @@ cast_function = "%(schema_name)s::%(class_name)s::operator %(return_type)s() con
|
||||
|
||||
array_type = "std::vector< %(instance_type)s > /*[%(lower)s:%(upper)s]*/"
|
||||
nested_array_type = "std::vector< std::vector< %(instance_type)s > >"
|
||||
list_type = "aggregate_of< %(instance_type)s >::ptr"
|
||||
list_list_type = "aggregate_of_aggregate_of< %(instance_type)s >::ptr"
|
||||
list_type = "std::vector< %(instance_type)s >"
|
||||
list_list_type = "std::vector< std::vector< %(instance_type)s > >"
|
||||
untyped_list = "aggregate_of_instance::ptr"
|
||||
inverse_attr = "aggregate_of< %(entity)s >::ptr %(name)s() const; // INVERSE %(entity)s::%(attribute)s"
|
||||
inverse_attr = "std::vector< %(entity)s > %(name)s() const; // INVERSE %(entity)s::%(attribute)s"
|
||||
|
||||
enum_from_string_stmt = ' if (s == "%(value)s") return ::%(schema_name)s::%(name)s::%(short_name)s_%(value)s;'
|
||||
|
||||
@@ -249,21 +265,24 @@ optional_attr_stmt = "return !get_attribute_value(%(index)d).isNull();"
|
||||
|
||||
get_attr_stmt = "%(null_check)s %(non_optional_type)s v = get_attribute_value(%(index)d); return v;"
|
||||
get_attr_stmt_enum = "%(null_check)s return %(non_optional_type)s::FromString(get_attribute_value(%(index)d));"
|
||||
get_attr_stmt_entity = "%(null_check)s return ((IfcUtil::IfcBaseClass*)(get_attribute_value(%(index)d)))->as<%(non_optional_type_no_pointer)s>(true);"
|
||||
get_attr_stmt_array = "%(null_check)s aggregate_of_instance::ptr es = get_attribute_value(%(index)d); return es->as< %(list_instance_type)s >();"
|
||||
get_attr_stmt_nested_array = "%(null_check)s aggregate_of_aggregate_of_instance::ptr es = get_attribute_value(%(index)d); return es->as< %(list_instance_type)s >();"
|
||||
get_attr_stmt_entity = "%(null_check)s return ((express::Base)(get_attribute_value(%(index)d))).as<%(non_optional_type_no_pointer)s>();"
|
||||
get_attr_stmt_array = "%(null_check)s std::vector<express::Base> es = get_attribute_value(%(index)d); return cast_vector<%(list_instance_type)s>(es);"
|
||||
get_attr_stmt_nested_array = "%(null_check)s std::vector<std::vector<express::Base>> es = get_attribute_value(%(index)d); return cast_vector_vector<%(list_instance_type)s>(es);"
|
||||
|
||||
get_inverse = "if (!file_) { return nullptr; } return file_->getInverse(id_, %(schema_name_upper)s_types[%(type_index)d], %(index)d)->as<%(type)s>();"
|
||||
get_inverse = "return cast_vector<%(type)s>(data()->file()->getInverse(data()->id(), %(schema_name_upper)s_types[%(type_index)d], %(index)d));"
|
||||
|
||||
set_attr_stmt = (
|
||||
"%(check_optional_set_begin)sset_attribute_value(%(index)d, %(star_if_optional)sv);%(check_optional_set_else)sunset_attribute_value(%(index)d);%(check_optional_set_end)s"
|
||||
)
|
||||
set_attr_instance = (
|
||||
"%(check_optional_set_begin)sset_attribute_value(%(index)d, v->as<IfcUtil::IfcBaseClass>());%(check_optional_set_else)sunset_attribute_value(%(index)d);%(check_optional_set_end)s"
|
||||
"%(check_optional_set_begin)sset_attribute_value(%(index)d, v);%(check_optional_set_else)sunset_attribute_value(%(index)d);%(check_optional_set_end)s"
|
||||
)
|
||||
set_attr_stmt_enum = "%(check_optional_set_begin)sset_attribute_value(%(index)d, EnumerationReference(&%(non_optional_type)s::Class(), (size_t) %(star_if_optional)sv));%(check_optional_set_else)sunset_attribute_value(%(index)d);%(check_optional_set_end)s"
|
||||
set_attr_stmt_array = (
|
||||
"%(check_optional_set_begin)sset_attribute_value(%(index)d, (%(star_if_optional)sv)->generalize());%(check_optional_set_else)sunset_attribute_value(%(index)d);%(check_optional_set_end)s"
|
||||
"%(check_optional_set_begin)sset_attribute_value(%(index)d, cast_vector<express::Base>(%(star_if_optional)sv));%(check_optional_set_else)sunset_attribute_value(%(index)d);%(check_optional_set_end)s"
|
||||
)
|
||||
set_attr_stmt_nested_array = (
|
||||
"%(check_optional_set_begin)sset_attribute_value(%(index)d, cast_vector_vector<express::Base>(%(star_if_optional)sv));%(check_optional_set_else)sunset_attribute_value(%(index)d);%(check_optional_set_end)s"
|
||||
)
|
||||
|
||||
constructor_stmt = (
|
||||
@@ -289,3 +308,5 @@ inverse_implementation = ' inverse_map[Type::%(type)s].insert(std::make_pair(
|
||||
|
||||
def multi_line_comment(li):
|
||||
return ("/// %s" % ("\n/// ".join(li))) if len(li) else ""
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user