mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-08 08:51:35 +00:00
Compare commits
60 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 92f9bd5938 | |||
| 71a598e63a | |||
| 3d8115ebc5 | |||
| b5a0f1fc74 | |||
| 25441bd816 | |||
| 65811ac7c9 | |||
| d9d1824886 | |||
| 16e5f18553 | |||
| b7a9b7bc5a | |||
| e14397058d | |||
| f0117c60b3 | |||
| 0e5223a30d | |||
| bc41ff78f4 | |||
| 9123d8c183 | |||
| ffd939508c | |||
| 9213b31235 | |||
| 2155e3206f | |||
| 9e0c6cf524 | |||
| d5dc069b2f | |||
| 821cf7b671 | |||
| e01979187a | |||
| 816eba5145 | |||
| 4963bddd06 | |||
| 8718db63da | |||
| c013b9aca7 | |||
| 24e454ce0c | |||
| cb497b37f7 | |||
| 71c6950a59 | |||
| 5a8aa0a659 | |||
| f4526d152f | |||
| a7a7edfd27 | |||
| 6ca8c8ac94 | |||
| 5273569b08 | |||
| 78712ead98 | |||
| 6efb8a4373 | |||
| 9e25c12b16 | |||
| 0968d06780 | |||
| 3a8619726b | |||
| 1b1da821f1 | |||
| d772b24bd6 | |||
| 549f81a76e | |||
| e5c7206a37 | |||
| 5b968d5c75 | |||
| 6075187720 | |||
| 92528d84cd | |||
| 3955718145 | |||
| 501246cd0b | |||
| 1b863ff8be | |||
| dcd88b6cdd | |||
| fb8b2ee878 | |||
| 8a00ce84cc | |||
| 4032bbbd17 | |||
| d728f09d86 | |||
| 3e9ef82448 | |||
| a5c77fd096 | |||
| 56ed79792e | |||
| 9c91727402 | |||
| d183961280 | |||
| d30c25010c | |||
| 97d1a6e488 |
@@ -109,7 +109,7 @@ jobs:
|
||||
# Ensure Bonsai and ifcsverchok enable/disable works before uploading to extensions repo.
|
||||
|
||||
# Download Blender.
|
||||
wget -q -O blender.tar.xz https://download.blender.org/release/Blender5.1/blender-5.1.0-linux-x64.tar.xz
|
||||
wget -q -O blender.tar.xz https://download.blender.org/release/Blender5.2/blender-5.2.0-linux-x64.tar.xz
|
||||
tar -xf blender.tar.xz
|
||||
|
||||
# Setup Blender.
|
||||
@@ -179,8 +179,7 @@ jobs:
|
||||
blender --online-mode --command extension install --enable --sync sun_position
|
||||
|
||||
cd IfcOpenShell/src/bonsai
|
||||
pip install pytest-blender
|
||||
pip install pytest-bdd
|
||||
pip install -r requirements-dev.txt
|
||||
blender --background --python scripts/setup_pytest.py
|
||||
blender --python-expr "import bonsai; print(bonsai.bbim_semver); import ifcopenshell; print(ifcopenshell.version)" --background
|
||||
make test
|
||||
|
||||
@@ -27,10 +27,7 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
uv tool install ruff
|
||||
uv tool install black
|
||||
uv tool install poethepoet
|
||||
uv tool install ty==0.0.34
|
||||
cat requirements-tools.txt | xargs -L1 uv tool install
|
||||
|
||||
# black doesn't catch all syntax errors, so we check them explicitly.
|
||||
- name: Check syntax errors
|
||||
@@ -58,11 +55,17 @@ jobs:
|
||||
black --diff --check . | black-codeclimate | python .github/workflows/black_to_github_annotations.py
|
||||
continue-on-error: true
|
||||
|
||||
- name: ty check
|
||||
id: ty
|
||||
run: |
|
||||
poe ty-venv
|
||||
poe ty
|
||||
- name: ty check (venv setup)
|
||||
run: poe ty-venv
|
||||
|
||||
- name: ty check (bonsai)
|
||||
id: ty-bonsai
|
||||
run: poe ty-bonsai
|
||||
continue-on-error: true
|
||||
|
||||
- name: ty check (ios)
|
||||
id: ty-ios
|
||||
run: poe ty-ios
|
||||
continue-on-error: true
|
||||
|
||||
- name: Ruff check
|
||||
@@ -112,7 +115,10 @@ jobs:
|
||||
if [ "${{ steps.ruff.outcome }}" != "success" ]; then
|
||||
echo "::error::Ruff check failed, see Summary or 'ruff' step for the details." && ERROR=1
|
||||
fi
|
||||
if [ "${{ steps.ty.outcome }}" != "success" ]; then
|
||||
echo "::error::ty check failed, see 'ty check' step for the details." && ERROR=1
|
||||
if [ "${{ steps.ty-bonsai.outcome }}" != "success" ]; then
|
||||
echo "::error::ty check (bonsai) failed, see 'ty check (bonsai)' step for the details." && ERROR=1
|
||||
fi
|
||||
if [ "${{ steps.ty-ios.outcome }}" != "success" ]; then
|
||||
echo "::error::ty check (ios) failed, see 'ty check (ios)' step for the details." && ERROR=1
|
||||
fi
|
||||
exit $ERROR
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
__pycache__
|
||||
*.py.bak
|
||||
venv
|
||||
uv.lock
|
||||
|
||||
# Visual Studio Code files
|
||||
.vscode
|
||||
|
||||
@@ -563,8 +563,8 @@ if(COMPILE_SCHEMA)
|
||||
# Bootstrap the parser
|
||||
message(STATUS "Compiling schema, this will take a while...")
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} bootstrap.py express.bnf
|
||||
WORKING_DIRECTORY ../src/ifcexpressparser
|
||||
COMMAND ${PYTHON_EXECUTABLE} bootstrap.py
|
||||
WORKING_DIRECTORY ../src/ifcopenshell-python/ifcopenshell/express
|
||||
OUTPUT_FILE express_parser.py
|
||||
RESULT_VARIABLE SUCCESS
|
||||
)
|
||||
@@ -575,7 +575,7 @@ if(COMPILE_SCHEMA)
|
||||
|
||||
# Generate code
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} ../ifcexpressparser/express_parser.py ../../${COMPILE_SCHEMA}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ../ifcopenshell-python/ifcopenshell/express/express_parser.py ../../${COMPILE_SCHEMA}
|
||||
WORKING_DIRECTORY ../src/ifcparse
|
||||
OUTPUT_VARIABLE COMPILED_SCHEMA_NAME
|
||||
)
|
||||
|
||||
+15
-5
@@ -50,7 +50,7 @@ Used environment variables:
|
||||
- ``NO_CLEAN`` - do not clean `ifcopenshell` build directories but continue working on current build
|
||||
(installed dependencies are never cleared).
|
||||
By default option is disabled, to enable pass any value from `1`, `on`, `true`.
|
||||
- ``IFCOS_SCHEMAS`` - schemas to be built; defaults to cmake default (IFC2X3; IFC4; IFC4X3_ADD2) - to be supplied as `2x3;4`
|
||||
- ``IFCOS_SCHEMAS`` - schemas to be built; defaults to cmake default (8 schemas), to be supplied as `2x3;4;4x3_add2`
|
||||
- ``USE_OCCT`` - whether to use official Open CASCADE instead of Community Edition
|
||||
(`true` by default, any other value is considered `false`)
|
||||
- ``WASM_PYTHON_PATH`` - path to WASM Python installation,
|
||||
@@ -155,7 +155,7 @@ MPFR_VERSION = "3.1.6" # latest is 4.1.0
|
||||
CGAL_VERSION = "v5.6.3"
|
||||
USD_VERSION = "23.05"
|
||||
TBB_VERSION = "2021.9.0"
|
||||
ROCKSDB_VERSION = "9.11.2"
|
||||
ROCKSDB_VERSION = "10.4.2"
|
||||
ZSTD_VERSION = "1.5.7"
|
||||
# binaries
|
||||
cp = "cp"
|
||||
@@ -627,9 +627,10 @@ def build_dependency(
|
||||
build_tool_args: "list[str]",
|
||||
download_url: str,
|
||||
download_name: str,
|
||||
*,
|
||||
download_tool: Literal["py", "git"] = download_tool_default,
|
||||
revision: "Union[str, None]" = None,
|
||||
patch: "Union[str, list[str], None]" = None,
|
||||
patch: list[str] | None = None,
|
||||
shell=None,
|
||||
pre_compile_subs: "Sequence[tuple[str, str, str]]" = (),
|
||||
additional_files: "Union[dict[str, str], None]" = None,
|
||||
@@ -714,8 +715,6 @@ def build_dependency(
|
||||
urlretrieve(url, os.path.join(extract_dir, path))
|
||||
|
||||
if patch is not None:
|
||||
if isinstance(patch, str):
|
||||
patch = [patch]
|
||||
for p in patch:
|
||||
patch_abs = (SCRIPT_PATH / p).absolute().__str__()
|
||||
if os.path.exists(patch_abs):
|
||||
@@ -724,6 +723,8 @@ def build_dependency(
|
||||
except Exception as e:
|
||||
# Assert that the patch has already been applied
|
||||
run(["patch", "-p1", "--batch", "--reverse", "--dry-run", "-i", patch_abs], cwd=extract_dir)
|
||||
else:
|
||||
raise FileNotFoundError(patch_abs)
|
||||
|
||||
if shell is not None:
|
||||
sp.run(shell, shell=True, check=True, cwd=extract_dir)
|
||||
@@ -1171,6 +1172,14 @@ if "cgal" in targets:
|
||||
os.environ["CC"] = MAC_CROSS_COMPILE_INTEL_CC
|
||||
gmp_args.extend(MAC_CROSS_COMPILE_INTEL_AUTOCONF_HOST_ARGS)
|
||||
|
||||
# Fixes configure failing to find a working compiler under GCC 15's default -std=gnu23.
|
||||
# Issue presumably will be resolved in any next gmp version, but currently the last one is 6.3.0.
|
||||
# Patch is just applying fix from upstream meantion below:
|
||||
# https://gmplib.org/list-archives/gmp-bugs/2025-February/005561.html
|
||||
gmp_patches = ["./patches/gmp/001-fix-std23.patch"]
|
||||
if GMP_VERSION != "6.3.0":
|
||||
raise Exception(f"GMP_VERSION changed to {GMP_VERSION}, check whether {gmp_patches} is still needed.")
|
||||
|
||||
build_dependency(
|
||||
name=f"gmp-{GMP_VERSION}",
|
||||
mode="autoconf",
|
||||
@@ -1178,6 +1187,7 @@ if "cgal" in targets:
|
||||
pre_compile_subs=(
|
||||
[("build/config.h", "HAVE_OBSTACK_VPRINTF 1", "HAVE_OBSTACK_VPRINTF 0")] if "wasm" in flags else []
|
||||
),
|
||||
patch=gmp_patches,
|
||||
# Sometimes ftp.gnu.org is very slow, use ftpmirror.gnu.org as a workaround.
|
||||
download_url="https://ftpmirror.gnu.org/gnu/gmp/",
|
||||
download_name=f"gmp-{GMP_VERSION}.tar.bz2",
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
Fixes configure failing to find a working compiler under GCC 15's default
|
||||
-std=gnu23 (upstream fix: https://gmplib.org/repo/gmp/rev/8e7bb4ae7a18).
|
||||
|
||||
Upstream fix is patching `acinclude.m4`, but since in the release tarball
|
||||
all macros are already expanded to `configure` script, so we're patching
|
||||
all occurrences of that macro.
|
||||
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -6568,7 +6568,7 @@
|
||||
|
||||
#if defined (__GNUC__) && ! defined (__cplusplus)
|
||||
typedef unsigned long long t1;typedef t1*t2;
|
||||
-void g(){}
|
||||
+void g(int,t1 const*,t1,t2,t1 const*,int){}
|
||||
void h(){}
|
||||
static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
|
||||
{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
|
||||
@@ -8187,7 +8187,7 @@
|
||||
|
||||
#if defined (__GNUC__) && ! defined (__cplusplus)
|
||||
typedef unsigned long long t1;typedef t1*t2;
|
||||
-void g(){}
|
||||
+void g(int,t1 const*,t1,t2,t1 const*,int){}
|
||||
void h(){}
|
||||
static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
|
||||
{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
|
||||
@@ -1,32 +0,0 @@
|
||||
http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff;h=0ab4e621833f4eae945a3762c9a29ee12e2eec53#patch1
|
||||
diff --git a/src/HLRBRep/HLRBRep_InternalAlgo.cxx b/src/HLRBRep/HLRBRep_InternalAlgo.cxx
|
||||
index ca885ca..c13cb06 100644 (file)
|
||||
--- a/src/HLRBRep/HLRBRep_InternalAlgo.cxx
|
||||
+++ b/src/HLRBRep/HLRBRep_InternalAlgo.cxx
|
||||
@@ -165,7 +165,7 @@ void HLRBRep_InternalAlgo::Update ()
|
||||
SB.Bounds(v1,v2,e1,e2,f1,f2);
|
||||
|
||||
for (Standard_Integer e = e1; e <= e2; e++) {
|
||||
- HLRBRep_EdgeData ed = aEDataArray.ChangeValue(e);
|
||||
+ HLRBRep_EdgeData& ed = aEDataArray.ChangeValue(e);
|
||||
HLRAlgo::DecodeMinMax(ed.MinMax(), TheMin, TheMax);
|
||||
if (FirstTime) {
|
||||
FirstTime = Standard_False;
|
||||
@@ -307,7 +307,7 @@ void HLRBRep_InternalAlgo::InitEdgeStatus ()
|
||||
Standard_Integer nf = myDS->NbFaces();
|
||||
|
||||
for (Standard_Integer e = 1; e <= ne; e++) {
|
||||
- HLRBRep_EdgeData ed = aEDataArray.ChangeValue(e);
|
||||
+ HLRBRep_EdgeData& ed = aEDataArray.ChangeValue(e);
|
||||
if (ed.Selected()) ed.Status().ShowAll();
|
||||
}
|
||||
// for (Standard_Integer f = 1; f <= nf; f++) {
|
||||
@@ -368,7 +368,7 @@ void HLRBRep_InternalAlgo::Select ()
|
||||
Standard_Integer nf = myDS->NbFaces();
|
||||
|
||||
for (Standard_Integer e = 1; e <= ne; e++) {
|
||||
- HLRBRep_EdgeData ed = aEDataArray.ChangeValue(e);
|
||||
+ HLRBRep_EdgeData& ed = aEDataArray.ChangeValue(e);
|
||||
ed.Selected(Standard_True);
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
From a0deb4ce8b43cf3c8b8c0a4225c6be5296446dbd Mon Sep 17 00:00:00 2001
|
||||
From: Adam Eri <adam.eri@blackmirror.media>
|
||||
Date: Tue, 3 Sep 2019 23:30:20 +0200
|
||||
Subject: [PATCH] Resolves compile error on macOS
|
||||
|
||||
Resolves "no member named 'isnan' in namespace 'std'" on macOS
|
||||
---
|
||||
GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp b/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp
|
||||
index 1f9a3eef..dd6f5c59 100644
|
||||
--- a/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp
|
||||
+++ b/GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "GeneratedSaxParserUtils.h"
|
||||
#include <math.h>
|
||||
+#include <cmath>
|
||||
#include <memory>
|
||||
#include <string.h>
|
||||
#include <limits>
|
||||
+42
-86
@@ -1,13 +1,8 @@
|
||||
[project]
|
||||
name = "IfcOpenShell"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"black==26.3.1",
|
||||
"ruff==0.15.12",
|
||||
"poethepoet",
|
||||
"ty==0.0.32",
|
||||
"gersemi==0.26.1",
|
||||
]
|
||||
# Don't provide requires-python explicitly
|
||||
# allowing pyprojects to set their own (e.g. bonsai and general ifcopenshell version differ).
|
||||
|
||||
[tool.black]
|
||||
line-length = 120
|
||||
@@ -43,6 +38,7 @@ exclude = [
|
||||
# then they will be inherited by projects' .toml files.
|
||||
# This allows using assuming different Python version for different projects.
|
||||
[tool.ruff]
|
||||
line-length = 120
|
||||
exclude = [
|
||||
# Submodules.
|
||||
"src/ifcopenshell-python/ifcopenshell/express",
|
||||
@@ -83,92 +79,39 @@ ignore = [
|
||||
]
|
||||
|
||||
[tool.ty.rules]
|
||||
all = "ignore"
|
||||
all = "error"
|
||||
|
||||
# Structural rules (no deep type inference needed, easier to adapt).
|
||||
abstract-method-in-final-class = "error"
|
||||
ambiguous-protocol-member = "error"
|
||||
conflicting-declarations = "error"
|
||||
conflicting-metaclass = "error"
|
||||
cyclic-class-definition = "error"
|
||||
cyclic-type-alias-definition = "error"
|
||||
dataclass-field-order = "error"
|
||||
duplicate-base = "error"
|
||||
duplicate-kw-only = "error"
|
||||
empty-body = "error"
|
||||
escape-character-in-forward-annotation = "error"
|
||||
final-on-non-method = "error"
|
||||
final-without-value = "error"
|
||||
ignore-comment-unknown-rule = "error"
|
||||
implicit-concatenated-string-type-annotation = "error"
|
||||
inconsistent-mro = "error"
|
||||
ineffective-final = "error"
|
||||
instance-layout-conflict = "error"
|
||||
invalid-dataclass = "error"
|
||||
invalid-dataclass-override = "error"
|
||||
invalid-enum-member-annotation = "error"
|
||||
invalid-explicit-override = "error"
|
||||
invalid-frozen-dataclass-subclass = "error"
|
||||
invalid-generic-class = "error"
|
||||
invalid-generic-enum = "error"
|
||||
invalid-ignore-comment = "error"
|
||||
invalid-legacy-positional-parameter = "error"
|
||||
invalid-legacy-type-variable = "error"
|
||||
invalid-named-tuple = "error"
|
||||
invalid-newtype = "error"
|
||||
invalid-overload = "error"
|
||||
invalid-paramspec = "error"
|
||||
invalid-protocol = "error"
|
||||
invalid-syntax-in-forward-annotation = "error"
|
||||
invalid-total-ordering = "error"
|
||||
invalid-type-alias-type = "error"
|
||||
invalid-type-checking-constant = "error"
|
||||
invalid-type-guard-definition = "error"
|
||||
invalid-type-variable-bound = "error"
|
||||
invalid-type-variable-constraints = "error"
|
||||
invalid-typed-dict-header = "error"
|
||||
invalid-typed-dict-statement = "error"
|
||||
override-of-final-method = "error"
|
||||
override-of-final-variable = "error"
|
||||
possibly-missing-import = "error"
|
||||
possibly-missing-submodule = "error"
|
||||
# Has false positives due to ty walrus operator bug.
|
||||
# possibly-unresolved-reference = "error"
|
||||
raw-string-type-annotation = "error"
|
||||
redundant-final-classvar = "error"
|
||||
shadowed-type-variable = "error"
|
||||
subclass-of-final-class = "error"
|
||||
super-call-in-named-tuple-method = "error"
|
||||
unavailable-implicit-super-arguments = "error"
|
||||
unbound-type-variable = "error"
|
||||
undefined-reveal = "error"
|
||||
unresolved-global = "error"
|
||||
unresolved-import = "error"
|
||||
unresolved-reference = "error"
|
||||
unused-ignore-comment = "error"
|
||||
unused-type-ignore-comment = "error"
|
||||
useless-overload-body = "error"
|
||||
possibly-unresolved-reference = "ignore"
|
||||
# Maybe later, requires to specify element types for all generics.
|
||||
missing-type-argument = "ignore"
|
||||
# Conflicts with `bpy` props defined using annotations.
|
||||
invalid-type-form = "ignore"
|
||||
|
||||
# Non-structural rules:
|
||||
deprecated = "error"
|
||||
zero-stepsize-in-slice = "error"
|
||||
possibly-missing-implicit-call = "error"
|
||||
unused-awaitable = "error"
|
||||
|
||||
# Function argument rules:
|
||||
# Conflicts with `ifcopenshell.api.geometry.add_representation` type of callables we have, confusing them with a module.
|
||||
# call-non-callable = "error"
|
||||
conflicting-argument-forms = "error"
|
||||
call-non-callable = "ignore"
|
||||
# bpy is missing some context manager implementations.
|
||||
invalid-context-manager = "ignore"
|
||||
# Doesn't go well with `bpy.ops.xxx.yyy`.
|
||||
unresolved-attribute = "ignore"
|
||||
# Too many false positives.
|
||||
# invalid-argument-type = "error"
|
||||
missing-argument = "error"
|
||||
parameter-already-assigned = "error"
|
||||
positional-only-parameter-as-kwarg = "error"
|
||||
too-many-positional-arguments = "error"
|
||||
unknown-argument = "error"
|
||||
# Has a lot of warnings due to current ty walrus operator issues.
|
||||
# index-out-of-bounds = "error"
|
||||
# unresolved-attribute = "error"
|
||||
invalid-argument-type = "ignore"
|
||||
invalid-method-override = "ignore"
|
||||
invalid-assignment = "ignore"
|
||||
invalid-parameter-default = "ignore"
|
||||
missing-override-decorator = "ignore"
|
||||
invalid-yield = "ignore"
|
||||
invalid-return-type = "ignore"
|
||||
non-callable-init-subclass = "ignore"
|
||||
not-iterable = "ignore"
|
||||
possibly-missing-attribute = "ignore"
|
||||
no-matching-overload = "ignore"
|
||||
not-subscriptable = "ignore"
|
||||
unsupported-dynamic-base = "ignore"
|
||||
unsupported-operator = "ignore"
|
||||
type-assertion-failure = "ignore"
|
||||
|
||||
[tool.ty.environment]
|
||||
extra-paths = [
|
||||
@@ -215,6 +158,18 @@ exclude = [
|
||||
|
||||
[tool.poe.tasks]
|
||||
|
||||
dev-setup.sequence = [
|
||||
{cmd = "uv sync"},
|
||||
{cmd = "uv pip install -e ./src/bsdd/"},
|
||||
{cmd = "uv pip install -e ./src/ifcopenshell-python/[advanced,dev]"},
|
||||
{cmd = "uv pip install -e ./src/ifcedit/"},
|
||||
{cmd = "uv pip install -e ./src/ifcpatch/"},
|
||||
{cmd = "uv pip install -e ./src/ifcquery/"},
|
||||
{cmd = "uv pip install -e './src/ifcmcp/[mcp]'"},
|
||||
{cmd = "uv pip install -r src/bonsai/requirements-dev.txt"},
|
||||
]
|
||||
dev-setup.help = "Install repo packages in editable mode"
|
||||
|
||||
ruff = "ruff check"
|
||||
|
||||
black = "black ."
|
||||
@@ -243,6 +198,7 @@ cmake-format = "gersemi . --in-place"
|
||||
# --ignore unresolved-reference: walrus operator false positives in ty.
|
||||
cmd = """
|
||||
ty check
|
||||
nix/
|
||||
src/bcf
|
||||
src/bsdd
|
||||
src/ifc2ca
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
black==26.3.1
|
||||
ruff==0.15.12
|
||||
poethepoet
|
||||
ty==0.0.59
|
||||
gersemi==0.26.1
|
||||
@@ -46,7 +46,7 @@ IFC_CONNECTED_TYPE = Union[bpy.types.Material, bpy.types.Object]
|
||||
class OperationData(TypedDict):
|
||||
id: int
|
||||
guid: NotRequired[str]
|
||||
obj: str
|
||||
obj: NotRequired[str]
|
||||
|
||||
|
||||
class EditObjectOperationData(TypedDict):
|
||||
|
||||
@@ -843,7 +843,6 @@ class AddBoundary(bpy.types.Operator, tool.Ifc.Operator):
|
||||
settings = ifcopenshell.geom.settings()
|
||||
shape = ifcopenshell.geom.create_shape(settings, opening)
|
||||
mat = Matrix(ifcopenshell.util.shape.get_shape_matrix(shape))
|
||||
mat.translation = (0, 0, 0)
|
||||
opening_bm = bmesh.new()
|
||||
verts = ifcopenshell.util.shape.get_vertices(shape.geometry)
|
||||
for vert in verts:
|
||||
|
||||
@@ -156,16 +156,13 @@ class BrickschemaReferencesData:
|
||||
for rel in getattr(tool.Ifc.get_entity(bpy.context.active_object), "HasAssociations", []):
|
||||
if rel.is_a("IfcRelAssociatesLibrary"):
|
||||
reference = rel.RelatingLibrary
|
||||
if tool.Ifc.get_schema() == "IFC2X3" and "#" not in reference.ItemReference:
|
||||
continue
|
||||
if tool.Ifc.get_schema() != "IFC2X3" and "#" not in reference.Identification:
|
||||
identification = tool.Document.get_external_reference_id(reference)
|
||||
if not identification or "#" not in identification:
|
||||
continue
|
||||
results.append(
|
||||
{
|
||||
"id": reference.id(),
|
||||
"identification": (
|
||||
reference.ItemReference if tool.Ifc.get_schema() == "IFC2X3" else reference.Identification
|
||||
),
|
||||
"identification": identification,
|
||||
"name": reference.Name or "Unnamed",
|
||||
}
|
||||
)
|
||||
|
||||
@@ -127,36 +127,25 @@ class ObjectDocumentData:
|
||||
identification = None
|
||||
|
||||
if is_information:
|
||||
if tool.Ifc.get_schema() == "IFC2X3":
|
||||
identification = relating_document.DocumentId
|
||||
else:
|
||||
identification = relating_document.Identification
|
||||
identification = tool.Document.get_document_information_id(relating_document)
|
||||
|
||||
location = getattr(relating_document, "Location", None)
|
||||
description = getattr(relating_document, "Description", "No description")
|
||||
else:
|
||||
description = relating_document.Description
|
||||
if tool.Ifc.get_schema() == "IFC2X3":
|
||||
reference_to_document = relating_document.ReferenceToDocument
|
||||
if not name and reference_to_document:
|
||||
name = reference_to_document[0].Name
|
||||
referenced_document = tool.Document.get_reference_document(relating_document)
|
||||
|
||||
identification = relating_document.ItemReference
|
||||
if not identification and reference_to_document:
|
||||
identification = reference_to_document[0].DocumentId
|
||||
location = relating_document.Location
|
||||
else:
|
||||
referenced_document = relating_document.ReferencedDocument
|
||||
if not name and referenced_document:
|
||||
name = referenced_document.Name
|
||||
if not name and referenced_document:
|
||||
name = referenced_document.Name
|
||||
|
||||
identification = relating_document.Identification
|
||||
if not identification and referenced_document:
|
||||
identification = referenced_document.Identification
|
||||
identification = tool.Document.get_external_reference_id(relating_document)
|
||||
if not identification and referenced_document:
|
||||
identification = tool.Document.get_document_information_id(referenced_document)
|
||||
|
||||
location = relating_document.Location
|
||||
if location is None and referenced_document:
|
||||
location = referenced_document.Location
|
||||
location = relating_document.Location
|
||||
# IFC2X3 IfcDocumentInformation has no Location to fall back to.
|
||||
if location is None and referenced_document and tool.Ifc.get_schema() != "IFC2X3":
|
||||
location = referenced_document.Location
|
||||
|
||||
location = cls.convert_to_file_uri(location) if location else None
|
||||
|
||||
|
||||
@@ -3586,7 +3586,7 @@ class EditSheet(bpy.types.Operator, tool.Ifc.Operator):
|
||||
if sheet.is_a("IfcDocumentInformation"):
|
||||
self.document_type = "SHEET"
|
||||
self.name = sheet.Name
|
||||
self.identification = sheet.DocumentId if tool.Ifc.get_schema() == "IFC2X3" else sheet.Identification
|
||||
self.identification = tool.Document.get_document_information_id(sheet)
|
||||
elif sheet.is_a("IfcDocumentReference") and tool.Drawing.get_reference_description(sheet) == "TITLEBLOCK":
|
||||
self.document_type = "TITLEBLOCK"
|
||||
else:
|
||||
|
||||
@@ -903,12 +903,8 @@ class SvgWriter:
|
||||
continue
|
||||
sheet = tool.Drawing.get_reference_document(sheet_reference)
|
||||
if sheet:
|
||||
if tool.Ifc.get_schema() == "IFC2X3":
|
||||
reference_id = sheet_reference.ItemReference or "-"
|
||||
sheet_id = sheet.DocumentId or "-"
|
||||
else:
|
||||
reference_id = sheet_reference.Identification or "-"
|
||||
sheet_id = sheet.Identification or "-"
|
||||
reference_id = tool.Document.get_external_reference_id(sheet_reference) or "-"
|
||||
sheet_id = tool.Document.get_document_information_id(sheet) or "-"
|
||||
return (reference_id, sheet_id)
|
||||
break
|
||||
return ("-", "-")
|
||||
|
||||
@@ -581,7 +581,11 @@ class UpdateRepresentation(bpy.types.Operator, tool.Ifc.Operator):
|
||||
if has_openings and not self.apply_openings:
|
||||
# Meshlike things with openings can only be updated without openings applied.
|
||||
if self.from_ui:
|
||||
self.report({"ERROR"}, f"Object '{obj.name}' has openings - representation cannot be updated.")
|
||||
self.report(
|
||||
{"ERROR"},
|
||||
f"Object '{obj.name}' has openings. "
|
||||
"ALT+click the button to bake the openings into the new representation.",
|
||||
)
|
||||
return
|
||||
|
||||
if not product.is_a("IfcGridAxis"):
|
||||
@@ -3446,40 +3450,43 @@ class UnassignRepresentationItemStyle(bpy.types.Operator, tool.Ifc.Operator):
|
||||
self.report({"ERROR"}, "Couldn't find any styles associated with the active representation item.")
|
||||
return {"CANCELLED"}
|
||||
|
||||
# Resolve an object's active representation down to its base geometry items,
|
||||
# unwrapping mapped items (Revit families) and boolean results (openings/cuts)
|
||||
# so we reach the items that actually carry styles.
|
||||
def get_base_representation_items(obj):
|
||||
representation = tool.Geometry.get_active_representation(obj)
|
||||
if not representation or not representation.is_a("IfcRepresentation"):
|
||||
return
|
||||
yield from ifcopenshell.util.representation.resolve_base_items(representation)
|
||||
# Unassign matching styles from the active object itself
|
||||
for style in active_styles:
|
||||
tool.Style.assign_style_to_representation_item(active_representation_item, None)
|
||||
tool.Geometry.reload_representation(active_obj)
|
||||
break # No need to check further if one matching style is found
|
||||
|
||||
# Unassign the style from the active representation item.
|
||||
tool.Style.assign_style_to_representation_item(active_representation_item, None)
|
||||
tool.Geometry.reload_representation(active_obj)
|
||||
|
||||
# Iterate over other selected objects and unassign matching styles.
|
||||
# Iterate over selected objects and unassign matching styles
|
||||
for obj in context.selected_objects:
|
||||
if obj == active_obj:
|
||||
continue
|
||||
continue # Skip the active object itself
|
||||
|
||||
for item in get_base_representation_items(obj):
|
||||
item_styles = set()
|
||||
if hasattr(item, "StyledByItem"):
|
||||
for styled_by_item in item.StyledByItem:
|
||||
# Get the IFC entity directly from the object
|
||||
element = tool.Ifc.get_entity(obj)
|
||||
if not element:
|
||||
continue # Skip if no IFC entity is found
|
||||
|
||||
representation_item_id = element.Representation.Representations[0].Items[0].id()
|
||||
representation_item = tool.Ifc.get_entity_by_id(representation_item_id)
|
||||
|
||||
if representation_item:
|
||||
# Retrieve styles for the current representation item
|
||||
styles = set()
|
||||
if hasattr(representation_item, "StyledByItem"):
|
||||
for styled_by_item in representation_item.StyledByItem:
|
||||
if hasattr(styled_by_item, "Styles"):
|
||||
item_styles.update(styled_by_item.Styles)
|
||||
styles.update(styled_by_item.Styles)
|
||||
|
||||
if item_styles & active_styles:
|
||||
tool.Style.assign_style_to_representation_item(item, None)
|
||||
tool.Geometry.reload_representation(obj)
|
||||
break # Only remove one matching style per object
|
||||
# Unassign matching styles
|
||||
for style in styles:
|
||||
if style in active_styles:
|
||||
tool.Style.assign_style_to_representation_item(representation_item, None)
|
||||
tool.Geometry.reload_representation(obj)
|
||||
break # No need to check further if one matching style is found
|
||||
|
||||
# Reload UI items
|
||||
bpy.ops.bim.disable_editing_representation_items()
|
||||
bpy.ops.bim.enable_editing_representation_items()
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
|
||||
class EnableEditingRepresentationItemShapeAspect(bpy.types.Operator, tool.Ifc.Operator):
|
||||
|
||||
@@ -103,9 +103,7 @@ class LibraryReferencesData:
|
||||
results.append(
|
||||
{
|
||||
"id": library.id(),
|
||||
"identification": (
|
||||
library.ItemReference if tool.Ifc.get_schema() == "IFC2X3" else library.Identification
|
||||
),
|
||||
"identification": tool.Document.get_external_reference_id(library),
|
||||
"name": library.Name or "Unnamed",
|
||||
}
|
||||
)
|
||||
|
||||
@@ -418,6 +418,13 @@ class ImportQuickFavorites(bpy.types.Operator):
|
||||
bl_description = "Import operators from Blender's Quick Favorites menu, including their configured properties"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
if bpy.app.version[:2] not in tool.Misc.QuickFavorites.OFFSET_USER_MENUS:
|
||||
cls.poll_message_set(f"Blender version {bpy.app.version_string} is not supported.")
|
||||
return False
|
||||
return True
|
||||
|
||||
def execute(self, context) -> set["rna_enums.OperatorReturnItems"]:
|
||||
props = tool.Misc.get_misc_props()
|
||||
props.quick_favorites.clear()
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, cast
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import bpy
|
||||
import ifcopenshell
|
||||
@@ -122,8 +122,8 @@ class ExecuteIfcPatch(bpy.types.Operator):
|
||||
if props.should_load_from_memory and tool.Ifc.get():
|
||||
args["file"] = tool.Ifc.get()
|
||||
else:
|
||||
args["input"] = cast(str, props.ifc_patch_input)
|
||||
args["file"] = cast(ifcopenshell.file, ifcopenshell.open(props.ifc_patch_input))
|
||||
args["input"] = props.ifc_patch_input
|
||||
args["file"] = ifcopenshell.open(props.ifc_patch_input)
|
||||
|
||||
# Store this in case the patch recipe resets the Blender session, such as by loading a new project.
|
||||
ifc_patch_output = props.ifc_patch_output or props.ifc_patch_input
|
||||
|
||||
@@ -27,6 +27,7 @@ import ifcopenshell.api.material
|
||||
import ifcopenshell.api.pset
|
||||
import ifcopenshell.api.root
|
||||
import ifcopenshell.util.element
|
||||
import ifcopenshell.util.representation
|
||||
import ifcopenshell.util.schema
|
||||
import ifcopenshell.util.shape_builder
|
||||
import ifcopenshell.util.type
|
||||
@@ -129,13 +130,25 @@ class ReassignClass(bpy.types.Operator, tool.Ifc.Operator):
|
||||
same_ifc_product = element.is_a(ifc_product)
|
||||
|
||||
if not same_ifc_product:
|
||||
if not (element.is_a("IfcElement") and ifc_product == "IfcElementType") and not (
|
||||
element.is_a("IfcElementType") and ifc_product == "IfcElement"
|
||||
):
|
||||
self.report(
|
||||
{"ERROR"}, f"Not supported class reassignment for object '{obj.name}' -> {ifc_product}."
|
||||
# A spatial element (e.g. IfcSite) anchors the containment
|
||||
# hierarchy, so only allow reassigning it to another family when
|
||||
# it actually carries geometry - i.e. it's a real modelled thing
|
||||
# (a bench dropped onto IfcSite -> IfcFurniture) rather than an
|
||||
# empty spatial container we'd be turning into a loose element.
|
||||
# IfcSpatialStructureElement covers IFC2X3, which has no
|
||||
# IfcSpatialElement supertype.
|
||||
is_spatial = element.is_a("IfcSpatialElement") or element.is_a("IfcSpatialStructureElement")
|
||||
if is_spatial:
|
||||
has_geometry = (
|
||||
next(ifcopenshell.util.representation.get_representations_iter(element), None) is not None
|
||||
)
|
||||
return {"CANCELLED"}
|
||||
if not has_geometry:
|
||||
self.report(
|
||||
{"ERROR"},
|
||||
f"Cannot reassign '{obj.name}' ({element.is_a()}) to {ifc_product}: "
|
||||
"a spatial element can only be reassigned to another class when it has geometry.",
|
||||
)
|
||||
return {"CANCELLED"}
|
||||
|
||||
props = tool.Blender.get_object_bim_props(obj)
|
||||
props.is_reassigning_class = False
|
||||
|
||||
@@ -71,7 +71,11 @@ class LoadByDirection(TypedDict):
|
||||
|
||||
ProcessedLoad = TypedDict(
|
||||
"ProcessedLoad",
|
||||
{"linear loads": LoadByDirection, "max linear load": float, "discrete loads": list[list[DiscreteConfigItem]]},
|
||||
{
|
||||
"linear loads": dict[str, LoadByDirection] | None,
|
||||
"max linear load": float,
|
||||
"discrete loads": list[list[DiscreteConfigItem]],
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@@ -845,13 +849,16 @@ class ShaderInfo:
|
||||
v = l1[1] + fac * (pos - l1[0])
|
||||
return v
|
||||
|
||||
def interpolate(self, pos: float, loadinfo: list[LoadConfigItem], start: int, end: int, key: str) -> np.ndarray:
|
||||
def interpolate(self, pos: float, loadinfo: list[LoadConfigItem], start: int, end: int) -> np.ndarray:
|
||||
"""interpolate the result vectors between load poits"""
|
||||
result = np.zeros(6)
|
||||
for i in range(6):
|
||||
value1 = [loadinfo[start]["pos"], loadinfo[start][key][i]] # [position, force_component]
|
||||
value2 = [loadinfo[end]["pos"], loadinfo[end][key][i]] # [position, force_component]
|
||||
result[i] = self.interp1d(value1, value2, pos) # interpolated [position, force_component]
|
||||
# [position, force_component]
|
||||
value1 = [loadinfo[start]["pos"], loadinfo[start]["load values"][i]]
|
||||
# [position, force_component]
|
||||
value2 = [loadinfo[end]["pos"], loadinfo[end]["load values"][i]]
|
||||
# interpolated [position, force_component]
|
||||
result[i] = self.interp1d(value1, value2, pos)
|
||||
return result
|
||||
|
||||
def get_before_and_after(self, pos: float, load_config_list: list[list[LoadConfigItem]]) -> dict[str, list[float]]:
|
||||
@@ -895,8 +902,8 @@ class ShaderInfo:
|
||||
load_before += config[end]["load values"]
|
||||
|
||||
elif end - start == 1:
|
||||
load_before += self.interpolate(pos, config, start, end, "load values")
|
||||
load_after += self.interpolate(pos, config, start, end, "load values")
|
||||
load_before += self.interpolate(pos, config, start, end)
|
||||
load_after += self.interpolate(pos, config, start, end)
|
||||
start += 1
|
||||
end -= 1
|
||||
return_value = {"before": load_before.tolist(), "after": load_after.tolist()}
|
||||
|
||||
@@ -303,17 +303,7 @@ def add_drawing(
|
||||
ifc_representation_class=None,
|
||||
)
|
||||
|
||||
drawings_parent_group = None
|
||||
for group in ifc.get().by_type("IfcGroup"):
|
||||
if group.Name == "DRAWINGS" and group.ObjectType == "DRAWINGS":
|
||||
drawings_parent_group = group
|
||||
break
|
||||
|
||||
if not drawings_parent_group:
|
||||
drawings_parent_group = ifc.run("group.add_group")
|
||||
ifc.run(
|
||||
"group.edit_group", group=drawings_parent_group, attributes={"Name": "DRAWINGS", "ObjectType": "DRAWINGS"}
|
||||
)
|
||||
drawings_parent_group = drawing.ensure_drawings_parent_group()
|
||||
|
||||
group = ifc.run("group.add_group")
|
||||
ifc.run("group.edit_group", group=group, attributes={"Name": drawing_name, "ObjectType": "DRAWING"})
|
||||
@@ -352,19 +342,7 @@ def add_drawing(
|
||||
)
|
||||
drawing.setup_shading_styles_path(shading_styles_path)
|
||||
|
||||
drawings_parent_document = None
|
||||
for document in ifc.get().by_type("IfcDocumentInformation"):
|
||||
if document.Name == "DRAWINGS" and document.Scope == "DRAWINGS":
|
||||
drawings_parent_document = document
|
||||
break
|
||||
|
||||
if not drawings_parent_document:
|
||||
drawings_parent_document = ifc.run("document.add_information")
|
||||
if ifc.get_schema() == "IFC2X3":
|
||||
attributes = {"DocumentId": "DRAWINGS", "Name": "DRAWINGS", "Scope": "DRAWINGS"}
|
||||
else:
|
||||
attributes = {"Identification": "DRAWINGS", "Name": "DRAWINGS", "Scope": "DRAWINGS"}
|
||||
ifc.run("document.edit_information", information=drawings_parent_document, attributes=attributes)
|
||||
drawings_parent_document = drawing.ensure_drawings_parent_document()
|
||||
|
||||
information = ifc.run("document.add_information", parent=drawings_parent_document)
|
||||
uri = drawing.get_default_drawing_path(drawing_name)
|
||||
@@ -395,17 +373,7 @@ def duplicate_drawing(
|
||||
group = drawing_tool.get_drawing_group(new_drawing)
|
||||
ifc.run("group.unassign_group", group=group, products=[new_drawing])
|
||||
|
||||
drawings_parent_group = None
|
||||
for parent_group in ifc.get().by_type("IfcGroup"):
|
||||
if parent_group.Name == "DRAWINGS" and parent_group.ObjectType == "DRAWINGS":
|
||||
drawings_parent_group = parent_group
|
||||
break
|
||||
|
||||
if not drawings_parent_group:
|
||||
drawings_parent_group = ifc.run("group.add_group")
|
||||
ifc.run(
|
||||
"group.edit_group", group=drawings_parent_group, attributes={"Name": "DRAWINGS", "ObjectType": "DRAWINGS"}
|
||||
)
|
||||
drawings_parent_group = drawing_tool.ensure_drawings_parent_group()
|
||||
|
||||
new_group = ifc.run("group.add_group")
|
||||
ifc.run("group.edit_group", group=new_group, attributes={"Name": drawing_name, "ObjectType": "DRAWING"})
|
||||
@@ -426,19 +394,7 @@ def duplicate_drawing(
|
||||
old_reference = drawing_tool.get_drawing_document(new_drawing)
|
||||
ifc.run("document.unassign_document", products=[new_drawing], document=old_reference)
|
||||
|
||||
drawings_parent_document = None
|
||||
for document in ifc.get().by_type("IfcDocumentInformation"):
|
||||
if document.Name == "DRAWINGS" and document.Scope == "DRAWINGS":
|
||||
drawings_parent_document = document
|
||||
break
|
||||
|
||||
if not drawings_parent_document:
|
||||
drawings_parent_document = ifc.run("document.add_information")
|
||||
if ifc.get_schema() == "IFC2X3":
|
||||
attributes = {"DocumentId": "DRAWINGS", "Name": "DRAWINGS", "Scope": "DRAWINGS"}
|
||||
else:
|
||||
attributes = {"Identification": "DRAWINGS", "Name": "DRAWINGS", "Scope": "DRAWINGS"}
|
||||
ifc.run("document.edit_information", information=drawings_parent_document, attributes=attributes)
|
||||
drawings_parent_document = drawing_tool.ensure_drawings_parent_document()
|
||||
|
||||
information = ifc.run("document.add_information", parent=drawings_parent_document)
|
||||
uri = drawing_tool.get_default_drawing_path(drawing_name)
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
# Bonsai - OpenBIM Blender Add-on
|
||||
# Copyright (C) 2026
|
||||
#
|
||||
# This file is part of Bonsai.
|
||||
#
|
||||
# Bonsai 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.
|
||||
#
|
||||
# Bonsai 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 Bonsai. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# This file was generated with the assistance of an AI coding tool.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import math
|
||||
from collections.abc import Iterable
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import bonsai.core.geometry
|
||||
|
||||
if TYPE_CHECKING:
|
||||
import bpy
|
||||
|
||||
import bonsai.tool as tool
|
||||
|
||||
|
||||
Z_ROTATION_ALIGNMENT_TOLERANCE = 1e-9
|
||||
|
||||
|
||||
def _z_rotation_diff(target_z: float, source_z: float) -> float:
|
||||
"""Signed Z-Euler difference wrapped to [-π, π]."""
|
||||
return (target_z - source_z + math.pi) % (2 * math.pi) - math.pi
|
||||
|
||||
|
||||
def copy_z_rotation_to_selected(
|
||||
ifc: type[tool.Ifc],
|
||||
geometry: type[tool.Geometry],
|
||||
surveyor: type[tool.Surveyor],
|
||||
*,
|
||||
active: bpy.types.Object,
|
||||
targets: Iterable[bpy.types.Object],
|
||||
flip: bool = False,
|
||||
) -> int:
|
||||
"""Apply ``active``'s Z-Euler rotation to each target."""
|
||||
source_z = surveyor.get_z_rotation(active) # ty: ignore[missing-argument]
|
||||
if flip:
|
||||
source_z += math.pi
|
||||
rotated = 0
|
||||
for obj in targets:
|
||||
target_z = surveyor.get_z_rotation(obj) # ty: ignore[missing-argument]
|
||||
if abs(_z_rotation_diff(target_z, source_z)) < Z_ROTATION_ALIGNMENT_TOLERANCE:
|
||||
continue
|
||||
surveyor.set_z_rotation(obj, source_z) # ty: ignore[missing-argument]
|
||||
rotated += 1
|
||||
if ifc.get_entity(obj) is not None:
|
||||
bonsai.core.geometry.edit_object_placement(ifc, geometry, surveyor, obj=obj)
|
||||
return rotated
|
||||
@@ -354,6 +354,8 @@ class Drawing:
|
||||
def enable_editing_schedules(cls): pass
|
||||
def enable_editing_sheets(cls): pass
|
||||
def enable_editing_text(cls, obj): pass
|
||||
def ensure_drawings_parent_document(cls): pass
|
||||
def ensure_drawings_parent_group(cls): pass
|
||||
def ensure_unique_drawing_name(cls, name): pass
|
||||
def ensure_unique_identification(cls, identification): pass
|
||||
def export_font_size(cls, obj): pass
|
||||
@@ -1169,8 +1171,6 @@ class Style:
|
||||
@interface
|
||||
class Surveyor:
|
||||
def get_absolute_matrix(cls, obj): pass
|
||||
def get_z_rotation(cls, obj): pass
|
||||
def set_z_rotation(cls, obj, z): pass
|
||||
|
||||
|
||||
@interface
|
||||
|
||||
@@ -192,10 +192,9 @@ class Brick(bonsai.core.tool.Brick):
|
||||
def get_brick(cls, element: ifcopenshell.entity_instance) -> Union[str, None]:
|
||||
for rel in element.HasAssociations:
|
||||
if rel.is_a("IfcRelAssociatesLibrary"):
|
||||
if tool.Ifc.get_schema() == "IFC2X3" and "#" in rel.RelatingLibrary.ItemReference:
|
||||
return rel.RelatingLibrary.ItemReference
|
||||
if tool.Ifc.get_schema() != "IFC2X3" and "#" in rel.RelatingLibrary.Identification:
|
||||
return rel.RelatingLibrary.Identification
|
||||
identification = tool.Document.get_external_reference_id(rel.RelatingLibrary)
|
||||
if identification and "#" in identification:
|
||||
return identification
|
||||
|
||||
@classmethod
|
||||
def get_brick_class(cls, element: ifcopenshell.entity_instance) -> Union[str, None]:
|
||||
|
||||
@@ -261,7 +261,8 @@ class Document(bonsai.core.tool.Document):
|
||||
def get_reference_document(cls, reference: ifcopenshell.entity_instance) -> ifcopenshell.entity_instance | None:
|
||||
# TODO: migrate to util.document and replace all instances
|
||||
if reference.file.schema == "IFC2X3":
|
||||
return (reference.ReferenceToDocument or (None))[0]
|
||||
reference_to_document = reference.ReferenceToDocument
|
||||
return reference_to_document[0] if reference_to_document else None
|
||||
return reference.ReferencedDocument
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -38,6 +38,7 @@ import ifcopenshell.api.context
|
||||
import ifcopenshell.api.document
|
||||
import ifcopenshell.api.drawing
|
||||
import ifcopenshell.api.geometry
|
||||
import ifcopenshell.api.group
|
||||
import ifcopenshell.api.pset
|
||||
import ifcopenshell.api.root
|
||||
import ifcopenshell.geom
|
||||
@@ -773,6 +774,32 @@ class Drawing(bonsai.core.tool.Drawing):
|
||||
def get_drawing_target_view(cls, drawing: ifcopenshell.entity_instance) -> str:
|
||||
return ifcopenshell.util.element.get_psets(drawing).get("EPset_Drawing", {}).get("TargetView", "MODEL_VIEW")
|
||||
|
||||
@classmethod
|
||||
def ensure_drawings_parent_document(cls) -> ifcopenshell.entity_instance:
|
||||
ifc_file = tool.Ifc.get()
|
||||
for document in ifc_file.by_type("IfcDocumentInformation"):
|
||||
if document.Name == "DRAWINGS" and document.Scope == "DRAWINGS":
|
||||
return document
|
||||
document = ifcopenshell.api.document.add_information(ifc_file)
|
||||
if ifc_file.schema == "IFC2X3":
|
||||
attributes = {"DocumentId": "DRAWINGS", "Name": "DRAWINGS", "Scope": "DRAWINGS"}
|
||||
else:
|
||||
attributes = {"Identification": "DRAWINGS", "Name": "DRAWINGS", "Scope": "DRAWINGS"}
|
||||
ifcopenshell.api.document.edit_information(ifc_file, information=document, attributes=attributes)
|
||||
return document
|
||||
|
||||
@classmethod
|
||||
def ensure_drawings_parent_group(cls) -> ifcopenshell.entity_instance:
|
||||
ifc_file = tool.Ifc.get()
|
||||
for group in ifc_file.by_type("IfcGroup"):
|
||||
if group.Name == "DRAWINGS" and group.ObjectType == "DRAWINGS":
|
||||
return group
|
||||
group = ifcopenshell.api.group.add_group(ifc_file)
|
||||
ifcopenshell.api.group.edit_group(
|
||||
ifc_file, group=group, attributes={"Name": "DRAWINGS", "ObjectType": "DRAWINGS"}
|
||||
)
|
||||
return group
|
||||
|
||||
@classmethod
|
||||
def get_group_elements(cls, group: ifcopenshell.entity_instance) -> list[ifcopenshell.entity_instance]:
|
||||
for rel in group.IsGroupedBy or []:
|
||||
@@ -1140,10 +1167,7 @@ class Drawing(bonsai.core.tool.Drawing):
|
||||
new = documents_collection.add()
|
||||
new.ifc_definition_id = schedule.id()
|
||||
new.name = schedule.Name or "Unnamed"
|
||||
if tool.Ifc.get_schema() == "IFC2X3":
|
||||
new.identification = schedule.DocumentId
|
||||
else:
|
||||
new.identification = schedule.Identification
|
||||
new.identification = tool.Document.get_document_information_id(schedule) or ""
|
||||
|
||||
@classmethod
|
||||
def get_sheet_identification(cls, sheet: ifcopenshell.entity_instance) -> str:
|
||||
@@ -1184,10 +1208,7 @@ class Drawing(bonsai.core.tool.Drawing):
|
||||
new.ifc_definition_id = reference.id()
|
||||
new.is_sheet = False
|
||||
|
||||
if tool.Ifc.get_schema() == "IFC2X3":
|
||||
new.identification = reference.ItemReference or ""
|
||||
else:
|
||||
new.identification = reference.Identification or ""
|
||||
new.identification = tool.Document.get_external_reference_id(reference) or ""
|
||||
|
||||
new.name = os.path.basename(reference.Location)
|
||||
new.reference_type = reference_description
|
||||
@@ -2423,9 +2444,8 @@ class Drawing(bonsai.core.tool.Drawing):
|
||||
def get_reference_document(
|
||||
cls, reference: ifcopenshell.entity_instance
|
||||
) -> Union[ifcopenshell.entity_instance, None]:
|
||||
if tool.Ifc.get_schema() == "IFC2X3":
|
||||
return reference.ReferenceToDocument[0]
|
||||
return reference.ReferencedDocument
|
||||
# TODO: migrate to document.get_reference_document.
|
||||
return tool.Document.get_reference_document(reference)
|
||||
|
||||
@classmethod
|
||||
def select_assigned_product(cls, context: bpy.types.Context) -> None:
|
||||
|
||||
@@ -33,7 +33,6 @@ from typing import (
|
||||
Optional,
|
||||
TypeGuard,
|
||||
Union,
|
||||
cast,
|
||||
get_args,
|
||||
)
|
||||
|
||||
@@ -2187,7 +2186,7 @@ class Geometry(bonsai.core.tool.Geometry):
|
||||
setattr(item, attribute.name, attribute.get_value())
|
||||
|
||||
if item.is_a("IfcSweptAreaSolid"):
|
||||
item_profile = cast(str, props.item_profile)
|
||||
item_profile = props.item_profile
|
||||
profile = item.SweptArea
|
||||
profile_name: Union[str, None] = profile.ProfileName
|
||||
if item_profile == "-":
|
||||
|
||||
@@ -197,7 +197,6 @@ class Loader(bonsai.core.tool.Loader):
|
||||
cls, blender_material: bpy.types.Material, surface_style: ifcopenshell.entity_instance
|
||||
) -> None:
|
||||
surface_style = cls.surface_style_to_dict(surface_style)
|
||||
surface_style: dict[str, Any]
|
||||
|
||||
cls.create_surface_style_shading(blender_material, surface_style)
|
||||
|
||||
|
||||
@@ -112,10 +112,14 @@ class Misc(bonsai.core.tool.Misc):
|
||||
reading data and never writing, to avoid the possibility of corrupting user preferences.
|
||||
"""
|
||||
|
||||
# Byte offset of UserDef.user_menus within the UserDef C struct, per (major, minor)
|
||||
# Blender version. Shifts whenever UserDef's fields change, so must be re-derived
|
||||
# per version (e.g. from that Blender build's SDNA).
|
||||
OFFSET_USER_MENUS: dict[tuple[int, int], int] = {
|
||||
(4, 5): 10032,
|
||||
(5, 0): 10032,
|
||||
(5, 1): 10032,
|
||||
(5, 2): 10800,
|
||||
}
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -232,7 +232,7 @@ class Raycast(bonsai.core.tool.Raycast):
|
||||
return final_2d, v2
|
||||
|
||||
@classmethod
|
||||
def intersect_mouse_2d_bounding_box(cls, mouse_pos: tuple[int, int], bbox: list[float, float, float, float]):
|
||||
def intersect_mouse_2d_bounding_box(cls, mouse_pos: tuple[int, int], bbox: list[float]):
|
||||
x, y = mouse_pos
|
||||
xmin, xmax, ymin, ymax = bbox
|
||||
|
||||
|
||||
@@ -44,8 +44,6 @@ When a new Blender version is released and supported:
|
||||
|
||||
* - File
|
||||
- What to update
|
||||
* - ``.github/workflows/ci-bonsai.yml``
|
||||
- ``pyver`` matrix
|
||||
* - ``.github/workflows/ci-bonsai-daily.yml``
|
||||
- Blender download URL
|
||||
|
||||
@@ -61,6 +59,10 @@ When Blender ships with a new Python version:
|
||||
- What to update
|
||||
* - ``.github/workflows/ci-lint.yaml``
|
||||
- ``MIN_BLENDER_PY_VERSION``
|
||||
* - ``.github/workflows/ci-bonsai.yml``
|
||||
- ``pyver`` matrix
|
||||
* - ``.github/workflows/ci-bonsai-daily.yml``
|
||||
- ``pyver`` matrix
|
||||
* - ``.github/scripts/publish-bonsai-releases.py``
|
||||
- ``CURRENT_PYTHON_VERSION``
|
||||
* - ``src/bonsai/Makefile``
|
||||
|
||||
@@ -18,12 +18,6 @@ dependencies = [
|
||||
"ifcopenshell",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"pytest-blender",
|
||||
"pytest-bdd",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
Homepage = "http://bonsaibim.org"
|
||||
Documentation = "https://docs.bonsaibim.org"
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
pytest
|
||||
pytest-blender
|
||||
pytest-bdd
|
||||
Regular → Executable
+3
-1
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Setup Bonsai Development Environment.
|
||||
|
||||
Script links existing Bonsai installation to the provided IfcOpenShell repository.
|
||||
@@ -78,7 +79,8 @@ BONSAI_PATH = find_bonsai_path()
|
||||
# ---------------------------
|
||||
|
||||
# Never changed by user.
|
||||
PYTHON_VERSION = "3.13" if BLENDER_VERSION == "5.1" else "3.11"
|
||||
BLENDER_VERSION_INT = tuple(map(int, BLENDER_VERSION.split(".")))
|
||||
PYTHON_VERSION = "3.13" if BLENDER_VERSION_INT >= (5, 1) else "3.11"
|
||||
PACKAGE_PATH = BLENDER_PATH / rf"extensions/.local/lib/python{PYTHON_VERSION}/site-packages"
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ from collections.abc import Generator
|
||||
from inspect import signature
|
||||
from math import radians
|
||||
from pathlib import Path
|
||||
from typing import Any, Union
|
||||
from typing import Any, Union, cast
|
||||
|
||||
import bpy
|
||||
import ifcopenshell
|
||||
@@ -140,7 +140,7 @@ class PanelSpy:
|
||||
else:
|
||||
props = kwargs.get("data")
|
||||
name = kwargs.get("property")
|
||||
props: bpy.types.bpy_struct
|
||||
props = cast(bpy.types.bpy_struct, props)
|
||||
text = kwargs.get("text", props.bl_rna.properties[name].name)
|
||||
icon = kwargs.get("icon", None)
|
||||
prop_type = props.bl_rna.properties[name].type
|
||||
|
||||
@@ -347,11 +347,13 @@ class TestAddDrawing:
|
||||
context="context",
|
||||
ifc_representation_class=None,
|
||||
).should_be_called().will_return("element")
|
||||
drawing.ensure_drawings_parent_group().should_be_called().will_return("drawings_parent_group")
|
||||
ifc.run("group.add_group").should_be_called().will_return("group")
|
||||
ifc.run(
|
||||
"group.edit_group", group="group", attributes={"Name": "name", "ObjectType": "DRAWING"}
|
||||
).should_be_called()
|
||||
ifc.run("group.assign_group", group="group", products=["element"]).should_be_called()
|
||||
ifc.run("group.assign_group", group="drawings_parent_group", products=["group"]).should_be_called()
|
||||
collector.assign("obj").should_be_called()
|
||||
ifc.run("pset.add_pset", product="element", name="EPset_Drawing").should_be_called().will_return("pset")
|
||||
drawing.get_default_drawing_resource_path("Stylesheet").should_be_called().will_return("stylesheet.css")
|
||||
@@ -381,8 +383,11 @@ class TestAddDrawing:
|
||||
"CurrentShadingStyle": "Blender Default",
|
||||
},
|
||||
).should_be_called()
|
||||
drawing.ensure_drawings_parent_document().should_be_called().will_return("drawings_parent_document")
|
||||
drawing.get_default_drawing_path("name").should_be_called().will_return("uri")
|
||||
ifc.run("document.add_information").should_be_called().will_return("information")
|
||||
ifc.run("document.add_information", parent="drawings_parent_document").should_be_called().will_return(
|
||||
"information"
|
||||
)
|
||||
ifc.run("document.add_reference", information="information").should_be_called().will_return("reference")
|
||||
ifc.get_schema().should_be_called().will_return("IFC4")
|
||||
ifc.run(
|
||||
@@ -406,11 +411,13 @@ class TestDuplicateDrawing:
|
||||
drawing.set_name("new_drawing", "unique_name").should_be_called()
|
||||
drawing.get_drawing_group("new_drawing").should_be_called().will_return("group")
|
||||
ifc.run("group.unassign_group", group="group", products=["new_drawing"]).should_be_called()
|
||||
drawing.ensure_drawings_parent_group().should_be_called().will_return("drawings_parent_group")
|
||||
ifc.run("group.add_group").should_be_called().will_return("new_group")
|
||||
ifc.run(
|
||||
"group.edit_group", group="new_group", attributes={"Name": "unique_name", "ObjectType": "DRAWING"}
|
||||
).should_be_called()
|
||||
ifc.run("group.assign_group", group="new_group", products=["new_drawing"]).should_be_called()
|
||||
ifc.run("group.assign_group", group="drawings_parent_group", products=["new_group"]).should_be_called()
|
||||
drawing.get_group_elements("group").should_be_called().will_return(["drawing", "annotation"])
|
||||
ifc.get_object("annotation").should_be_called().will_return("annotation_obj")
|
||||
geometry.duplicate_ifc_objects(["annotation_obj"]).should_be_called().will_return(
|
||||
@@ -425,7 +432,10 @@ class TestDuplicateDrawing:
|
||||
drawing.get_drawing_document("new_drawing").should_be_called().will_return("old_reference")
|
||||
ifc.run("document.unassign_document", products=["new_drawing"], document="old_reference").should_be_called()
|
||||
|
||||
ifc.run("document.add_information").should_be_called().will_return("information")
|
||||
drawing.ensure_drawings_parent_document().should_be_called().will_return("drawings_parent_document")
|
||||
ifc.run("document.add_information", parent="drawings_parent_document").should_be_called().will_return(
|
||||
"information"
|
||||
)
|
||||
ifc.run("document.add_reference", information="information").should_be_called().will_return("reference")
|
||||
ifc.get_schema().should_be_called().will_return("IFC4")
|
||||
drawing.get_default_drawing_path("unique_name").should_be_called().will_return("drawing_path")
|
||||
|
||||
@@ -203,6 +203,7 @@ class TestGetDebugInfo(NewFile):
|
||||
"bonsai_version",
|
||||
"bonsai_commit_hash",
|
||||
"bonsai_commit_date",
|
||||
"bonsai_git_branch",
|
||||
"last_actions",
|
||||
"last_error",
|
||||
}
|
||||
|
||||
+22
-1
@@ -21,6 +21,7 @@ import http.server
|
||||
import time
|
||||
import urllib.parse
|
||||
import uuid
|
||||
import warnings
|
||||
import webbrowser
|
||||
from typing import TYPE_CHECKING, Any, Literal, Optional, TypedDict
|
||||
|
||||
@@ -521,7 +522,17 @@ class Client:
|
||||
headers = {"User-Agent": "IfcOpenShell.bSDD.py/0.8.0"}
|
||||
if is_auth_required:
|
||||
headers["Authorization"] = "Bearer " + self.get_access_token()
|
||||
return requests.get(f"{self.baseurl}{endpoint}", timeout=10, headers=headers, params=params or None).json()
|
||||
response = requests.get(f"{self.baseurl}{endpoint}", timeout=10, headers=headers, params=params or None)
|
||||
try:
|
||||
response.raise_for_status()
|
||||
except requests.exceptions.HTTPError as e:
|
||||
try:
|
||||
data = response.json()
|
||||
message = data.get("message", data.get("error", str(e)))
|
||||
except requests.exceptions.JSONDecodeError:
|
||||
message = response.text or str(e)
|
||||
raise requests.exceptions.HTTPError(f"{e}: {message}", response=response) from e
|
||||
return response.json()
|
||||
|
||||
def _get_deprecated(self, endpoint, params=None, is_auth_required=False):
|
||||
headers = {"User-Agent": "IfcOpenShell.bSDD.py/0.8.0"}
|
||||
@@ -769,6 +780,16 @@ class Client:
|
||||
Get Class details
|
||||
this API replaces Classification
|
||||
"""
|
||||
# Not very well documented on bsdd side,
|
||||
# the deprecation note only occurs when you run into rate limit.
|
||||
# See https://github.com/buildingSMART/bSDD/issues/149
|
||||
if include_class_properties:
|
||||
warnings.warn(
|
||||
"include_class_properties=True is deprecated and heavily rate-limited by the bSDD API. "
|
||||
"Use get_class_properties() instead.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
endpoint = f"Class/v{version}"
|
||||
params = {
|
||||
"Uri": class_uri,
|
||||
|
||||
@@ -31,6 +31,7 @@ def test_get_nbs_classes():
|
||||
|
||||
def test_get_class():
|
||||
uri_light_fixture = next(l for l in get_ifc_classes()["classes"] if "IfcLightFixture" == l["code"])["uri"]
|
||||
# TODO: fix deprecation warning.
|
||||
ifc4x3_light_fixture = client.get_class(uri_light_fixture)
|
||||
assert "Maintenance Factor" and "Light Fixture Mounting Type" in [
|
||||
l["name"] for l in ifc4x3_light_fixture["classProperties"]
|
||||
@@ -39,7 +40,7 @@ def test_get_class():
|
||||
|
||||
def test_get_class_relations():
|
||||
uri_light_fixture = next(l for l in get_ifc_classes()["classes"] if "IfcLightFixture" == l["code"])["uri"]
|
||||
ifc4x3_light_fixture_relations = client.get_class_properties(uri_light_fixture, True)
|
||||
ifc4x3_light_fixture_relations = client.get_class_relations(uri_light_fixture, True)
|
||||
assert "Electrical unit for light-line system" and "Tubelight system" in [
|
||||
r["className"] for r in ifc4x3_light_fixture_relations["classRelations"]
|
||||
]
|
||||
|
||||
@@ -82,6 +82,11 @@ MAIN_CSV_HEADER_COLUMNS.extend(
|
||||
)
|
||||
|
||||
|
||||
class CostRate(TypedDict):
|
||||
Schedule: str | None
|
||||
RateID: str | None
|
||||
|
||||
|
||||
class CostItem(TypedDict):
|
||||
children: list[CostItem]
|
||||
ifc: NotRequired[ifcopenshell.entity_instance]
|
||||
@@ -97,6 +102,7 @@ class CostItem(TypedDict):
|
||||
Property: Union[str, None]
|
||||
Query: Union[str, None]
|
||||
|
||||
CostRate: CostRate | None
|
||||
Formula: Union[str, None]
|
||||
# QuantityClass: Union[str, None]
|
||||
|
||||
@@ -239,7 +245,7 @@ class Csv2Ifc:
|
||||
cost_values = float(cost_values) if cost_values else None
|
||||
|
||||
if self.has_rates:
|
||||
cost_rate = {
|
||||
cost_rate: CostRate = {
|
||||
"Schedule": row[(self.headers["RateSchedule"])] if "RateSchedule" in self.headers else None,
|
||||
"RateID": row[(self.headers["RateID"])] if "RateID" in self.headers else None,
|
||||
}
|
||||
|
||||
@@ -26,7 +26,8 @@ import logging
|
||||
import os
|
||||
import time
|
||||
from collections import Counter
|
||||
from typing import Optional, TypedDict, Union
|
||||
from typing import Optional, Union
|
||||
from typing_extensions import TypedDict
|
||||
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.cost
|
||||
@@ -35,7 +36,7 @@ import ifcopenshell.util.element
|
||||
import ifcopenshell.util.unit
|
||||
|
||||
|
||||
class CostItem(TypedDict):
|
||||
class CostItem(TypedDict, extra_items=float):
|
||||
# Exported columns.
|
||||
Index: int
|
||||
Hierarchy: str
|
||||
|
||||
@@ -17,6 +17,7 @@ classifiers = [
|
||||
]
|
||||
dependencies = [
|
||||
"ifcopenshell",
|
||||
"typing_extensions",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
|
||||
@@ -53,6 +53,8 @@ class ClashResult(TypedDict):
|
||||
p1: list[float]
|
||||
p2: list[float]
|
||||
distance: float
|
||||
# Added by `Clasher.smart_group_clashes`.
|
||||
smart_group: NotRequired[int]
|
||||
|
||||
|
||||
class ClashSet(TypedDict):
|
||||
@@ -286,7 +288,8 @@ class Clasher:
|
||||
|
||||
positions = []
|
||||
for clash in clashes.values():
|
||||
positions.append(clash["position"])
|
||||
# Midpoint of p1/p2 as an approximation of the clash location for clustering purposes.
|
||||
positions.append([(a + b) / 2 for a, b in zip(clash["p1"], clash["p2"])])
|
||||
|
||||
data = np.array(positions)
|
||||
|
||||
|
||||
@@ -675,7 +675,7 @@ int main(int argc, char** argv) {
|
||||
time_t start, end;
|
||||
time(&start);
|
||||
if (output_extension == XML) {
|
||||
XmlSerializer s(ifc_file, IfcUtil::path::to_utf8(output_temp_filename), logger);
|
||||
XmlSerializer s(ifc_file, IfcUtil::path::to_utf8(output_temp_filename), &logger);
|
||||
logger.Status("Writing XML output...");
|
||||
s.finalize();
|
||||
} else {
|
||||
@@ -834,14 +834,14 @@ int main(int argc, char** argv) {
|
||||
if (output_extension == OBJ) {
|
||||
// Do not use temp file for MTL as it's such a small file.
|
||||
const path_t mtl_filename = change_extension(output_filename, MTL);
|
||||
serializer = boost::make_shared<WaveFrontOBJSerializer>(IfcUtil::path::to_utf8(output_temp_filename), IfcUtil::path::to_utf8(mtl_filename), geometry_settings, serializer_settings, logger);
|
||||
serializer = boost::make_shared<WaveFrontOBJSerializer>(IfcUtil::path::to_utf8(output_temp_filename), IfcUtil::path::to_utf8(mtl_filename), geometry_settings, serializer_settings, &logger);
|
||||
#ifdef WITH_OPENCOLLADA
|
||||
} else if (output_extension == DAE) {
|
||||
serializer = boost::make_shared<ColladaSerializer>(IfcUtil::path::to_utf8(output_temp_filename), geometry_settings, serializer_settings, logger);
|
||||
serializer = boost::make_shared<ColladaSerializer>(IfcUtil::path::to_utf8(output_temp_filename), geometry_settings, serializer_settings, &logger);
|
||||
#endif
|
||||
#ifdef WITH_GLTF
|
||||
} else if (output_extension == GLB) {
|
||||
serializer = boost::make_shared<GltfSerializer>(IfcUtil::path::to_utf8(output_temp_filename), geometry_settings, serializer_settings, logger);
|
||||
serializer = boost::make_shared<GltfSerializer>(IfcUtil::path::to_utf8(output_temp_filename), geometry_settings, serializer_settings, &logger);
|
||||
#endif
|
||||
#ifdef WITH_USD
|
||||
} else if (output_extension == USD || output_extension == USDA || output_extension == USDC) {
|
||||
@@ -858,15 +858,15 @@ int main(int argc, char** argv) {
|
||||
serializer = boost::make_shared<IgesSerializer>(IfcUtil::path::to_utf8(output_temp_filename), geometry_settings, serializer_settings, logger);
|
||||
} else if (output_extension == SVG) {
|
||||
geometry_settings.get<ifcopenshell::geometry::settings::IteratorOutput>().value = ifcopenshell::geometry::settings::NATIVE;
|
||||
serializer = boost::make_shared<SvgSerializer>(IfcUtil::path::to_utf8(output_temp_filename), geometry_settings, serializer_settings, logger);
|
||||
serializer = boost::make_shared<SvgSerializer>(IfcUtil::path::to_utf8(output_temp_filename), geometry_settings, serializer_settings, &logger);
|
||||
#ifdef WITH_HDF5
|
||||
} else if (output_extension == HDF) {
|
||||
geometry_settings.get<ifcopenshell::geometry::settings::IteratorOutput>().value = ifcopenshell::geometry::settings::NATIVE;
|
||||
serializer = boost::make_shared<HdfSerializer>(IfcUtil::path::to_utf8(output_temp_filename), geometry_settings, serializer_settings, false, logger);
|
||||
serializer = boost::make_shared<HdfSerializer>(IfcUtil::path::to_utf8(output_temp_filename), geometry_settings, serializer_settings, false, &logger);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
} else if (output_extension == TTL) {
|
||||
serializer = boost::make_shared<TtlWktSerializer>(IfcUtil::path::to_utf8(output_temp_filename), geometry_settings, serializer_settings, logger);
|
||||
serializer = boost::make_shared<TtlWktSerializer>(IfcUtil::path::to_utf8(output_temp_filename), geometry_settings, serializer_settings, &logger);
|
||||
} else {
|
||||
cerr_ << "[Error] Unknown output filename extension '" << output_extension << "'\n";
|
||||
write_log(!quiet);
|
||||
@@ -1011,7 +1011,7 @@ int main(int argc, char** argv) {
|
||||
if (!vmap.count("cache-file")) {
|
||||
cache_file = input_filename + CACHE + HDF;
|
||||
}
|
||||
cache.reset(new HdfSerializer(IfcUtil::path::to_utf8(cache_file), geometry_settings, serializer_settings, false, logger));
|
||||
cache.reset(new HdfSerializer(IfcUtil::path::to_utf8(cache_file), geometry_settings, serializer_settings, false, &logger));
|
||||
context_iterator->set_cache(cache.get());
|
||||
}
|
||||
#endif
|
||||
@@ -1290,7 +1290,7 @@ bool init_input_file(const std::string& filename, IfcParse::IfcFile*& ifc_file,
|
||||
|
||||
#ifdef WITH_IFCXML
|
||||
if (boost::ends_with(boost::to_lower_copy(filename), ".ifcxml")) {
|
||||
ifc_file = IfcParse::parse_ifcxml(filename, logger);
|
||||
ifc_file = IfcParse::parse_ifcxml(filename, &logger);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ PLATFORMTAG:=win_amd64
|
||||
endif
|
||||
|
||||
BINARY_VERSION:=0.8.6
|
||||
BUILD_COMMIT:=3e7b739
|
||||
BUILD_COMMIT:=821cf7b
|
||||
IOS_URL:=https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-$(PYNUMBER)-v$(BINARY_VERSION)-$(BUILD_COMMIT)-$(PLATFORM).zip
|
||||
IFCCONVERT_URL:=https://s3.amazonaws.com/ifcopenshell-builds/IfcConvert-v$(BINARY_VERSION)-$(BUILD_COMMIT)-$(PLATFORM).zip
|
||||
|
||||
|
||||
@@ -97,7 +97,19 @@ from .file import file as _file
|
||||
from .sql import sqlite, sqlite_entity
|
||||
|
||||
get_log = ifcopenshell_wrapper.get_log
|
||||
logger = getattr(ifcopenshell_wrapper, "logger", None)
|
||||
logger = ifcopenshell_wrapper.logger if hasattr(ifcopenshell_wrapper, "logger") else None
|
||||
if hasattr(ifcopenshell_wrapper, "logger_or_root"):
|
||||
logger_or_root = ifcopenshell_wrapper.logger_or_root
|
||||
else:
|
||||
|
||||
def logger_or_root(_logger: ifcopenshell_wrapper.logger | None) -> None:
|
||||
return None
|
||||
|
||||
|
||||
# TODO: drop this function and all callsites after we migrate to the new build.
|
||||
def optional_logger_args(logger: ifcopenshell_wrapper.logger | None) -> tuple[logger] | tuple[()]:
|
||||
return (logger,) if logger is not None else ()
|
||||
|
||||
|
||||
# explicitly specify available imported symbols
|
||||
# (it's a requirement for a typed library)
|
||||
@@ -194,10 +206,9 @@ def open(
|
||||
raise FileNotFoundError(f"Path does not exist: '{path}'.")
|
||||
if format is None:
|
||||
format = guess_format(path)
|
||||
if logger is None and (logger_type := getattr(ifcopenshell_wrapper, "logger", None)):
|
||||
logger = logger_type.Root()
|
||||
logger = logger_or_root(logger)
|
||||
if format == ".ifcXML":
|
||||
f = ifcopenshell_wrapper.parse_ifcxml(str(path.absolute()), *((logger,) if logger is not None else ()))
|
||||
f = ifcopenshell_wrapper.parse_ifcxml(str(path.absolute()), *optional_logger_args(logger))
|
||||
if f:
|
||||
return file(f)
|
||||
raise OSError(f"Failed to parse .ifcXML file from {path}")
|
||||
@@ -214,11 +225,9 @@ def open(
|
||||
if should_stream:
|
||||
return stream(path)
|
||||
if readonly: # Temporary conditional see #7131. Remove once newer builds don't segfault on Linux.
|
||||
f = ifcopenshell_wrapper.open(str(path.absolute()), readonly, *((logger,) if logger is not None else ()))
|
||||
f = ifcopenshell_wrapper.open(str(path.absolute()), readonly, *optional_logger_args(logger))
|
||||
elif bypass_types:
|
||||
f = ifcopenshell_wrapper.file(
|
||||
ifcopenshell_wrapper.uninitialized_tag(), *((logger,) if logger is not None else ())
|
||||
)
|
||||
f = ifcopenshell_wrapper.file(ifcopenshell_wrapper.uninitialized_tag(), *optional_logger_args(logger))
|
||||
for ty in bypass_types:
|
||||
f.bypass_type(ty)
|
||||
if mmap:
|
||||
@@ -233,7 +242,7 @@ def open(
|
||||
kwargs["logger"] = logger
|
||||
f = ifcopenshell_wrapper.open(str(path.absolute()), **kwargs)
|
||||
else:
|
||||
f = ifcopenshell_wrapper.open(str(path.absolute()), False, *((logger,) if logger is not None else ()))
|
||||
f = ifcopenshell_wrapper.open(str(path.absolute()), False, *optional_logger_args(logger))
|
||||
return file(f)
|
||||
|
||||
|
||||
@@ -305,12 +314,13 @@ def schema_by_name(
|
||||
you are testing non-ISO IFC releases.
|
||||
:return: Schema definition object.
|
||||
"""
|
||||
import ifcopenshell.util.schema
|
||||
|
||||
assert schema_version or schema, "Either schema or schema_version must be specified."
|
||||
if schema_version:
|
||||
prefixes = ("IFC", "X", "_ADD", "_TC")
|
||||
schema = "".join("".join(map(str, t)) if t[1] else "" for t in zip(prefixes, schema_version))
|
||||
schema = ifcopenshell.util.schema.get_schema_name_from_version(schema_version)
|
||||
else:
|
||||
schema = {"IFC4X3": "IFC4X3_ADD2"}.get(schema, schema)
|
||||
schema = ifcopenshell.util.schema.get_schema_identifier(schema)
|
||||
return ifcopenshell_wrapper.schema_by_name(schema)
|
||||
|
||||
|
||||
|
||||
@@ -90,9 +90,9 @@ def add_boolean(
|
||||
|
||||
booleans = []
|
||||
for second_item in second_items:
|
||||
if first.is_a("IfcTesselatedFaceSet"):
|
||||
if first.is_a("IfcTessellatedFaceSet"):
|
||||
first.Closed = True # For now, trust the user to do the right thing.
|
||||
if second_item.is_a("IfcTesselatedFaceSet"):
|
||||
if second_item.is_a("IfcTessellatedFaceSet"):
|
||||
second_item.Closed = True # For now, trust the user to do the right thing.
|
||||
if (
|
||||
operator == "DIFFERENCE"
|
||||
|
||||
@@ -107,8 +107,7 @@ def main(
|
||||
progress_function: Callable = DO_NOTHING,
|
||||
logger=None,
|
||||
):
|
||||
if logger is None and ifcopenshell.logger is not None:
|
||||
logger = ifcopenshell.logger.Root()
|
||||
logger = ifcopenshell.logger_or_root(logger)
|
||||
|
||||
def by_guid(g):
|
||||
for f in files:
|
||||
|
||||
@@ -409,9 +409,9 @@ class entity_instance:
|
||||
@overload
|
||||
def is_a(self) -> str: ...
|
||||
@overload
|
||||
def is_a(self, ifc_class: str) -> bool: ...
|
||||
def is_a(self, ifc_class: str, /) -> bool: ...
|
||||
@overload
|
||||
def is_a(self, with_schema: bool) -> str: ...
|
||||
def is_a(self, with_schema: bool, /) -> str: ...
|
||||
def is_a(self, *args: Union[str, bool]) -> Union[str, bool]:
|
||||
"""Return the IFC class name of an instance, or checks if an instance belongs to a class.
|
||||
|
||||
|
||||
@@ -23,10 +23,7 @@ import itertools
|
||||
|
||||
from pyparsing import *
|
||||
|
||||
try:
|
||||
from functools import reduce
|
||||
except:
|
||||
pass
|
||||
from functools import reduce
|
||||
|
||||
|
||||
class Expression:
|
||||
@@ -97,15 +94,15 @@ PERIOD = Suppress(".")
|
||||
HASH = Suppress("#")
|
||||
|
||||
identifier = Word(alphanums + "_")
|
||||
keyword = Word(alphanums + "_").setParseAction(Keyword)
|
||||
keyword = Word(alphanums + "_").set_parse_action(Keyword)
|
||||
expression = Forward()
|
||||
optional = Group(LBRACK + expression + RBRACK).setParseAction(Optional)
|
||||
repeated = Group(LBRACE + expression + RBRACE).setParseAction(Repeated)
|
||||
terminal = quotedString.setParseAction(Terminal)
|
||||
term = (keyword | terminal | optional | repeated | (LPAREN + expression + RPAREN)).setParseAction(Term)
|
||||
concat = Group(term + OneOrMore(term)).setParseAction(Concat)
|
||||
optional = Group(LBRACK + expression + RBRACK).set_parse_action(Optional)
|
||||
repeated = Group(LBRACE + expression + RBRACE).set_parse_action(Repeated)
|
||||
terminal = quotedString.set_parse_action(Terminal)
|
||||
term = (keyword | terminal | optional | repeated | (LPAREN + expression + RPAREN)).set_parse_action(Term)
|
||||
concat = Group(term + OneOrMore(term)).set_parse_action(Concat)
|
||||
factor = concat | term
|
||||
union = Group(factor + OneOrMore(VBAR + factor)).setParseAction(Union)
|
||||
union = Group(factor + OneOrMore(VBAR + factor)).set_parse_action(Union)
|
||||
rule = identifier + EQUALS + expression + PERIOD
|
||||
|
||||
expression << (union | factor)
|
||||
@@ -113,7 +110,7 @@ expression << (union | factor)
|
||||
grammar = OneOrMore(Group(rule))
|
||||
grammar.ignore(HASH + restOfLine)
|
||||
|
||||
express = grammar.parseFile(os.path.join(os.path.dirname(__file__), "express.bnf"))
|
||||
express = grammar.parse_file(os.path.join(os.path.dirname(__file__), "express.bnf"))
|
||||
|
||||
|
||||
def find_bytype(expr, ty, li=None):
|
||||
@@ -161,6 +158,8 @@ statements = []
|
||||
|
||||
terminals = reduce(lambda x, y: x | y, (find_bytype(e, Terminal) for id, e in express))
|
||||
keywords = list(filter(operator.attrgetter("is_keyword"), terminals))
|
||||
# terminals is identity-ordered (no __eq__/__hash__), so sort for determinism
|
||||
keywords.sort(key=lambda x: repr(x))
|
||||
negated_keywords = map(lambda s: "~%s" % s, keywords)
|
||||
no_action = {
|
||||
"letter",
|
||||
@@ -185,36 +184,36 @@ while True:
|
||||
emitted.add(id)
|
||||
stmt = "(%s)" % expr
|
||||
if id in to_combine:
|
||||
stmt = " + ".join(itertools.chain(negated_keywords, ("originalTextFor(Combine%s)" % stmt,)))
|
||||
stmt = " + ".join(itertools.chain(negated_keywords, ("original_text_for(Combine%s)" % stmt,)))
|
||||
elif id in to_original_text:
|
||||
# We use lower() because it better matches the previous default of the CaselessLiterals for individual lexemes and express dictates case-insensitive comparisons anyway
|
||||
stmt = "(originalTextFor%s).addParseAction(tokenMap(str.lower))" % stmt
|
||||
stmt = "(original_text_for%s).add_parse_action(token_map(str.lower))" % stmt
|
||||
if id not in no_action and not isinstance(expr.contents, Keyword) and not id in to_combine:
|
||||
node_type = "ListNode" if "ZeroOrMore" in stmt else "Node"
|
||||
action = actions.get(id, 'lambda s, loc, t: %s(s, loc, t, rule="%s")' % (node_type, id))
|
||||
stmt = "%s.setParseAction(%s)" % (stmt, action)
|
||||
stmt = "%s.set_parse_action(%s)" % (stmt, action)
|
||||
statements.append('%s = %s("%s")' % (id, stmt, id))
|
||||
to_emit -= emitted_in_loop
|
||||
if not emitted_in_loop:
|
||||
break
|
||||
|
||||
for id in to_emit:
|
||||
for id in sorted(to_emit):
|
||||
statements.append('%s = Forward()("%s")' % (id, id))
|
||||
|
||||
for id in to_emit:
|
||||
for id in sorted(to_emit):
|
||||
expr = [e for k, e in express if k == id][0]
|
||||
stmt = "(%s)" % expr
|
||||
if id in to_combine:
|
||||
stmt = "Suppress%s" % stmt
|
||||
elif id in to_original_text:
|
||||
stmt = "(originalTextFor%s).addParseAction(tokenMap(str.lower))" % stmt
|
||||
stmt = "(original_text_for%s).add_parse_action(token_map(str.lower))" % stmt
|
||||
if id not in no_action and not isinstance(expr.contents, Keyword):
|
||||
children = list(
|
||||
map(operator.attrgetter("contents"), reduce(lambda x, y: x | y, (find_bytype(e, Keyword) for e in [expr])))
|
||||
)
|
||||
has_duplicates = len(children) > len(set(children))
|
||||
node_type = "ListNode" if ("ZeroOrMore" in stmt or has_duplicates) else "Node"
|
||||
action = ".setParseAction(%s)" % (
|
||||
action = ".set_parse_action(%s)" % (
|
||||
actions[id] if id in actions else 'lambda s, loc, t: %s(s, loc, t, rule="%s")' % (node_type, id)
|
||||
)
|
||||
stmt = "(%s)%s" % (stmt, action)
|
||||
@@ -222,7 +221,7 @@ for id in to_emit:
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(r"""
|
||||
# This file is generated by IfcOpenShell ifcexpressparser bootstrap.py
|
||||
# This file is generated by ifcopenshell.express.bootstrap
|
||||
|
||||
from __future__ import annotations
|
||||
import os
|
||||
@@ -240,19 +239,19 @@ def parse(fn: str) -> mapping.Mapping:
|
||||
if os.path.exists(cache_file) and os.path.getmtime(cache_file) >= os.path.getmtime(fn):
|
||||
with open(cache_file, "rb") as f:
|
||||
m = pickle.load(f)
|
||||
else:
|
||||
else:
|
||||
%s
|
||||
|
||||
syntax.ignore("--" + restOfLine)
|
||||
syntax.ignore(Regex(r"\((?:\*(?:[^*]*\*+)+?\))"))
|
||||
ast = syntax.parseFile(fn)
|
||||
ast = syntax.parse_file(fn)
|
||||
s = schema.Schema(ast)
|
||||
m = mapping.Mapping(s)
|
||||
|
||||
with open(cache_file, "wb") as f:
|
||||
pickle.dump(m, f, protocol=0)
|
||||
return m
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
m = parse(sys.argv[1])
|
||||
import importlib
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
import itertools
|
||||
import functools
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def indent(n, s):
|
||||
@@ -36,15 +37,4 @@ class Base:
|
||||
"""
|
||||
|
||||
def emit(self):
|
||||
import platform
|
||||
|
||||
if tuple(map(int, platform.python_version_tuple())) < (2, 8):
|
||||
from io import open as unicode_open
|
||||
|
||||
unicode_type = unicode
|
||||
else:
|
||||
unicode_open = open
|
||||
unicode_type = lambda x, *args, **kwargs: x
|
||||
f = unicode_open(self.file_name, "w", encoding="utf-8")
|
||||
f.write(unicode_type(repr(self), encoding="utf-8", errors="ignore"))
|
||||
f.close()
|
||||
Path(self.file_name).write_text(repr(self), encoding="utf-8")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
# This file is generated by IfcOpenShell ifcexpressparser bootstrap.py
|
||||
# This file is generated by ifcopenshell.express.bootstrap
|
||||
|
||||
from __future__ import annotations
|
||||
import os
|
||||
@@ -17,184 +17,184 @@ def parse(fn: str) -> mapping.Mapping:
|
||||
if os.path.exists(cache_file) and os.path.getmtime(cache_file) >= os.path.getmtime(fn):
|
||||
with open(cache_file, "rb") as f:
|
||||
m = pickle.load(f)
|
||||
else:
|
||||
ABS = (CaselessKeyword("abs")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ABS"))("ABS")
|
||||
ABSTRACT = (CaselessKeyword("abstract")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ABSTRACT"))("ABSTRACT")
|
||||
ACOS = (CaselessKeyword("acos")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ACOS"))("ACOS")
|
||||
AGGREGATE = (CaselessKeyword("aggregate")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="AGGREGATE"))("AGGREGATE")
|
||||
ALIAS = (CaselessKeyword("alias")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ALIAS"))("ALIAS")
|
||||
AND = (CaselessKeyword("and")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="AND"))("AND")
|
||||
ANDOR = (CaselessKeyword("andor")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ANDOR"))("ANDOR")
|
||||
ARRAY = (CaselessKeyword("array")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ARRAY"))("ARRAY")
|
||||
AS = (CaselessKeyword("as")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="AS"))("AS")
|
||||
ASIN = (CaselessKeyword("asin")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ASIN"))("ASIN")
|
||||
ATAN = (CaselessKeyword("atan")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ATAN"))("ATAN")
|
||||
BAG = (CaselessKeyword("bag")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BAG"))("BAG")
|
||||
BASED_ON = (CaselessKeyword("based_on")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BASED_ON"))("BASED_ON")
|
||||
BEGIN = (CaselessKeyword("begin")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BEGIN"))("BEGIN")
|
||||
BINARY = (CaselessKeyword("binary")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BINARY"))("BINARY")
|
||||
BLENGTH = (CaselessKeyword("blength")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BLENGTH"))("BLENGTH")
|
||||
BOOLEAN = (CaselessKeyword("boolean")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BOOLEAN"))("BOOLEAN")
|
||||
BY = (CaselessKeyword("by")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BY"))("BY")
|
||||
CASE = (CaselessKeyword("case")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="CASE"))("CASE")
|
||||
CONSTANT = (CaselessKeyword("constant")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="CONSTANT"))("CONSTANT")
|
||||
CONST_E = (CaselessKeyword("const_e")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="CONST_E"))("CONST_E")
|
||||
COS = (CaselessKeyword("cos")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="COS"))("COS")
|
||||
DERIVE = (CaselessKeyword("derive")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="DERIVE"))("DERIVE")
|
||||
DIV = (CaselessKeyword("div")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="DIV"))("DIV")
|
||||
ELSE = (CaselessKeyword("else")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ELSE"))("ELSE")
|
||||
END = (CaselessKeyword("end")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END"))("END")
|
||||
END_ALIAS = (CaselessKeyword("end_alias")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_ALIAS"))("END_ALIAS")
|
||||
END_CASE = (CaselessKeyword("end_case")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_CASE"))("END_CASE")
|
||||
END_CONSTANT = (CaselessKeyword("end_constant")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_CONSTANT"))("END_CONSTANT")
|
||||
END_ENTITY = (CaselessKeyword("end_entity")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_ENTITY"))("END_ENTITY")
|
||||
END_FUNCTION = (CaselessKeyword("end_function")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_FUNCTION"))("END_FUNCTION")
|
||||
END_IF = (CaselessKeyword("end_if")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_IF"))("END_IF")
|
||||
END_LOCAL = (CaselessKeyword("end_local")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_LOCAL"))("END_LOCAL")
|
||||
END_PROCEDURE = (CaselessKeyword("end_procedure")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_PROCEDURE"))("END_PROCEDURE")
|
||||
END_REPEAT = (CaselessKeyword("end_repeat")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_REPEAT"))("END_REPEAT")
|
||||
END_RULE = (CaselessKeyword("end_rule")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_RULE"))("END_RULE")
|
||||
END_SCHEMA = (CaselessKeyword("end_schema")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_SCHEMA"))("END_SCHEMA")
|
||||
END_SUBTYPE_CONSTRAINT = (CaselessKeyword("end_subtype_constraint")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_SUBTYPE_CONSTRAINT"))("END_SUBTYPE_CONSTRAINT")
|
||||
END_TYPE = (CaselessKeyword("end_type")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_TYPE"))("END_TYPE")
|
||||
ENTITY = (CaselessKeyword("entity")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ENTITY"))("ENTITY")
|
||||
ENUMERATION = (CaselessKeyword("enumeration")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ENUMERATION"))("ENUMERATION")
|
||||
ESCAPE = (CaselessKeyword("escape")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ESCAPE"))("ESCAPE")
|
||||
EXISTS = (CaselessKeyword("exists")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="EXISTS"))("EXISTS")
|
||||
EXTENSIBLE = (CaselessKeyword("extensible")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="EXTENSIBLE"))("EXTENSIBLE")
|
||||
EXP = (CaselessKeyword("exp")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="EXP"))("EXP")
|
||||
FALSE = (CaselessKeyword("false")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FALSE"))("FALSE")
|
||||
FIXED = (CaselessKeyword("fixed")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FIXED"))("FIXED")
|
||||
FOR = (CaselessKeyword("for")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FOR"))("FOR")
|
||||
FORMAT = (CaselessKeyword("format")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FORMAT"))("FORMAT")
|
||||
FROM = (CaselessKeyword("from")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FROM"))("FROM")
|
||||
FUNCTION = (CaselessKeyword("function")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FUNCTION"))("FUNCTION")
|
||||
GENERIC = (CaselessKeyword("generic")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="GENERIC"))("GENERIC")
|
||||
GENERIC_ENTITY = (CaselessKeyword("generic_entity")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="GENERIC_ENTITY"))("GENERIC_ENTITY")
|
||||
HIBOUND = (CaselessKeyword("hibound")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="HIBOUND"))("HIBOUND")
|
||||
HIINDEX = (CaselessKeyword("hiindex")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="HIINDEX"))("HIINDEX")
|
||||
IF = (CaselessKeyword("if")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="IF"))("IF")
|
||||
IN = (CaselessKeyword("in")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="IN"))("IN")
|
||||
INSERT = (CaselessKeyword("insert")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="INSERT"))("INSERT")
|
||||
INTEGER = (CaselessKeyword("integer")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="INTEGER"))("INTEGER")
|
||||
INVERSE = (CaselessKeyword("inverse")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="INVERSE"))("INVERSE")
|
||||
LENGTH = (CaselessKeyword("length")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LENGTH"))("LENGTH")
|
||||
LIKE = (CaselessKeyword("like")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LIKE"))("LIKE")
|
||||
LIST = (CaselessKeyword("list")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LIST"))("LIST")
|
||||
LOBOUND = (CaselessKeyword("lobound")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOBOUND"))("LOBOUND")
|
||||
LOCAL = (CaselessKeyword("local")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOCAL"))("LOCAL")
|
||||
LOG = (CaselessKeyword("log")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOG"))("LOG")
|
||||
LOG10 = (CaselessKeyword("log10")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOG10"))("LOG10")
|
||||
LOG2 = (CaselessKeyword("log2")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOG2"))("LOG2")
|
||||
LOGICAL = (CaselessKeyword("logical")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOGICAL"))("LOGICAL")
|
||||
LOINDEX = (CaselessKeyword("loindex")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOINDEX"))("LOINDEX")
|
||||
MOD = (CaselessKeyword("mod")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="MOD"))("MOD")
|
||||
NOT = (CaselessKeyword("not")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="NOT"))("NOT")
|
||||
NUMBER = (CaselessKeyword("number")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="NUMBER"))("NUMBER")
|
||||
NVL = (CaselessKeyword("nvl")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="NVL"))("NVL")
|
||||
ODD = (CaselessKeyword("odd")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ODD"))("ODD")
|
||||
OF = (CaselessKeyword("of")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="OF"))("OF")
|
||||
ONEOF = (CaselessKeyword("oneof")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ONEOF"))("ONEOF")
|
||||
OPTIONAL = (CaselessKeyword("optional")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="OPTIONAL"))("OPTIONAL")
|
||||
OR = (CaselessKeyword("or")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="OR"))("OR")
|
||||
OTHERWISE = (CaselessKeyword("otherwise")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="OTHERWISE"))("OTHERWISE")
|
||||
PI = (CaselessKeyword("pi")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="PI"))("PI")
|
||||
PROCEDURE = (CaselessKeyword("procedure")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="PROCEDURE"))("PROCEDURE")
|
||||
QUERY = (CaselessKeyword("query")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="QUERY"))("QUERY")
|
||||
REAL = (CaselessKeyword("real")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="REAL"))("REAL")
|
||||
REFERENCE = (CaselessKeyword("reference")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="REFERENCE"))("REFERENCE")
|
||||
REMOVE = (CaselessKeyword("remove")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="REMOVE"))("REMOVE")
|
||||
RENAMED = (CaselessKeyword("renamed")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="RENAMED"))("RENAMED")
|
||||
REPEAT = (CaselessKeyword("repeat")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="REPEAT"))("REPEAT")
|
||||
RETURN = (CaselessKeyword("return")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="RETURN"))("RETURN")
|
||||
ROLESOF = (CaselessKeyword("rolesof")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ROLESOF"))("ROLESOF")
|
||||
RULE = (CaselessKeyword("rule")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="RULE"))("RULE")
|
||||
SCHEMA = (CaselessKeyword("schema")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SCHEMA"))("SCHEMA")
|
||||
SELECT = (CaselessKeyword("select")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SELECT"))("SELECT")
|
||||
SELF = (CaselessKeyword("self")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SELF"))("SELF")
|
||||
SET = (CaselessKeyword("set")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SET"))("SET")
|
||||
SIN = (CaselessKeyword("sin")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SIN"))("SIN")
|
||||
SIZEOF = (CaselessKeyword("sizeof")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SIZEOF"))("SIZEOF")
|
||||
SKIP = (CaselessKeyword("skip")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SKIP"))("SKIP")
|
||||
SQRT = (CaselessKeyword("sqrt")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SQRT"))("SQRT")
|
||||
STRING = (CaselessKeyword("string")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="STRING"))("STRING")
|
||||
SUBTYPE = (CaselessKeyword("subtype")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SUBTYPE"))("SUBTYPE")
|
||||
SUBTYPE_CONSTRAINT = (CaselessKeyword("subtype_constraint")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SUBTYPE_CONSTRAINT"))("SUBTYPE_CONSTRAINT")
|
||||
SUPERTYPE = (CaselessKeyword("supertype")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SUPERTYPE"))("SUPERTYPE")
|
||||
TAN = (CaselessKeyword("tan")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TAN"))("TAN")
|
||||
THEN = (CaselessKeyword("then")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="THEN"))("THEN")
|
||||
TO = (CaselessKeyword("to")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TO"))("TO")
|
||||
TOTAL_OVER = (CaselessKeyword("total_over")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TOTAL_OVER"))("TOTAL_OVER")
|
||||
TRUE = (CaselessKeyword("true")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TRUE"))("TRUE")
|
||||
TYPE = (CaselessKeyword("type")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TYPE"))("TYPE")
|
||||
TYPEOF = (CaselessKeyword("typeof")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TYPEOF"))("TYPEOF")
|
||||
UNIQUE = (CaselessKeyword("unique")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="UNIQUE"))("UNIQUE")
|
||||
UNKNOWN = (CaselessKeyword("unknown")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="UNKNOWN"))("UNKNOWN")
|
||||
UNTIL = (CaselessKeyword("until")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="UNTIL"))("UNTIL")
|
||||
USE = (CaselessKeyword("use")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="USE"))("USE")
|
||||
USEDIN = (CaselessKeyword("usedin")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="USEDIN"))("USEDIN")
|
||||
VALUE = (CaselessKeyword("value")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="VALUE"))("VALUE")
|
||||
VALUE_IN = (CaselessKeyword("value_in")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="VALUE_IN"))("VALUE_IN")
|
||||
VALUE_UNIQUE = (CaselessKeyword("value_unique")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="VALUE_UNIQUE"))("VALUE_UNIQUE")
|
||||
VAR = (CaselessKeyword("var")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="VAR"))("VAR")
|
||||
WHERE = (CaselessKeyword("where")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="WHERE"))("WHERE")
|
||||
WHILE = (CaselessKeyword("while")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="WHILE"))("WHILE")
|
||||
WITH = (CaselessKeyword("with")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="WITH"))("WITH")
|
||||
XOR = (CaselessKeyword("xor")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="XOR"))("XOR")
|
||||
bit = ((CaselessLiteral("0") | CaselessLiteral("1"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="bit"))("bit")
|
||||
else:
|
||||
ABS = (CaselessKeyword("abs")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ABS"))("ABS")
|
||||
ABSTRACT = (CaselessKeyword("abstract")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ABSTRACT"))("ABSTRACT")
|
||||
ACOS = (CaselessKeyword("acos")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ACOS"))("ACOS")
|
||||
AGGREGATE = (CaselessKeyword("aggregate")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="AGGREGATE"))("AGGREGATE")
|
||||
ALIAS = (CaselessKeyword("alias")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ALIAS"))("ALIAS")
|
||||
AND = (CaselessKeyword("and")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="AND"))("AND")
|
||||
ANDOR = (CaselessKeyword("andor")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ANDOR"))("ANDOR")
|
||||
ARRAY = (CaselessKeyword("array")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ARRAY"))("ARRAY")
|
||||
AS = (CaselessKeyword("as")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="AS"))("AS")
|
||||
ASIN = (CaselessKeyword("asin")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ASIN"))("ASIN")
|
||||
ATAN = (CaselessKeyword("atan")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ATAN"))("ATAN")
|
||||
BAG = (CaselessKeyword("bag")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BAG"))("BAG")
|
||||
BASED_ON = (CaselessKeyword("based_on")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BASED_ON"))("BASED_ON")
|
||||
BEGIN = (CaselessKeyword("begin")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BEGIN"))("BEGIN")
|
||||
BINARY = (CaselessKeyword("binary")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BINARY"))("BINARY")
|
||||
BLENGTH = (CaselessKeyword("blength")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BLENGTH"))("BLENGTH")
|
||||
BOOLEAN = (CaselessKeyword("boolean")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BOOLEAN"))("BOOLEAN")
|
||||
BY = (CaselessKeyword("by")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BY"))("BY")
|
||||
CASE = (CaselessKeyword("case")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="CASE"))("CASE")
|
||||
CONSTANT = (CaselessKeyword("constant")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="CONSTANT"))("CONSTANT")
|
||||
CONST_E = (CaselessKeyword("const_e")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="CONST_E"))("CONST_E")
|
||||
COS = (CaselessKeyword("cos")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="COS"))("COS")
|
||||
DERIVE = (CaselessKeyword("derive")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="DERIVE"))("DERIVE")
|
||||
DIV = (CaselessKeyword("div")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="DIV"))("DIV")
|
||||
ELSE = (CaselessKeyword("else")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ELSE"))("ELSE")
|
||||
END = (CaselessKeyword("end")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END"))("END")
|
||||
END_ALIAS = (CaselessKeyword("end_alias")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_ALIAS"))("END_ALIAS")
|
||||
END_CASE = (CaselessKeyword("end_case")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_CASE"))("END_CASE")
|
||||
END_CONSTANT = (CaselessKeyword("end_constant")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_CONSTANT"))("END_CONSTANT")
|
||||
END_ENTITY = (CaselessKeyword("end_entity")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_ENTITY"))("END_ENTITY")
|
||||
END_FUNCTION = (CaselessKeyword("end_function")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_FUNCTION"))("END_FUNCTION")
|
||||
END_IF = (CaselessKeyword("end_if")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_IF"))("END_IF")
|
||||
END_LOCAL = (CaselessKeyword("end_local")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_LOCAL"))("END_LOCAL")
|
||||
END_PROCEDURE = (CaselessKeyword("end_procedure")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_PROCEDURE"))("END_PROCEDURE")
|
||||
END_REPEAT = (CaselessKeyword("end_repeat")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_REPEAT"))("END_REPEAT")
|
||||
END_RULE = (CaselessKeyword("end_rule")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_RULE"))("END_RULE")
|
||||
END_SCHEMA = (CaselessKeyword("end_schema")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_SCHEMA"))("END_SCHEMA")
|
||||
END_SUBTYPE_CONSTRAINT = (CaselessKeyword("end_subtype_constraint")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_SUBTYPE_CONSTRAINT"))("END_SUBTYPE_CONSTRAINT")
|
||||
END_TYPE = (CaselessKeyword("end_type")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_TYPE"))("END_TYPE")
|
||||
ENTITY = (CaselessKeyword("entity")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ENTITY"))("ENTITY")
|
||||
ENUMERATION = (CaselessKeyword("enumeration")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ENUMERATION"))("ENUMERATION")
|
||||
ESCAPE = (CaselessKeyword("escape")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ESCAPE"))("ESCAPE")
|
||||
EXISTS = (CaselessKeyword("exists")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="EXISTS"))("EXISTS")
|
||||
EXTENSIBLE = (CaselessKeyword("extensible")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="EXTENSIBLE"))("EXTENSIBLE")
|
||||
EXP = (CaselessKeyword("exp")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="EXP"))("EXP")
|
||||
FALSE = (CaselessKeyword("false")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FALSE"))("FALSE")
|
||||
FIXED = (CaselessKeyword("fixed")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FIXED"))("FIXED")
|
||||
FOR = (CaselessKeyword("for")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FOR"))("FOR")
|
||||
FORMAT = (CaselessKeyword("format")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FORMAT"))("FORMAT")
|
||||
FROM = (CaselessKeyword("from")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FROM"))("FROM")
|
||||
FUNCTION = (CaselessKeyword("function")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FUNCTION"))("FUNCTION")
|
||||
GENERIC = (CaselessKeyword("generic")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="GENERIC"))("GENERIC")
|
||||
GENERIC_ENTITY = (CaselessKeyword("generic_entity")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="GENERIC_ENTITY"))("GENERIC_ENTITY")
|
||||
HIBOUND = (CaselessKeyword("hibound")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="HIBOUND"))("HIBOUND")
|
||||
HIINDEX = (CaselessKeyword("hiindex")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="HIINDEX"))("HIINDEX")
|
||||
IF = (CaselessKeyword("if")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="IF"))("IF")
|
||||
IN = (CaselessKeyword("in")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="IN"))("IN")
|
||||
INSERT = (CaselessKeyword("insert")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="INSERT"))("INSERT")
|
||||
INTEGER = (CaselessKeyword("integer")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="INTEGER"))("INTEGER")
|
||||
INVERSE = (CaselessKeyword("inverse")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="INVERSE"))("INVERSE")
|
||||
LENGTH = (CaselessKeyword("length")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LENGTH"))("LENGTH")
|
||||
LIKE = (CaselessKeyword("like")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LIKE"))("LIKE")
|
||||
LIST = (CaselessKeyword("list")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LIST"))("LIST")
|
||||
LOBOUND = (CaselessKeyword("lobound")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOBOUND"))("LOBOUND")
|
||||
LOCAL = (CaselessKeyword("local")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOCAL"))("LOCAL")
|
||||
LOG = (CaselessKeyword("log")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOG"))("LOG")
|
||||
LOG10 = (CaselessKeyword("log10")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOG10"))("LOG10")
|
||||
LOG2 = (CaselessKeyword("log2")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOG2"))("LOG2")
|
||||
LOGICAL = (CaselessKeyword("logical")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOGICAL"))("LOGICAL")
|
||||
LOINDEX = (CaselessKeyword("loindex")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOINDEX"))("LOINDEX")
|
||||
MOD = (CaselessKeyword("mod")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="MOD"))("MOD")
|
||||
NOT = (CaselessKeyword("not")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="NOT"))("NOT")
|
||||
NUMBER = (CaselessKeyword("number")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="NUMBER"))("NUMBER")
|
||||
NVL = (CaselessKeyword("nvl")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="NVL"))("NVL")
|
||||
ODD = (CaselessKeyword("odd")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ODD"))("ODD")
|
||||
OF = (CaselessKeyword("of")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="OF"))("OF")
|
||||
ONEOF = (CaselessKeyword("oneof")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ONEOF"))("ONEOF")
|
||||
OPTIONAL = (CaselessKeyword("optional")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="OPTIONAL"))("OPTIONAL")
|
||||
OR = (CaselessKeyword("or")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="OR"))("OR")
|
||||
OTHERWISE = (CaselessKeyword("otherwise")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="OTHERWISE"))("OTHERWISE")
|
||||
PI = (CaselessKeyword("pi")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="PI"))("PI")
|
||||
PROCEDURE = (CaselessKeyword("procedure")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="PROCEDURE"))("PROCEDURE")
|
||||
QUERY = (CaselessKeyword("query")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="QUERY"))("QUERY")
|
||||
REAL = (CaselessKeyword("real")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="REAL"))("REAL")
|
||||
REFERENCE = (CaselessKeyword("reference")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="REFERENCE"))("REFERENCE")
|
||||
REMOVE = (CaselessKeyword("remove")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="REMOVE"))("REMOVE")
|
||||
RENAMED = (CaselessKeyword("renamed")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="RENAMED"))("RENAMED")
|
||||
REPEAT = (CaselessKeyword("repeat")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="REPEAT"))("REPEAT")
|
||||
RETURN = (CaselessKeyword("return")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="RETURN"))("RETURN")
|
||||
ROLESOF = (CaselessKeyword("rolesof")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ROLESOF"))("ROLESOF")
|
||||
RULE = (CaselessKeyword("rule")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="RULE"))("RULE")
|
||||
SCHEMA = (CaselessKeyword("schema")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SCHEMA"))("SCHEMA")
|
||||
SELECT = (CaselessKeyword("select")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SELECT"))("SELECT")
|
||||
SELF = (CaselessKeyword("self")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SELF"))("SELF")
|
||||
SET = (CaselessKeyword("set")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SET"))("SET")
|
||||
SIN = (CaselessKeyword("sin")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SIN"))("SIN")
|
||||
SIZEOF = (CaselessKeyword("sizeof")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SIZEOF"))("SIZEOF")
|
||||
SKIP = (CaselessKeyword("skip")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SKIP"))("SKIP")
|
||||
SQRT = (CaselessKeyword("sqrt")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SQRT"))("SQRT")
|
||||
STRING = (CaselessKeyword("string")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="STRING"))("STRING")
|
||||
SUBTYPE = (CaselessKeyword("subtype")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SUBTYPE"))("SUBTYPE")
|
||||
SUBTYPE_CONSTRAINT = (CaselessKeyword("subtype_constraint")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SUBTYPE_CONSTRAINT"))("SUBTYPE_CONSTRAINT")
|
||||
SUPERTYPE = (CaselessKeyword("supertype")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SUPERTYPE"))("SUPERTYPE")
|
||||
TAN = (CaselessKeyword("tan")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TAN"))("TAN")
|
||||
THEN = (CaselessKeyword("then")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="THEN"))("THEN")
|
||||
TO = (CaselessKeyword("to")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TO"))("TO")
|
||||
TOTAL_OVER = (CaselessKeyword("total_over")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TOTAL_OVER"))("TOTAL_OVER")
|
||||
TRUE = (CaselessKeyword("true")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TRUE"))("TRUE")
|
||||
TYPE = (CaselessKeyword("type")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TYPE"))("TYPE")
|
||||
TYPEOF = (CaselessKeyword("typeof")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TYPEOF"))("TYPEOF")
|
||||
UNIQUE = (CaselessKeyword("unique")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="UNIQUE"))("UNIQUE")
|
||||
UNKNOWN = (CaselessKeyword("unknown")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="UNKNOWN"))("UNKNOWN")
|
||||
UNTIL = (CaselessKeyword("until")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="UNTIL"))("UNTIL")
|
||||
USE = (CaselessKeyword("use")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="USE"))("USE")
|
||||
USEDIN = (CaselessKeyword("usedin")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="USEDIN"))("USEDIN")
|
||||
VALUE = (CaselessKeyword("value")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="VALUE"))("VALUE")
|
||||
VALUE_IN = (CaselessKeyword("value_in")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="VALUE_IN"))("VALUE_IN")
|
||||
VALUE_UNIQUE = (CaselessKeyword("value_unique")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="VALUE_UNIQUE"))("VALUE_UNIQUE")
|
||||
VAR = (CaselessKeyword("var")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="VAR"))("VAR")
|
||||
WHERE = (CaselessKeyword("where")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="WHERE"))("WHERE")
|
||||
WHILE = (CaselessKeyword("while")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="WHILE"))("WHILE")
|
||||
WITH = (CaselessKeyword("with")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="WITH"))("WITH")
|
||||
XOR = (CaselessKeyword("xor")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="XOR"))("XOR")
|
||||
bit = ((CaselessLiteral("0") | CaselessLiteral("1"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="bit"))("bit")
|
||||
digit = ((CaselessLiteral("0") | CaselessLiteral("1") | CaselessLiteral("2") | CaselessLiteral("3") | CaselessLiteral("4") | CaselessLiteral("5") | CaselessLiteral("6") | CaselessLiteral("7") | CaselessLiteral("8") | CaselessLiteral("9")))("digit")
|
||||
digits = ((digit + ZeroOrMore(digit)))("digits")
|
||||
hex_digit = ((digit | CaselessLiteral("a") | CaselessLiteral("b") | CaselessLiteral("c") | CaselessLiteral("d") | CaselessLiteral("e") | CaselessLiteral("f"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="hex_digit"))("hex_digit")
|
||||
hex_digit = ((digit | CaselessLiteral("a") | CaselessLiteral("b") | CaselessLiteral("c") | CaselessLiteral("d") | CaselessLiteral("e") | CaselessLiteral("f"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="hex_digit"))("hex_digit")
|
||||
letter = ((CaselessLiteral("a") | CaselessLiteral("b") | CaselessLiteral("c") | CaselessLiteral("d") | CaselessLiteral("e") | CaselessLiteral("f") | CaselessLiteral("g") | CaselessLiteral("h") | CaselessLiteral("i") | CaselessLiteral("j") | CaselessLiteral("k") | CaselessLiteral("l") | CaselessLiteral("m") | CaselessLiteral("n") | CaselessLiteral("o") | CaselessLiteral("p") | CaselessLiteral("q") | CaselessLiteral("r") | CaselessLiteral("s") | CaselessLiteral("t") | CaselessLiteral("u") | CaselessLiteral("v") | CaselessLiteral("w") | CaselessLiteral("x") | CaselessLiteral("y") | CaselessLiteral("z")))("letter")
|
||||
not_paren_star_quote_special = ((CaselessLiteral("!") | CaselessLiteral("#") | CaselessLiteral("$") | CaselessLiteral("%") | CaselessLiteral("&") | CaselessLiteral("+") | CaselessLiteral(",") | CaselessLiteral("-") | CaselessLiteral(".") | CaselessLiteral("/") | CaselessLiteral(":") | CaselessLiteral(";") | CaselessLiteral("<") | CaselessLiteral("=") | CaselessLiteral(">") | CaselessLiteral("?") | CaselessLiteral("@") | CaselessLiteral("[") | CaselessLiteral("\\") | CaselessLiteral("]") | CaselessLiteral("^") | CaselessLiteral("_") | CaselessLiteral("{") | CaselessLiteral("|") | CaselessLiteral("}") | CaselessLiteral("~")))("not_paren_star_quote_special")
|
||||
not_paren_star_special = ((not_paren_star_quote_special | CaselessLiteral("\"\""))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="not_paren_star_special"))("not_paren_star_special")
|
||||
not_paren_star_special = ((not_paren_star_quote_special | CaselessLiteral("\"\""))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="not_paren_star_special"))("not_paren_star_special")
|
||||
not_quote = ((not_paren_star_quote_special | letter | digit | CaselessLiteral("(") | CaselessLiteral(")") | CaselessLiteral("*")))("not_quote")
|
||||
octet = ((hex_digit + hex_digit)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="octet"))("octet")
|
||||
special = ((not_paren_star_quote_special | CaselessLiteral("(") | CaselessLiteral(")") | CaselessLiteral("*") | CaselessLiteral("\"\""))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="special"))("special")
|
||||
binary_literal = ((CaselessLiteral("%") + bit + ZeroOrMore(bit))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="binary_literal"))("binary_literal")
|
||||
octet = ((hex_digit + hex_digit)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="octet"))("octet")
|
||||
special = ((not_paren_star_quote_special | CaselessLiteral("(") | CaselessLiteral(")") | CaselessLiteral("*") | CaselessLiteral("\"\""))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="special"))("special")
|
||||
binary_literal = ((CaselessLiteral("%") + bit + ZeroOrMore(bit))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="binary_literal"))("binary_literal")
|
||||
integer_literal = (digits)("integer_literal")
|
||||
simple_id = ~CaselessKeyword("format") + ~CaselessKeyword("loindex") + ~CaselessKeyword("in") + ~CaselessKeyword("where") + ~CaselessKeyword("by") + ~CaselessKeyword("subtype") + ~CaselessKeyword("local") + ~CaselessKeyword("sin") + ~CaselessKeyword("case") + ~CaselessKeyword("false") + ~CaselessKeyword("entity") + ~CaselessKeyword("exp") + ~CaselessKeyword("hiindex") + ~CaselessKeyword("generic_entity") + ~CaselessKeyword("number") + ~CaselessKeyword("end_rule") + ~CaselessKeyword("schema") + ~CaselessKeyword("from") + ~CaselessKeyword("length") + ~CaselessKeyword("insert") + ~CaselessKeyword("real") + ~CaselessKeyword("like") + ~CaselessKeyword("hibound") + ~CaselessKeyword("if") + ~CaselessKeyword("end_schema") + ~CaselessKeyword("generic") + ~CaselessKeyword("extensible") + ~CaselessKeyword("pi") + ~CaselessKeyword("of") + ~CaselessKeyword("logical") + ~CaselessKeyword("rolesof") + ~CaselessKeyword("log") + ~CaselessKeyword("integer") + ~CaselessKeyword("or") + ~CaselessKeyword("odd") + ~CaselessKeyword("list") + ~CaselessKeyword("procedure") + ~CaselessKeyword("renamed") + ~CaselessKeyword("optional") + ~CaselessKeyword("log10") + ~CaselessKeyword("end_function") + ~CaselessKeyword("value_unique") + ~CaselessKeyword("fixed") + ~CaselessKeyword("repeat") + ~CaselessKeyword("rule") + ~CaselessKeyword("mod") + ~CaselessKeyword("exists") + ~CaselessKeyword("with") + ~CaselessKeyword("nvl") + ~CaselessKeyword("end_repeat") + ~CaselessKeyword("not") + ~CaselessKeyword("type") + ~CaselessKeyword("otherwise") + ~CaselessKeyword("lobound") + ~CaselessKeyword("query") + ~CaselessKeyword("function") + ~CaselessKeyword("reference") + ~CaselessKeyword("enumeration") + ~CaselessKeyword("oneof") + ~CaselessKeyword("bag") + ~CaselessKeyword("then") + ~CaselessKeyword("end_if") + ~CaselessKeyword("sizeof") + ~CaselessKeyword("end_procedure") + ~CaselessKeyword("end_type") + ~CaselessKeyword("string") + ~CaselessKeyword("end_case") + ~CaselessKeyword("return") + ~CaselessKeyword("end_entity") + ~CaselessKeyword("log2") + ~CaselessKeyword("end_alias") + ~CaselessKeyword("inverse") + ~CaselessKeyword("derive") + ~CaselessKeyword("select") + ~CaselessKeyword("for") + ~CaselessKeyword("set") + ~CaselessKeyword("aggregate") + ~CaselessKeyword("self") + ~CaselessKeyword("array") + ~CaselessKeyword("abs") + ~CaselessKeyword("tan") + ~CaselessKeyword("subtype_constraint") + ~CaselessKeyword("remove") + ~CaselessKeyword("to") + ~CaselessKeyword("acos") + ~CaselessKeyword("skip") + ~CaselessKeyword("end_subtype_constraint") + ~CaselessKeyword("end_local") + ~CaselessKeyword("use") + ~CaselessKeyword("abstract") + ~CaselessKeyword("sqrt") + ~CaselessKeyword("var") + ~CaselessKeyword("until") + ~CaselessKeyword("while") + ~CaselessKeyword("end") + ~CaselessKeyword("typeof") + ~CaselessKeyword("supertype") + ~CaselessKeyword("based_on") + ~CaselessKeyword("true") + ~CaselessKeyword("alias") + ~CaselessKeyword("total_over") + ~CaselessKeyword("andor") + ~CaselessKeyword("cos") + ~CaselessKeyword("div") + ~CaselessKeyword("and") + ~CaselessKeyword("const_e") + ~CaselessKeyword("unique") + ~CaselessKeyword("as") + ~CaselessKeyword("boolean") + ~CaselessKeyword("constant") + ~CaselessKeyword("escape") + ~CaselessKeyword("atan") + ~CaselessKeyword("unknown") + ~CaselessKeyword("asin") + ~CaselessKeyword("usedin") + ~CaselessKeyword("xor") + ~CaselessKeyword("else") + ~CaselessKeyword("blength") + ~CaselessKeyword("value_in") + ~CaselessKeyword("value") + ~CaselessKeyword("begin") + ~CaselessKeyword("binary") + ~CaselessKeyword("end_constant") + originalTextFor(Combine((letter + ZeroOrMore((letter | digit | CaselessLiteral("_"))))))("simple_id")
|
||||
simple_string_literal = (originalTextFor((CaselessLiteral("'") + ZeroOrMore(((CaselessLiteral("'") + CaselessLiteral("'")) | not_quote)) + CaselessLiteral("'")))).addParseAction(tokenMap(str.lower))("simple_string_literal")
|
||||
simple_id = ~CaselessKeyword("abs") + ~CaselessKeyword("abstract") + ~CaselessKeyword("acos") + ~CaselessKeyword("aggregate") + ~CaselessKeyword("alias") + ~CaselessKeyword("and") + ~CaselessKeyword("andor") + ~CaselessKeyword("array") + ~CaselessKeyword("as") + ~CaselessKeyword("asin") + ~CaselessKeyword("atan") + ~CaselessKeyword("bag") + ~CaselessKeyword("based_on") + ~CaselessKeyword("begin") + ~CaselessKeyword("binary") + ~CaselessKeyword("blength") + ~CaselessKeyword("boolean") + ~CaselessKeyword("by") + ~CaselessKeyword("case") + ~CaselessKeyword("const_e") + ~CaselessKeyword("constant") + ~CaselessKeyword("cos") + ~CaselessKeyword("derive") + ~CaselessKeyword("div") + ~CaselessKeyword("else") + ~CaselessKeyword("end") + ~CaselessKeyword("end_alias") + ~CaselessKeyword("end_case") + ~CaselessKeyword("end_constant") + ~CaselessKeyword("end_entity") + ~CaselessKeyword("end_function") + ~CaselessKeyword("end_if") + ~CaselessKeyword("end_local") + ~CaselessKeyword("end_procedure") + ~CaselessKeyword("end_repeat") + ~CaselessKeyword("end_rule") + ~CaselessKeyword("end_schema") + ~CaselessKeyword("end_subtype_constraint") + ~CaselessKeyword("end_type") + ~CaselessKeyword("entity") + ~CaselessKeyword("enumeration") + ~CaselessKeyword("escape") + ~CaselessKeyword("exists") + ~CaselessKeyword("exp") + ~CaselessKeyword("extensible") + ~CaselessKeyword("false") + ~CaselessKeyword("fixed") + ~CaselessKeyword("for") + ~CaselessKeyword("format") + ~CaselessKeyword("from") + ~CaselessKeyword("function") + ~CaselessKeyword("generic") + ~CaselessKeyword("generic_entity") + ~CaselessKeyword("hibound") + ~CaselessKeyword("hiindex") + ~CaselessKeyword("if") + ~CaselessKeyword("in") + ~CaselessKeyword("insert") + ~CaselessKeyword("integer") + ~CaselessKeyword("inverse") + ~CaselessKeyword("length") + ~CaselessKeyword("like") + ~CaselessKeyword("list") + ~CaselessKeyword("lobound") + ~CaselessKeyword("local") + ~CaselessKeyword("log") + ~CaselessKeyword("log10") + ~CaselessKeyword("log2") + ~CaselessKeyword("logical") + ~CaselessKeyword("loindex") + ~CaselessKeyword("mod") + ~CaselessKeyword("not") + ~CaselessKeyword("number") + ~CaselessKeyword("nvl") + ~CaselessKeyword("odd") + ~CaselessKeyword("of") + ~CaselessKeyword("oneof") + ~CaselessKeyword("optional") + ~CaselessKeyword("or") + ~CaselessKeyword("otherwise") + ~CaselessKeyword("pi") + ~CaselessKeyword("procedure") + ~CaselessKeyword("query") + ~CaselessKeyword("real") + ~CaselessKeyword("reference") + ~CaselessKeyword("remove") + ~CaselessKeyword("renamed") + ~CaselessKeyword("repeat") + ~CaselessKeyword("return") + ~CaselessKeyword("rolesof") + ~CaselessKeyword("rule") + ~CaselessKeyword("schema") + ~CaselessKeyword("select") + ~CaselessKeyword("self") + ~CaselessKeyword("set") + ~CaselessKeyword("sin") + ~CaselessKeyword("sizeof") + ~CaselessKeyword("skip") + ~CaselessKeyword("sqrt") + ~CaselessKeyword("string") + ~CaselessKeyword("subtype") + ~CaselessKeyword("subtype_constraint") + ~CaselessKeyword("supertype") + ~CaselessKeyword("tan") + ~CaselessKeyword("then") + ~CaselessKeyword("to") + ~CaselessKeyword("total_over") + ~CaselessKeyword("true") + ~CaselessKeyword("type") + ~CaselessKeyword("typeof") + ~CaselessKeyword("unique") + ~CaselessKeyword("unknown") + ~CaselessKeyword("until") + ~CaselessKeyword("use") + ~CaselessKeyword("usedin") + ~CaselessKeyword("value") + ~CaselessKeyword("value_in") + ~CaselessKeyword("value_unique") + ~CaselessKeyword("var") + ~CaselessKeyword("where") + ~CaselessKeyword("while") + ~CaselessKeyword("with") + ~CaselessKeyword("xor") + original_text_for(Combine((letter + ZeroOrMore((letter | digit | CaselessLiteral("_"))))))("simple_id")
|
||||
simple_string_literal = (original_text_for((CaselessLiteral("'") + ZeroOrMore(((CaselessLiteral("'") + CaselessLiteral("'")) | not_quote)) + CaselessLiteral("'")))).add_parse_action(token_map(str.lower))("simple_string_literal")
|
||||
abstract_entity_declaration = (ABSTRACT)("abstract_entity_declaration")
|
||||
abstract_supertype = ((ABSTRACT + SUPERTYPE + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="abstract_supertype"))("abstract_supertype")
|
||||
add_like_op = ((CaselessLiteral("+") | CaselessLiteral("-") | OR | XOR)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="add_like_op"))("add_like_op")
|
||||
abstract_supertype = ((ABSTRACT + SUPERTYPE + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="abstract_supertype"))("abstract_supertype")
|
||||
add_like_op = ((CaselessLiteral("+") | CaselessLiteral("-") | OR | XOR)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="add_like_op"))("add_like_op")
|
||||
attribute_id = (simple_id)("attribute_id")
|
||||
boolean_type = (BOOLEAN)("boolean_type")
|
||||
built_in_constant = ((CONST_E | PI | SELF | CaselessLiteral("?"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="built_in_constant"))("built_in_constant")
|
||||
built_in_function = ((ABS | ACOS | ASIN | ATAN | BLENGTH | COS | EXISTS | EXP | FORMAT | HIBOUND | HIINDEX | LENGTH | LOBOUND | LOINDEX | LOG | LOG2 | LOG10 | NVL | ODD | ROLESOF | SIN | SIZEOF | SQRT | TAN | TYPEOF | USEDIN | VALUE | VALUE_IN | VALUE_UNIQUE)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="built_in_function"))("built_in_function")
|
||||
built_in_procedure = ((INSERT | REMOVE)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="built_in_procedure"))("built_in_procedure")
|
||||
built_in_constant = ((CONST_E | PI | SELF | CaselessLiteral("?"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="built_in_constant"))("built_in_constant")
|
||||
built_in_function = ((ABS | ACOS | ASIN | ATAN | BLENGTH | COS | EXISTS | EXP | FORMAT | HIBOUND | HIINDEX | LENGTH | LOBOUND | LOINDEX | LOG | LOG2 | LOG10 | NVL | ODD | ROLESOF | SIN | SIZEOF | SQRT | TAN | TYPEOF | USEDIN | VALUE | VALUE_IN | VALUE_UNIQUE)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="built_in_function"))("built_in_function")
|
||||
built_in_procedure = ((INSERT | REMOVE)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="built_in_procedure"))("built_in_procedure")
|
||||
constant_id = (simple_id)("constant_id")
|
||||
entity_id = (simple_id)("entity_id")
|
||||
enumeration_id = (simple_id)("enumeration_id")
|
||||
enumeration_items = ((CaselessLiteral("(") + enumeration_id + ZeroOrMore((CaselessLiteral(",") + enumeration_id)) + CaselessLiteral(")"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="enumeration_items"))("enumeration_items")
|
||||
escape_stmt = ((ESCAPE + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="escape_stmt"))("escape_stmt")
|
||||
enumeration_items = ((CaselessLiteral("(") + enumeration_id + ZeroOrMore((CaselessLiteral(",") + enumeration_id)) + CaselessLiteral(")"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="enumeration_items"))("enumeration_items")
|
||||
escape_stmt = ((ESCAPE + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="escape_stmt"))("escape_stmt")
|
||||
function_id = (simple_id)("function_id")
|
||||
integer_type = (INTEGER)("integer_type")
|
||||
interval_op = ((CaselessLiteral("<=") | CaselessLiteral("<"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="interval_op"))("interval_op")
|
||||
logical_literal = ((FALSE | TRUE | UNKNOWN)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="logical_literal"))("logical_literal")
|
||||
interval_op = ((CaselessLiteral("<=") | CaselessLiteral("<"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="interval_op"))("interval_op")
|
||||
logical_literal = ((FALSE | TRUE | UNKNOWN)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="logical_literal"))("logical_literal")
|
||||
logical_type = (LOGICAL)("logical_type")
|
||||
multiplication_like_op = ((CaselessLiteral("*") | CaselessLiteral("/") | DIV | MOD | AND | CaselessLiteral("||"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="multiplication_like_op"))("multiplication_like_op")
|
||||
null_stmt = (CaselessLiteral(";")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="null_stmt"))("null_stmt")
|
||||
multiplication_like_op = ((CaselessLiteral("*") | CaselessLiteral("/") | DIV | MOD | AND | CaselessLiteral("||"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="multiplication_like_op"))("multiplication_like_op")
|
||||
null_stmt = (CaselessLiteral(";")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="null_stmt"))("null_stmt")
|
||||
number_type = (NUMBER)("number_type")
|
||||
parameter_id = (simple_id)("parameter_id")
|
||||
procedure_id = (simple_id)("procedure_id")
|
||||
rel_op = ((CaselessLiteral("<=") | CaselessLiteral(">=") | CaselessLiteral("<>") | CaselessLiteral("=") | CaselessLiteral(":<>:") | CaselessLiteral(":=:") | CaselessLiteral("<") | CaselessLiteral(">"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="rel_op"))("rel_op")
|
||||
rel_op_extended = ((rel_op | IN | LIKE)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="rel_op_extended"))("rel_op_extended")
|
||||
rel_op = ((CaselessLiteral("<=") | CaselessLiteral(">=") | CaselessLiteral("<>") | CaselessLiteral("=") | CaselessLiteral(":<>:") | CaselessLiteral(":=:") | CaselessLiteral("<") | CaselessLiteral(">"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="rel_op"))("rel_op")
|
||||
rel_op_extended = ((rel_op | IN | LIKE)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="rel_op_extended"))("rel_op_extended")
|
||||
rule_id = (simple_id)("rule_id")
|
||||
rule_label_id = (simple_id)("rule_label_id")
|
||||
schema_id = (simple_id)("schema_id")
|
||||
sign = ((CaselessLiteral("+") | CaselessLiteral("-"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="sign"))("sign")
|
||||
skip_stmt = ((SKIP + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="skip_stmt"))("skip_stmt")
|
||||
sign = ((CaselessLiteral("+") | CaselessLiteral("-"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="sign"))("sign")
|
||||
skip_stmt = ((SKIP + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="skip_stmt"))("skip_stmt")
|
||||
subtype_constraint_id = (simple_id)("subtype_constraint_id")
|
||||
type_id = (simple_id)("type_id")
|
||||
type_label_id = (simple_id)("type_label_id")
|
||||
unary_op = ((CaselessLiteral("+") | CaselessLiteral("-") | NOT)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="unary_op"))("unary_op")
|
||||
unary_op = ((CaselessLiteral("+") | CaselessLiteral("-") | NOT)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="unary_op"))("unary_op")
|
||||
variable_id = (simple_id)("variable_id")
|
||||
encoded_character = ((octet + octet + octet + octet)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="encoded_character"))("encoded_character")
|
||||
not_paren_star = ((letter | digit | not_paren_star_special)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="not_paren_star"))("not_paren_star")
|
||||
not_rparen_star = ((not_paren_star | CaselessLiteral("("))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="not_rparen_star"))("not_rparen_star")
|
||||
not_rparen_star_then_rparen = ((not_rparen_star + ZeroOrMore(not_rparen_star) + CaselessLiteral(")") + ZeroOrMore(CaselessLiteral(")")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="not_rparen_star_then_rparen"))("not_rparen_star_then_rparen")
|
||||
encoded_string_literal = ((CaselessLiteral("\"") + encoded_character + ZeroOrMore(encoded_character) + CaselessLiteral("\""))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="encoded_string_literal"))("encoded_string_literal")
|
||||
encoded_character = ((octet + octet + octet + octet)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="encoded_character"))("encoded_character")
|
||||
not_paren_star = ((letter | digit | not_paren_star_special)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="not_paren_star"))("not_paren_star")
|
||||
not_rparen_star = ((not_paren_star | CaselessLiteral("("))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="not_rparen_star"))("not_rparen_star")
|
||||
not_rparen_star_then_rparen = ((not_rparen_star + ZeroOrMore(not_rparen_star) + CaselessLiteral(")") + ZeroOrMore(CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="not_rparen_star_then_rparen"))("not_rparen_star_then_rparen")
|
||||
encoded_string_literal = ((CaselessLiteral("\"") + encoded_character + ZeroOrMore(encoded_character) + CaselessLiteral("\""))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="encoded_string_literal"))("encoded_string_literal")
|
||||
real_literal = (((digits + CaselessLiteral(".") + Optional(digits) + Optional((CaselessLiteral("e") + Optional(sign) + digits))) | integer_literal))("real_literal")
|
||||
attribute_ref = (attribute_id)("attribute_ref")
|
||||
constant_ref = (constant_id)("constant_ref")
|
||||
@@ -210,276 +210,276 @@ def parse(fn: str) -> mapping.Mapping:
|
||||
type_label_ref = (type_label_id)("type_label_ref")
|
||||
type_ref = (type_id)("type_ref")
|
||||
variable_ref = (variable_id)("variable_ref")
|
||||
attribute_qualifier = ((CaselessLiteral(".") + attribute_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="attribute_qualifier"))("attribute_qualifier")
|
||||
constant_factor = ((built_in_constant | constant_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="constant_factor"))("constant_factor")
|
||||
enumeration_extension = ((BASED_ON + type_ref + Optional((WITH + enumeration_items)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="enumeration_extension"))("enumeration_extension")
|
||||
enumeration_reference = ((Optional((type_ref + CaselessLiteral("."))) + enumeration_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="enumeration_reference"))("enumeration_reference")
|
||||
enumeration_type = ((Optional(EXTENSIBLE) + ENUMERATION + Optional(((OF + enumeration_items) | enumeration_extension)))).setParseAction(EnumerationType)("enumeration_type")
|
||||
general_ref = ((parameter_ref | variable_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="general_ref"))("general_ref")
|
||||
group_qualifier = ((CaselessLiteral("\\") + entity_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="group_qualifier"))("group_qualifier")
|
||||
named_types = ((entity_ref | type_ref)).setParseAction(NamedType)("named_types")
|
||||
named_type_or_rename = ((named_types + Optional((AS + (entity_id | type_id))))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="named_type_or_rename"))("named_type_or_rename")
|
||||
attribute_qualifier = ((CaselessLiteral(".") + attribute_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="attribute_qualifier"))("attribute_qualifier")
|
||||
constant_factor = ((built_in_constant | constant_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="constant_factor"))("constant_factor")
|
||||
enumeration_extension = ((BASED_ON + type_ref + Optional((WITH + enumeration_items)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="enumeration_extension"))("enumeration_extension")
|
||||
enumeration_reference = ((Optional((type_ref + CaselessLiteral("."))) + enumeration_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="enumeration_reference"))("enumeration_reference")
|
||||
enumeration_type = ((Optional(EXTENSIBLE) + ENUMERATION + Optional(((OF + enumeration_items) | enumeration_extension)))).set_parse_action(EnumerationType)("enumeration_type")
|
||||
general_ref = ((parameter_ref | variable_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="general_ref"))("general_ref")
|
||||
group_qualifier = ((CaselessLiteral("\\") + entity_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="group_qualifier"))("group_qualifier")
|
||||
named_types = ((entity_ref | type_ref)).set_parse_action(NamedType)("named_types")
|
||||
named_type_or_rename = ((named_types + Optional((AS + (entity_id | type_id))))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="named_type_or_rename"))("named_type_or_rename")
|
||||
population = (entity_ref)("population")
|
||||
qualified_attribute = ((SELF + group_qualifier + attribute_qualifier)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="qualified_attribute"))("qualified_attribute")
|
||||
redeclared_attribute = ((qualified_attribute + Optional((RENAMED + attribute_id)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="redeclared_attribute"))("redeclared_attribute")
|
||||
referenced_attribute = ((attribute_ref | qualified_attribute)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="referenced_attribute"))("referenced_attribute")
|
||||
rename_id = ((constant_id | entity_id | function_id | procedure_id | type_id)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="rename_id"))("rename_id")
|
||||
resource_ref = ((constant_ref | entity_ref | function_ref | procedure_ref | type_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="resource_ref"))("resource_ref")
|
||||
rule_head = ((RULE + rule_id + FOR + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")") + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="rule_head"))("rule_head")
|
||||
select_list = ((CaselessLiteral("(") + named_types + ZeroOrMore((CaselessLiteral(",") + named_types)) + CaselessLiteral(")"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="select_list"))("select_list")
|
||||
qualified_attribute = ((SELF + group_qualifier + attribute_qualifier)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="qualified_attribute"))("qualified_attribute")
|
||||
redeclared_attribute = ((qualified_attribute + Optional((RENAMED + attribute_id)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="redeclared_attribute"))("redeclared_attribute")
|
||||
referenced_attribute = ((attribute_ref | qualified_attribute)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="referenced_attribute"))("referenced_attribute")
|
||||
rename_id = ((constant_id | entity_id | function_id | procedure_id | type_id)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="rename_id"))("rename_id")
|
||||
resource_ref = ((constant_ref | entity_ref | function_ref | procedure_ref | type_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="resource_ref"))("resource_ref")
|
||||
rule_head = ((RULE + rule_id + FOR + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")") + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="rule_head"))("rule_head")
|
||||
select_list = ((CaselessLiteral("(") + named_types + ZeroOrMore((CaselessLiteral(",") + named_types)) + CaselessLiteral(")"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="select_list"))("select_list")
|
||||
string_literal = ((simple_string_literal | encoded_string_literal))("string_literal")
|
||||
subtype_constraint_head = ((SUBTYPE_CONSTRAINT + subtype_constraint_id + FOR + entity_ref + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_head"))("subtype_constraint_head")
|
||||
subtype_declaration = ((SUBTYPE + OF + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")"))).setParseAction(SubTypeExpression)("subtype_declaration")
|
||||
total_over = ((TOTAL_OVER + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")") + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="total_over"))("total_over")
|
||||
type_label = ((type_label_id | type_label_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="type_label"))("type_label")
|
||||
unique_rule = ((Optional((rule_label_id + CaselessLiteral(":"))) + referenced_attribute + ZeroOrMore((CaselessLiteral(",") + referenced_attribute)))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="unique_rule"))("unique_rule")
|
||||
use_clause = ((USE + FROM + schema_ref + Optional((CaselessLiteral("(") + named_type_or_rename + ZeroOrMore((CaselessLiteral(",") + named_type_or_rename)) + CaselessLiteral(")"))) + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="use_clause"))("use_clause")
|
||||
not_lparen_star = ((not_paren_star | CaselessLiteral(")"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="not_lparen_star"))("not_lparen_star")
|
||||
remark_ref = ((attribute_ref | constant_ref | entity_ref | enumeration_ref | function_ref | parameter_ref | procedure_ref | rule_label_ref | rule_ref | schema_ref | subtype_constraint_ref | type_label_ref | type_ref | variable_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="remark_ref"))("remark_ref")
|
||||
attribute_decl = ((redeclared_attribute | attribute_id)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="attribute_decl"))("attribute_decl")
|
||||
generic_entity_type = ((GENERIC_ENTITY + Optional((CaselessLiteral(":") + type_label)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="generic_entity_type"))("generic_entity_type")
|
||||
generic_type = ((GENERIC + Optional((CaselessLiteral(":") + type_label)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="generic_type"))("generic_type")
|
||||
literal = ((binary_literal | logical_literal | real_literal | string_literal)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="literal"))("literal")
|
||||
resource_or_rename = ((resource_ref + Optional((AS + rename_id)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="resource_or_rename"))("resource_or_rename")
|
||||
subtype_constraint_head = ((SUBTYPE_CONSTRAINT + subtype_constraint_id + FOR + entity_ref + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_head"))("subtype_constraint_head")
|
||||
subtype_declaration = ((SUBTYPE + OF + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")"))).set_parse_action(SubTypeExpression)("subtype_declaration")
|
||||
total_over = ((TOTAL_OVER + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")") + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="total_over"))("total_over")
|
||||
type_label = ((type_label_id | type_label_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="type_label"))("type_label")
|
||||
unique_rule = ((Optional((rule_label_id + CaselessLiteral(":"))) + referenced_attribute + ZeroOrMore((CaselessLiteral(",") + referenced_attribute)))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="unique_rule"))("unique_rule")
|
||||
use_clause = ((USE + FROM + schema_ref + Optional((CaselessLiteral("(") + named_type_or_rename + ZeroOrMore((CaselessLiteral(",") + named_type_or_rename)) + CaselessLiteral(")"))) + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="use_clause"))("use_clause")
|
||||
not_lparen_star = ((not_paren_star | CaselessLiteral(")"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="not_lparen_star"))("not_lparen_star")
|
||||
remark_ref = ((attribute_ref | constant_ref | entity_ref | enumeration_ref | function_ref | parameter_ref | procedure_ref | rule_label_ref | rule_ref | schema_ref | subtype_constraint_ref | type_label_ref | type_ref | variable_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="remark_ref"))("remark_ref")
|
||||
attribute_decl = ((redeclared_attribute | attribute_id)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="attribute_decl"))("attribute_decl")
|
||||
generic_entity_type = ((GENERIC_ENTITY + Optional((CaselessLiteral(":") + type_label)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="generic_entity_type"))("generic_entity_type")
|
||||
generic_type = ((GENERIC + Optional((CaselessLiteral(":") + type_label)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="generic_type"))("generic_type")
|
||||
literal = ((binary_literal | logical_literal | real_literal | string_literal)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="literal"))("literal")
|
||||
resource_or_rename = ((resource_ref + Optional((AS + rename_id)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="resource_or_rename"))("resource_or_rename")
|
||||
schema_version_id = (string_literal)("schema_version_id")
|
||||
select_extension = ((BASED_ON + type_ref + Optional((WITH + select_list)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="select_extension"))("select_extension")
|
||||
select_type = ((Optional((EXTENSIBLE + Optional(GENERIC_ENTITY))) + SELECT + Optional((select_list | select_extension)))).setParseAction(SelectType)("select_type")
|
||||
unique_clause = ((UNIQUE + unique_rule + CaselessLiteral(";") + ZeroOrMore((unique_rule + CaselessLiteral(";"))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="unique_clause"))("unique_clause")
|
||||
lparen_then_not_lparen_star = ((CaselessLiteral("(") + ZeroOrMore(CaselessLiteral("(")) + not_lparen_star + ZeroOrMore(not_lparen_star))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="lparen_then_not_lparen_star"))("lparen_then_not_lparen_star")
|
||||
remark_tag = ((CaselessLiteral("\"") + remark_ref + ZeroOrMore((CaselessLiteral(".") + remark_ref)) + CaselessLiteral("\""))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="remark_tag"))("remark_tag")
|
||||
tail_remark = ((CaselessLiteral("--") + Optional(remark_tag))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="tail_remark"))("tail_remark")
|
||||
constructed_types = ((enumeration_type | select_type)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="constructed_types"))("constructed_types")
|
||||
reference_clause = ((REFERENCE + FROM + schema_ref + Optional((CaselessLiteral("(") + resource_or_rename + ZeroOrMore((CaselessLiteral(",") + resource_or_rename)) + CaselessLiteral(")"))) + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="reference_clause"))("reference_clause")
|
||||
interface_specification = ((reference_clause | use_clause)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="interface_specification"))("interface_specification")
|
||||
rule_decl = Forward()("rule_decl")
|
||||
supertype_term = Forward()("supertype_term")
|
||||
alias_stmt = Forward()("alias_stmt")
|
||||
subtype_constraint_decl = Forward()("subtype_constraint_decl")
|
||||
real_type = Forward()("real_type")
|
||||
until_control = Forward()("until_control")
|
||||
remark = Forward()("remark")
|
||||
syntax = Forward()("syntax")
|
||||
derived_attr = Forward()("derived_attr")
|
||||
subtype_constraint = Forward()("subtype_constraint")
|
||||
aggregation_types = Forward()("aggregation_types")
|
||||
width = Forward()("width")
|
||||
simple_expression = Forward()("simple_expression")
|
||||
explicit_attr = Forward()("explicit_attr")
|
||||
precision_spec = Forward()("precision_spec")
|
||||
general_list_type = Forward()("general_list_type")
|
||||
concrete_types = Forward()("concrete_types")
|
||||
while_control = Forward()("while_control")
|
||||
aggregate_type = Forward()("aggregate_type")
|
||||
increment_control = Forward()("increment_control")
|
||||
index_qualifier = Forward()("index_qualifier")
|
||||
supertype_rule = Forward()("supertype_rule")
|
||||
subsuper = Forward()("subsuper")
|
||||
interval_low = Forward()("interval_low")
|
||||
bound_2 = Forward()("bound_2")
|
||||
index_1 = Forward()("index_1")
|
||||
return_stmt = Forward()("return_stmt")
|
||||
type_decl = Forward()("type_decl")
|
||||
increment = Forward()("increment")
|
||||
factor = Forward()("factor")
|
||||
underlying_type = Forward()("underlying_type")
|
||||
declaration = Forward()("declaration")
|
||||
function_decl = Forward()("function_decl")
|
||||
entity_constructor = Forward()("entity_constructor")
|
||||
derive_clause = Forward()("derive_clause")
|
||||
interval_item = Forward()("interval_item")
|
||||
stmt = Forward()("stmt")
|
||||
repeat_control = Forward()("repeat_control")
|
||||
select_extension = ((BASED_ON + type_ref + Optional((WITH + select_list)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="select_extension"))("select_extension")
|
||||
select_type = ((Optional((EXTENSIBLE + Optional(GENERIC_ENTITY))) + SELECT + Optional((select_list | select_extension)))).set_parse_action(SelectType)("select_type")
|
||||
unique_clause = ((UNIQUE + unique_rule + CaselessLiteral(";") + ZeroOrMore((unique_rule + CaselessLiteral(";"))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="unique_clause"))("unique_clause")
|
||||
lparen_then_not_lparen_star = ((CaselessLiteral("(") + ZeroOrMore(CaselessLiteral("(")) + not_lparen_star + ZeroOrMore(not_lparen_star))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="lparen_then_not_lparen_star"))("lparen_then_not_lparen_star")
|
||||
remark_tag = ((CaselessLiteral("\"") + remark_ref + ZeroOrMore((CaselessLiteral(".") + remark_ref)) + CaselessLiteral("\""))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="remark_tag"))("remark_tag")
|
||||
tail_remark = ((CaselessLiteral("--") + Optional(remark_tag))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="tail_remark"))("tail_remark")
|
||||
constructed_types = ((enumeration_type | select_type)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="constructed_types"))("constructed_types")
|
||||
reference_clause = ((REFERENCE + FROM + schema_ref + Optional((CaselessLiteral("(") + resource_or_rename + ZeroOrMore((CaselessLiteral(",") + resource_or_rename)) + CaselessLiteral(")"))) + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="reference_clause"))("reference_clause")
|
||||
interface_specification = ((reference_clause | use_clause)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="interface_specification"))("interface_specification")
|
||||
abstract_supertype_declaration = Forward()("abstract_supertype_declaration")
|
||||
bound_spec = Forward()("bound_spec")
|
||||
entity_decl = Forward()("entity_decl")
|
||||
actual_parameter_list = Forward()("actual_parameter_list")
|
||||
aggregate_initializer = Forward()("aggregate_initializer")
|
||||
aggregate_source = Forward()("aggregate_source")
|
||||
aggregate_type = Forward()("aggregate_type")
|
||||
aggregation_types = Forward()("aggregation_types")
|
||||
algorithm_head = Forward()("algorithm_head")
|
||||
alias_stmt = Forward()("alias_stmt")
|
||||
array_type = Forward()("array_type")
|
||||
assignment_stmt = Forward()("assignment_stmt")
|
||||
bag_type = Forward()("bag_type")
|
||||
binary_type = Forward()("binary_type")
|
||||
bound_1 = Forward()("bound_1")
|
||||
bound_2 = Forward()("bound_2")
|
||||
bound_spec = Forward()("bound_spec")
|
||||
case_action = Forward()("case_action")
|
||||
case_label = Forward()("case_label")
|
||||
case_stmt = Forward()("case_stmt")
|
||||
compound_stmt = Forward()("compound_stmt")
|
||||
concrete_types = Forward()("concrete_types")
|
||||
constant_body = Forward()("constant_body")
|
||||
constant_decl = Forward()("constant_decl")
|
||||
declaration = Forward()("declaration")
|
||||
derive_clause = Forward()("derive_clause")
|
||||
derived_attr = Forward()("derived_attr")
|
||||
domain_rule = Forward()("domain_rule")
|
||||
element = Forward()("element")
|
||||
embedded_remark = Forward()("embedded_remark")
|
||||
entity_body = Forward()("entity_body")
|
||||
entity_constructor = Forward()("entity_constructor")
|
||||
entity_decl = Forward()("entity_decl")
|
||||
entity_head = Forward()("entity_head")
|
||||
explicit_attr = Forward()("explicit_attr")
|
||||
expression = Forward()("expression")
|
||||
factor = Forward()("factor")
|
||||
formal_parameter = Forward()("formal_parameter")
|
||||
function_call = Forward()("function_call")
|
||||
function_decl = Forward()("function_decl")
|
||||
function_head = Forward()("function_head")
|
||||
general_aggregation_types = Forward()("general_aggregation_types")
|
||||
general_array_type = Forward()("general_array_type")
|
||||
general_bag_type = Forward()("general_bag_type")
|
||||
general_list_type = Forward()("general_list_type")
|
||||
general_set_type = Forward()("general_set_type")
|
||||
generalized_types = Forward()("generalized_types")
|
||||
if_stmt = Forward()("if_stmt")
|
||||
increment = Forward()("increment")
|
||||
increment_control = Forward()("increment_control")
|
||||
index = Forward()("index")
|
||||
index_1 = Forward()("index_1")
|
||||
index_2 = Forward()("index_2")
|
||||
index_qualifier = Forward()("index_qualifier")
|
||||
instantiable_type = Forward()("instantiable_type")
|
||||
interval = Forward()("interval")
|
||||
interval_high = Forward()("interval_high")
|
||||
interval_item = Forward()("interval_item")
|
||||
interval_low = Forward()("interval_low")
|
||||
inverse_attr = Forward()("inverse_attr")
|
||||
inverse_clause = Forward()("inverse_clause")
|
||||
list_type = Forward()("list_type")
|
||||
local_decl = Forward()("local_decl")
|
||||
local_variable = Forward()("local_variable")
|
||||
logical_expression = Forward()("logical_expression")
|
||||
numeric_expression = Forward()("numeric_expression")
|
||||
string_type = Forward()("string_type")
|
||||
formal_parameter = Forward()("formal_parameter")
|
||||
generalized_types = Forward()("generalized_types")
|
||||
function_head = Forward()("function_head")
|
||||
constant_decl = Forward()("constant_decl")
|
||||
actual_parameter_list = Forward()("actual_parameter_list")
|
||||
subtype_constraint_body = Forward()("subtype_constraint_body")
|
||||
procedure_decl = Forward()("procedure_decl")
|
||||
case_action = Forward()("case_action")
|
||||
term = Forward()("term")
|
||||
general_aggregation_types = Forward()("general_aggregation_types")
|
||||
function_call = Forward()("function_call")
|
||||
where_clause = Forward()("where_clause")
|
||||
local_variable = Forward()("local_variable")
|
||||
aggregate_initializer = Forward()("aggregate_initializer")
|
||||
binary_type = Forward()("binary_type")
|
||||
index = Forward()("index")
|
||||
case_stmt = Forward()("case_stmt")
|
||||
general_set_type = Forward()("general_set_type")
|
||||
procedure_call_stmt = Forward()("procedure_call_stmt")
|
||||
instantiable_type = Forward()("instantiable_type")
|
||||
general_array_type = Forward()("general_array_type")
|
||||
set_type = Forward()("set_type")
|
||||
supertype_factor = Forward()("supertype_factor")
|
||||
index_2 = Forward()("index_2")
|
||||
qualifiable_factor = Forward()("qualifiable_factor")
|
||||
algorithm_head = Forward()("algorithm_head")
|
||||
parameter_type = Forward()("parameter_type")
|
||||
one_of = Forward()("one_of")
|
||||
compound_stmt = Forward()("compound_stmt")
|
||||
primary = Forward()("primary")
|
||||
schema_decl = Forward()("schema_decl")
|
||||
embedded_remark = Forward()("embedded_remark")
|
||||
width_spec = Forward()("width_spec")
|
||||
assignment_stmt = Forward()("assignment_stmt")
|
||||
element = Forward()("element")
|
||||
schema_body = Forward()("schema_body")
|
||||
procedure_head = Forward()("procedure_head")
|
||||
general_bag_type = Forward()("general_bag_type")
|
||||
entity_head = Forward()("entity_head")
|
||||
entity_body = Forward()("entity_body")
|
||||
list_type = Forward()("list_type")
|
||||
expression = Forward()("expression")
|
||||
parameter = Forward()("parameter")
|
||||
simple_types = Forward()("simple_types")
|
||||
bag_type = Forward()("bag_type")
|
||||
repetition = Forward()("repetition")
|
||||
constant_body = Forward()("constant_body")
|
||||
if_stmt = Forward()("if_stmt")
|
||||
inverse_attr = Forward()("inverse_attr")
|
||||
interval = Forward()("interval")
|
||||
query_expression = Forward()("query_expression")
|
||||
array_type = Forward()("array_type")
|
||||
simple_factor = Forward()("simple_factor")
|
||||
case_label = Forward()("case_label")
|
||||
domain_rule = Forward()("domain_rule")
|
||||
repeat_stmt = Forward()("repeat_stmt")
|
||||
supertype_expression = Forward()("supertype_expression")
|
||||
supertype_constraint = Forward()("supertype_constraint")
|
||||
interval_high = Forward()("interval_high")
|
||||
local_decl = Forward()("local_decl")
|
||||
selector = Forward()("selector")
|
||||
aggregate_source = Forward()("aggregate_source")
|
||||
parameter_type = Forward()("parameter_type")
|
||||
precision_spec = Forward()("precision_spec")
|
||||
primary = Forward()("primary")
|
||||
procedure_call_stmt = Forward()("procedure_call_stmt")
|
||||
procedure_decl = Forward()("procedure_decl")
|
||||
procedure_head = Forward()("procedure_head")
|
||||
qualifiable_factor = Forward()("qualifiable_factor")
|
||||
qualifier = Forward()("qualifier")
|
||||
rule_decl << (((rule_head + algorithm_head + ZeroOrMore(stmt) + where_clause + END_RULE + CaselessLiteral(";")))).setParseAction(RuleDeclaration)
|
||||
supertype_term << (((one_of | (CaselessLiteral("(") + supertype_expression + CaselessLiteral(")")) | entity_ref))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="supertype_term"))
|
||||
alias_stmt << (((ALIAS + variable_id + FOR + general_ref + ZeroOrMore(qualifier) + CaselessLiteral(";") + stmt + ZeroOrMore(stmt) + END_ALIAS + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="alias_stmt"))
|
||||
subtype_constraint_decl << (((subtype_constraint_head + subtype_constraint_body + END_SUBTYPE_CONSTRAINT + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_decl"))
|
||||
real_type << (((REAL + Optional((CaselessLiteral("(") + precision_spec + CaselessLiteral(")")))))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="real_type"))
|
||||
until_control << (((UNTIL + logical_expression))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="until_control"))
|
||||
remark << (((embedded_remark | tail_remark))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="remark"))
|
||||
syntax << (((schema_decl + ZeroOrMore(schema_decl)))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="syntax"))
|
||||
derived_attr << (((attribute_decl + CaselessLiteral(":") + parameter_type + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="derived_attr"))
|
||||
subtype_constraint << (((OF + CaselessLiteral("(") + supertype_expression + CaselessLiteral(")")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint"))
|
||||
aggregation_types << (((array_type | bag_type | list_type | set_type))).setParseAction(AggregationType)
|
||||
width << (numeric_expression)
|
||||
simple_expression << (((term + ZeroOrMore((add_like_op + term))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="simple_expression"))
|
||||
explicit_attr << (((attribute_decl + ZeroOrMore((CaselessLiteral(",") + attribute_decl)) + CaselessLiteral(":") + Optional(OPTIONAL) + parameter_type + CaselessLiteral(";")))).setParseAction(ExplicitAttribute)
|
||||
precision_spec << (numeric_expression)
|
||||
general_list_type << (((LIST + Optional(bound_spec) + OF + Optional(UNIQUE) + parameter_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="general_list_type"))
|
||||
concrete_types << (((aggregation_types | simple_types | type_ref))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="concrete_types"))
|
||||
while_control << (((WHILE + logical_expression))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="while_control"))
|
||||
aggregate_type << (((AGGREGATE + Optional((CaselessLiteral(":") + type_label)) + OF + parameter_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="aggregate_type"))
|
||||
increment_control << (((variable_id + CaselessLiteral(":=") + bound_1 + TO + bound_2 + Optional((BY + increment))))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="increment_control"))
|
||||
index_qualifier << (((CaselessLiteral("[") + index_1 + Optional((CaselessLiteral(":") + index_2)) + CaselessLiteral("]")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="index_qualifier"))
|
||||
supertype_rule << (((SUPERTYPE + subtype_constraint))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="supertype_rule"))
|
||||
subsuper << (((Optional(supertype_constraint) + Optional(subtype_declaration)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="subsuper"))
|
||||
interval_low << (simple_expression)
|
||||
bound_2 << (numeric_expression)
|
||||
index_1 << (index)
|
||||
return_stmt << (((RETURN + Optional((CaselessLiteral("(") + expression + CaselessLiteral(")"))) + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="return_stmt"))
|
||||
type_decl << (((TYPE + type_id + CaselessLiteral("=") + underlying_type + CaselessLiteral(";") + Optional(where_clause) + END_TYPE + CaselessLiteral(";")))).setParseAction(TypeDeclaration)
|
||||
increment << (numeric_expression)
|
||||
factor << (((simple_factor + Optional((CaselessLiteral("**") + simple_factor))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="factor"))
|
||||
underlying_type << (((constructed_types | concrete_types))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="underlying_type"))
|
||||
declaration << (((entity_decl | function_decl | procedure_decl | subtype_constraint_decl | type_decl))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="declaration"))
|
||||
function_decl << (((function_head + algorithm_head + stmt + ZeroOrMore(stmt) + END_FUNCTION + CaselessLiteral(";")))).setParseAction(FunctionDeclaration)
|
||||
entity_constructor << (((entity_ref + CaselessLiteral("(") + Optional((expression + ZeroOrMore((CaselessLiteral(",") + expression)))) + CaselessLiteral(")")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="entity_constructor"))
|
||||
derive_clause << (((DERIVE + derived_attr + ZeroOrMore(derived_attr)))).setParseAction(AttributeList)
|
||||
interval_item << (simple_expression)
|
||||
stmt << (((alias_stmt | assignment_stmt | case_stmt | compound_stmt | escape_stmt | if_stmt | null_stmt | procedure_call_stmt | repeat_stmt | return_stmt | skip_stmt))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="stmt"))
|
||||
repeat_control << (((Optional(increment_control) + Optional(while_control) + Optional(until_control)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="repeat_control"))
|
||||
abstract_supertype_declaration << (((ABSTRACT + SUPERTYPE + Optional(subtype_constraint)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="abstract_supertype_declaration"))
|
||||
bound_spec << (((CaselessLiteral("[") + bound_1 + CaselessLiteral(":") + bound_2 + CaselessLiteral("]")))).setParseAction(BoundSpecification)
|
||||
entity_decl << (((entity_head + entity_body + END_ENTITY + CaselessLiteral(";")))).setParseAction(EntityDeclaration)
|
||||
query_expression = Forward()("query_expression")
|
||||
real_type = Forward()("real_type")
|
||||
remark = Forward()("remark")
|
||||
repeat_control = Forward()("repeat_control")
|
||||
repeat_stmt = Forward()("repeat_stmt")
|
||||
repetition = Forward()("repetition")
|
||||
return_stmt = Forward()("return_stmt")
|
||||
rule_decl = Forward()("rule_decl")
|
||||
schema_body = Forward()("schema_body")
|
||||
schema_decl = Forward()("schema_decl")
|
||||
selector = Forward()("selector")
|
||||
set_type = Forward()("set_type")
|
||||
simple_expression = Forward()("simple_expression")
|
||||
simple_factor = Forward()("simple_factor")
|
||||
simple_types = Forward()("simple_types")
|
||||
stmt = Forward()("stmt")
|
||||
string_type = Forward()("string_type")
|
||||
subsuper = Forward()("subsuper")
|
||||
subtype_constraint = Forward()("subtype_constraint")
|
||||
subtype_constraint_body = Forward()("subtype_constraint_body")
|
||||
subtype_constraint_decl = Forward()("subtype_constraint_decl")
|
||||
supertype_constraint = Forward()("supertype_constraint")
|
||||
supertype_expression = Forward()("supertype_expression")
|
||||
supertype_factor = Forward()("supertype_factor")
|
||||
supertype_rule = Forward()("supertype_rule")
|
||||
supertype_term = Forward()("supertype_term")
|
||||
syntax = Forward()("syntax")
|
||||
term = Forward()("term")
|
||||
type_decl = Forward()("type_decl")
|
||||
underlying_type = Forward()("underlying_type")
|
||||
until_control = Forward()("until_control")
|
||||
where_clause = Forward()("where_clause")
|
||||
while_control = Forward()("while_control")
|
||||
width = Forward()("width")
|
||||
width_spec = Forward()("width_spec")
|
||||
abstract_supertype_declaration << (((ABSTRACT + SUPERTYPE + Optional(subtype_constraint)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="abstract_supertype_declaration"))
|
||||
actual_parameter_list << (((CaselessLiteral("(") + Optional(parameter) + ZeroOrMore((CaselessLiteral(",") + parameter)) + CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="actual_parameter_list"))
|
||||
aggregate_initializer << (((CaselessLiteral("[") + Optional((element + ZeroOrMore((CaselessLiteral(",") + element)))) + CaselessLiteral("]")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="aggregate_initializer"))
|
||||
aggregate_source << (simple_expression)
|
||||
aggregate_type << (((AGGREGATE + Optional((CaselessLiteral(":") + type_label)) + OF + parameter_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="aggregate_type"))
|
||||
aggregation_types << (((array_type | bag_type | list_type | set_type))).set_parse_action(AggregationType)
|
||||
algorithm_head << (((ZeroOrMore(declaration) + Optional(constant_decl) + Optional(local_decl)))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="algorithm_head"))
|
||||
alias_stmt << (((ALIAS + variable_id + FOR + general_ref + ZeroOrMore(qualifier) + CaselessLiteral(";") + stmt + ZeroOrMore(stmt) + END_ALIAS + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="alias_stmt"))
|
||||
array_type << (((ARRAY + bound_spec + OF + Optional(OPTIONAL) + Optional(UNIQUE) + instantiable_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="array_type"))
|
||||
assignment_stmt << (((general_ref + ZeroOrMore(qualifier) + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="assignment_stmt"))
|
||||
bag_type << (((BAG + Optional(bound_spec) + OF + instantiable_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="bag_type"))
|
||||
binary_type << (((BINARY + Optional(width_spec)))).set_parse_action(BinaryType)
|
||||
bound_1 << (numeric_expression)
|
||||
inverse_clause << (((INVERSE + inverse_attr + ZeroOrMore(inverse_attr)))).setParseAction(AttributeList)
|
||||
bound_2 << (numeric_expression)
|
||||
bound_spec << (((CaselessLiteral("[") + bound_1 + CaselessLiteral(":") + bound_2 + CaselessLiteral("]")))).set_parse_action(BoundSpecification)
|
||||
case_action << (((case_label + ZeroOrMore((CaselessLiteral(",") + case_label)) + CaselessLiteral(":") + stmt))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="case_action"))
|
||||
case_label << (expression)
|
||||
case_stmt << (((CASE + selector + OF + ZeroOrMore(case_action) + Optional((OTHERWISE + CaselessLiteral(":") + stmt)) + END_CASE + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="case_stmt"))
|
||||
compound_stmt << (((BEGIN + stmt + ZeroOrMore(stmt) + END + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="compound_stmt"))
|
||||
concrete_types << (((aggregation_types | simple_types | type_ref))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="concrete_types"))
|
||||
constant_body << (((constant_id + CaselessLiteral(":") + instantiable_type + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="constant_body"))
|
||||
constant_decl << (((CONSTANT + constant_body + ZeroOrMore(constant_body) + END_CONSTANT + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="constant_decl"))
|
||||
declaration << (((entity_decl | function_decl | procedure_decl | subtype_constraint_decl | type_decl))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="declaration"))
|
||||
derive_clause << (((DERIVE + derived_attr + ZeroOrMore(derived_attr)))).set_parse_action(AttributeList)
|
||||
derived_attr << (((attribute_decl + CaselessLiteral(":") + parameter_type + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="derived_attr"))
|
||||
domain_rule << (((Optional((rule_label_id + CaselessLiteral(":"))) + expression))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="domain_rule"))
|
||||
element << (((expression + Optional((CaselessLiteral(":") + repetition))))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="element"))
|
||||
embedded_remark << (((CaselessLiteral("(*") + Optional(remark_tag) + ZeroOrMore(((not_paren_star + ZeroOrMore(not_paren_star)) | lparen_then_not_lparen_star | (CaselessLiteral("*") + ZeroOrMore(CaselessLiteral("*"))) | not_rparen_star_then_rparen | embedded_remark)) + CaselessLiteral("*)")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="embedded_remark"))
|
||||
entity_body << (((ZeroOrMore(explicit_attr) + Optional(derive_clause) + Optional(inverse_clause) + Optional(unique_clause) + Optional(where_clause)))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="entity_body"))
|
||||
entity_constructor << (((entity_ref + CaselessLiteral("(") + Optional((expression + ZeroOrMore((CaselessLiteral(",") + expression)))) + CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="entity_constructor"))
|
||||
entity_decl << (((entity_head + entity_body + END_ENTITY + CaselessLiteral(";")))).set_parse_action(EntityDeclaration)
|
||||
entity_head << (((ENTITY + entity_id + subsuper + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="entity_head"))
|
||||
explicit_attr << (((attribute_decl + ZeroOrMore((CaselessLiteral(",") + attribute_decl)) + CaselessLiteral(":") + Optional(OPTIONAL) + parameter_type + CaselessLiteral(";")))).set_parse_action(ExplicitAttribute)
|
||||
expression << (((simple_expression + Optional((rel_op_extended + simple_expression))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="expression"))
|
||||
factor << (((simple_factor + Optional((CaselessLiteral("**") + simple_factor))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="factor"))
|
||||
formal_parameter << (((parameter_id + ZeroOrMore((CaselessLiteral(",") + parameter_id)) + CaselessLiteral(":") + parameter_type))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="formal_parameter"))
|
||||
function_call << ((((built_in_function | function_ref) + actual_parameter_list))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="function_call"))
|
||||
function_decl << (((function_head + algorithm_head + stmt + ZeroOrMore(stmt) + END_FUNCTION + CaselessLiteral(";")))).set_parse_action(FunctionDeclaration)
|
||||
function_head << (((FUNCTION + function_id + Optional((CaselessLiteral("(") + formal_parameter + ZeroOrMore((CaselessLiteral(";") + formal_parameter)) + CaselessLiteral(")"))) + CaselessLiteral(":") + parameter_type + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="function_head"))
|
||||
general_aggregation_types << (((general_array_type | general_bag_type | general_list_type | general_set_type))).set_parse_action(AggregationType)
|
||||
general_array_type << (((ARRAY + Optional(bound_spec) + OF + Optional(OPTIONAL) + Optional(UNIQUE) + parameter_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="general_array_type"))
|
||||
general_bag_type << (((BAG + Optional(bound_spec) + OF + parameter_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="general_bag_type"))
|
||||
general_list_type << (((LIST + Optional(bound_spec) + OF + Optional(UNIQUE) + parameter_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="general_list_type"))
|
||||
general_set_type << (((SET + Optional(bound_spec) + OF + parameter_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="general_set_type"))
|
||||
generalized_types << (((aggregate_type | general_aggregation_types | generic_entity_type | generic_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="generalized_types"))
|
||||
if_stmt << (((IF + logical_expression + THEN + stmt + ZeroOrMore(stmt) + Optional((ELSE + stmt + ZeroOrMore(stmt))) + END_IF + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="if_stmt"))
|
||||
increment << (numeric_expression)
|
||||
increment_control << (((variable_id + CaselessLiteral(":=") + bound_1 + TO + bound_2 + Optional((BY + increment))))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="increment_control"))
|
||||
index << (numeric_expression)
|
||||
index_1 << (index)
|
||||
index_2 << (index)
|
||||
index_qualifier << (((CaselessLiteral("[") + index_1 + Optional((CaselessLiteral(":") + index_2)) + CaselessLiteral("]")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="index_qualifier"))
|
||||
instantiable_type << (((concrete_types | entity_ref))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="instantiable_type"))
|
||||
interval << (((CaselessLiteral("{") + interval_low + interval_op + interval_item + interval_op + interval_high + CaselessLiteral("}")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="interval"))
|
||||
interval_high << (simple_expression)
|
||||
interval_item << (simple_expression)
|
||||
interval_low << (simple_expression)
|
||||
inverse_attr << (((attribute_decl + CaselessLiteral(":") + Optional(((SET | BAG) + Optional(bound_spec) + OF)) + entity_ref + FOR + Optional((entity_ref + CaselessLiteral("."))) + attribute_ref + CaselessLiteral(";")))).set_parse_action(InverseAttribute)
|
||||
inverse_clause << (((INVERSE + inverse_attr + ZeroOrMore(inverse_attr)))).set_parse_action(AttributeList)
|
||||
list_type << (((LIST + Optional(bound_spec) + OF + Optional(UNIQUE) + instantiable_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="list_type"))
|
||||
local_decl << (((LOCAL + local_variable + ZeroOrMore(local_variable) + END_LOCAL + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="local_decl"))
|
||||
local_variable << (((variable_id + ZeroOrMore((CaselessLiteral(",") + variable_id)) + CaselessLiteral(":") + parameter_type + Optional((CaselessLiteral(":=") + expression)) + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="local_variable"))
|
||||
logical_expression << (expression)
|
||||
numeric_expression << (simple_expression)
|
||||
string_type << (((STRING + Optional(width_spec)))).setParseAction(StringType)
|
||||
formal_parameter << (((parameter_id + ZeroOrMore((CaselessLiteral(",") + parameter_id)) + CaselessLiteral(":") + parameter_type))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="formal_parameter"))
|
||||
generalized_types << (((aggregate_type | general_aggregation_types | generic_entity_type | generic_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="generalized_types"))
|
||||
function_head << (((FUNCTION + function_id + Optional((CaselessLiteral("(") + formal_parameter + ZeroOrMore((CaselessLiteral(";") + formal_parameter)) + CaselessLiteral(")"))) + CaselessLiteral(":") + parameter_type + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="function_head"))
|
||||
constant_decl << (((CONSTANT + constant_body + ZeroOrMore(constant_body) + END_CONSTANT + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="constant_decl"))
|
||||
actual_parameter_list << (((CaselessLiteral("(") + Optional(parameter) + ZeroOrMore((CaselessLiteral(",") + parameter)) + CaselessLiteral(")")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="actual_parameter_list"))
|
||||
subtype_constraint_body << (((Optional(abstract_supertype) + Optional(total_over) + Optional((supertype_expression + CaselessLiteral(";")))))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_body"))
|
||||
procedure_decl << (((procedure_head + algorithm_head + ZeroOrMore(stmt) + END_PROCEDURE + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="procedure_decl"))
|
||||
case_action << (((case_label + ZeroOrMore((CaselessLiteral(",") + case_label)) + CaselessLiteral(":") + stmt))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="case_action"))
|
||||
term << (((factor + ZeroOrMore((multiplication_like_op + factor))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="term"))
|
||||
general_aggregation_types << (((general_array_type | general_bag_type | general_list_type | general_set_type))).setParseAction(AggregationType)
|
||||
function_call << ((((built_in_function | function_ref) + actual_parameter_list))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="function_call"))
|
||||
where_clause << (((WHERE + domain_rule + CaselessLiteral(";") + ZeroOrMore((domain_rule + CaselessLiteral(";")))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="where_clause"))
|
||||
local_variable << (((variable_id + ZeroOrMore((CaselessLiteral(",") + variable_id)) + CaselessLiteral(":") + parameter_type + Optional((CaselessLiteral(":=") + expression)) + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="local_variable"))
|
||||
aggregate_initializer << (((CaselessLiteral("[") + Optional((element + ZeroOrMore((CaselessLiteral(",") + element)))) + CaselessLiteral("]")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="aggregate_initializer"))
|
||||
binary_type << (((BINARY + Optional(width_spec)))).setParseAction(BinaryType)
|
||||
index << (numeric_expression)
|
||||
case_stmt << (((CASE + selector + OF + ZeroOrMore(case_action) + Optional((OTHERWISE + CaselessLiteral(":") + stmt)) + END_CASE + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="case_stmt"))
|
||||
general_set_type << (((SET + Optional(bound_spec) + OF + parameter_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="general_set_type"))
|
||||
procedure_call_stmt << ((((built_in_procedure | procedure_ref) + actual_parameter_list + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="procedure_call_stmt"))
|
||||
instantiable_type << (((concrete_types | entity_ref))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="instantiable_type"))
|
||||
general_array_type << (((ARRAY + Optional(bound_spec) + OF + Optional(OPTIONAL) + Optional(UNIQUE) + parameter_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="general_array_type"))
|
||||
set_type << (((SET + Optional(bound_spec) + OF + instantiable_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="set_type"))
|
||||
supertype_factor << (((supertype_term + ZeroOrMore((AND + supertype_term))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="supertype_factor"))
|
||||
index_2 << (index)
|
||||
qualifiable_factor << (((function_call | attribute_ref | constant_factor | general_ref | population))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="qualifiable_factor"))
|
||||
algorithm_head << (((ZeroOrMore(declaration) + Optional(constant_decl) + Optional(local_decl)))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="algorithm_head"))
|
||||
parameter_type << (((generalized_types | simple_types | named_types))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="parameter_type"))
|
||||
one_of << (((ONEOF + CaselessLiteral("(") + supertype_expression + ZeroOrMore((CaselessLiteral(",") + supertype_expression)) + CaselessLiteral(")")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="one_of"))
|
||||
compound_stmt << (((BEGIN + stmt + ZeroOrMore(stmt) + END + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="compound_stmt"))
|
||||
primary << (((literal | (qualifiable_factor + ZeroOrMore(qualifier))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="primary"))
|
||||
schema_decl << (((SCHEMA + schema_id + Optional(schema_version_id) + CaselessLiteral(";") + schema_body + END_SCHEMA + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="schema_decl"))
|
||||
embedded_remark << (((CaselessLiteral("(*") + Optional(remark_tag) + ZeroOrMore(((not_paren_star + ZeroOrMore(not_paren_star)) | lparen_then_not_lparen_star | (CaselessLiteral("*") + ZeroOrMore(CaselessLiteral("*"))) | not_rparen_star_then_rparen | embedded_remark)) + CaselessLiteral("*)")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="embedded_remark"))
|
||||
width_spec << (((CaselessLiteral("(") + width + CaselessLiteral(")") + Optional(FIXED)))).setParseAction(WidthSpec)
|
||||
assignment_stmt << (((general_ref + ZeroOrMore(qualifier) + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="assignment_stmt"))
|
||||
element << (((expression + Optional((CaselessLiteral(":") + repetition))))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="element"))
|
||||
schema_body << (((ZeroOrMore(interface_specification) + Optional(constant_decl) + ZeroOrMore((declaration | rule_decl))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="schema_body"))
|
||||
procedure_head << (((PROCEDURE + procedure_id + Optional((CaselessLiteral("(") + Optional(VAR) + formal_parameter + ZeroOrMore((CaselessLiteral(";") + Optional(VAR) + formal_parameter)) + CaselessLiteral(")"))) + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="procedure_head"))
|
||||
general_bag_type << (((BAG + Optional(bound_spec) + OF + parameter_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="general_bag_type"))
|
||||
entity_head << (((ENTITY + entity_id + subsuper + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="entity_head"))
|
||||
entity_body << (((ZeroOrMore(explicit_attr) + Optional(derive_clause) + Optional(inverse_clause) + Optional(unique_clause) + Optional(where_clause)))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="entity_body"))
|
||||
list_type << (((LIST + Optional(bound_spec) + OF + Optional(UNIQUE) + instantiable_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="list_type"))
|
||||
expression << (((simple_expression + Optional((rel_op_extended + simple_expression))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="expression"))
|
||||
one_of << (((ONEOF + CaselessLiteral("(") + supertype_expression + ZeroOrMore((CaselessLiteral(",") + supertype_expression)) + CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="one_of"))
|
||||
parameter << (expression)
|
||||
simple_types << (((binary_type | boolean_type | integer_type | logical_type | number_type | real_type | string_type))).setParseAction(SimpleType)
|
||||
bag_type << (((BAG + Optional(bound_spec) + OF + instantiable_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="bag_type"))
|
||||
parameter_type << (((generalized_types | simple_types | named_types))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="parameter_type"))
|
||||
precision_spec << (numeric_expression)
|
||||
primary << (((literal | (qualifiable_factor + ZeroOrMore(qualifier))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="primary"))
|
||||
procedure_call_stmt << ((((built_in_procedure | procedure_ref) + actual_parameter_list + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="procedure_call_stmt"))
|
||||
procedure_decl << (((procedure_head + algorithm_head + ZeroOrMore(stmt) + END_PROCEDURE + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="procedure_decl"))
|
||||
procedure_head << (((PROCEDURE + procedure_id + Optional((CaselessLiteral("(") + Optional(VAR) + formal_parameter + ZeroOrMore((CaselessLiteral(";") + Optional(VAR) + formal_parameter)) + CaselessLiteral(")"))) + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="procedure_head"))
|
||||
qualifiable_factor << (((function_call | attribute_ref | constant_factor | general_ref | population))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="qualifiable_factor"))
|
||||
qualifier << (((attribute_qualifier | group_qualifier | index_qualifier))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="qualifier"))
|
||||
query_expression << (((QUERY + CaselessLiteral("(") + variable_id + CaselessLiteral("<*") + aggregate_source + CaselessLiteral("|") + logical_expression + CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="query_expression"))
|
||||
real_type << (((REAL + Optional((CaselessLiteral("(") + precision_spec + CaselessLiteral(")")))))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="real_type"))
|
||||
remark << (((embedded_remark | tail_remark))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="remark"))
|
||||
repeat_control << (((Optional(increment_control) + Optional(while_control) + Optional(until_control)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="repeat_control"))
|
||||
repeat_stmt << (((REPEAT + repeat_control + CaselessLiteral(";") + stmt + ZeroOrMore(stmt) + END_REPEAT + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="repeat_stmt"))
|
||||
repetition << (numeric_expression)
|
||||
constant_body << (((constant_id + CaselessLiteral(":") + instantiable_type + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="constant_body"))
|
||||
if_stmt << (((IF + logical_expression + THEN + stmt + ZeroOrMore(stmt) + Optional((ELSE + stmt + ZeroOrMore(stmt))) + END_IF + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="if_stmt"))
|
||||
inverse_attr << (((attribute_decl + CaselessLiteral(":") + Optional(((SET | BAG) + Optional(bound_spec) + OF)) + entity_ref + FOR + Optional((entity_ref + CaselessLiteral("."))) + attribute_ref + CaselessLiteral(";")))).setParseAction(InverseAttribute)
|
||||
interval << (((CaselessLiteral("{") + interval_low + interval_op + interval_item + interval_op + interval_high + CaselessLiteral("}")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="interval"))
|
||||
query_expression << (((QUERY + CaselessLiteral("(") + variable_id + CaselessLiteral("<*") + aggregate_source + CaselessLiteral("|") + logical_expression + CaselessLiteral(")")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="query_expression"))
|
||||
array_type << (((ARRAY + bound_spec + OF + Optional(OPTIONAL) + Optional(UNIQUE) + instantiable_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="array_type"))
|
||||
simple_factor << (((aggregate_initializer | interval | query_expression | (Optional(unary_op) + ((CaselessLiteral("(") + expression + CaselessLiteral(")")) | primary)) | entity_constructor | enumeration_reference))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="simple_factor"))
|
||||
case_label << (expression)
|
||||
domain_rule << (((Optional((rule_label_id + CaselessLiteral(":"))) + expression))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="domain_rule"))
|
||||
repeat_stmt << (((REPEAT + repeat_control + CaselessLiteral(";") + stmt + ZeroOrMore(stmt) + END_REPEAT + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="repeat_stmt"))
|
||||
supertype_expression << (((supertype_factor + ZeroOrMore((ANDOR + supertype_factor))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="supertype_expression"))
|
||||
supertype_constraint << (((abstract_supertype_declaration | abstract_entity_declaration | supertype_rule))).setParseAction(SuperTypeExpression)
|
||||
interval_high << (simple_expression)
|
||||
local_decl << (((LOCAL + local_variable + ZeroOrMore(local_variable) + END_LOCAL + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="local_decl"))
|
||||
return_stmt << (((RETURN + Optional((CaselessLiteral("(") + expression + CaselessLiteral(")"))) + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="return_stmt"))
|
||||
rule_decl << (((rule_head + algorithm_head + ZeroOrMore(stmt) + where_clause + END_RULE + CaselessLiteral(";")))).set_parse_action(RuleDeclaration)
|
||||
schema_body << (((ZeroOrMore(interface_specification) + Optional(constant_decl) + ZeroOrMore((declaration | rule_decl))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="schema_body"))
|
||||
schema_decl << (((SCHEMA + schema_id + Optional(schema_version_id) + CaselessLiteral(";") + schema_body + END_SCHEMA + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="schema_decl"))
|
||||
selector << (expression)
|
||||
aggregate_source << (simple_expression)
|
||||
qualifier << (((attribute_qualifier | group_qualifier | index_qualifier))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="qualifier"))
|
||||
set_type << (((SET + Optional(bound_spec) + OF + instantiable_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="set_type"))
|
||||
simple_expression << (((term + ZeroOrMore((add_like_op + term))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="simple_expression"))
|
||||
simple_factor << (((aggregate_initializer | interval | query_expression | (Optional(unary_op) + ((CaselessLiteral("(") + expression + CaselessLiteral(")")) | primary)) | entity_constructor | enumeration_reference))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="simple_factor"))
|
||||
simple_types << (((binary_type | boolean_type | integer_type | logical_type | number_type | real_type | string_type))).set_parse_action(SimpleType)
|
||||
stmt << (((alias_stmt | assignment_stmt | case_stmt | compound_stmt | escape_stmt | if_stmt | null_stmt | procedure_call_stmt | repeat_stmt | return_stmt | skip_stmt))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="stmt"))
|
||||
string_type << (((STRING + Optional(width_spec)))).set_parse_action(StringType)
|
||||
subsuper << (((Optional(supertype_constraint) + Optional(subtype_declaration)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="subsuper"))
|
||||
subtype_constraint << (((OF + CaselessLiteral("(") + supertype_expression + CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint"))
|
||||
subtype_constraint_body << (((Optional(abstract_supertype) + Optional(total_over) + Optional((supertype_expression + CaselessLiteral(";")))))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_body"))
|
||||
subtype_constraint_decl << (((subtype_constraint_head + subtype_constraint_body + END_SUBTYPE_CONSTRAINT + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_decl"))
|
||||
supertype_constraint << (((abstract_supertype_declaration | abstract_entity_declaration | supertype_rule))).set_parse_action(SuperTypeExpression)
|
||||
supertype_expression << (((supertype_factor + ZeroOrMore((ANDOR + supertype_factor))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="supertype_expression"))
|
||||
supertype_factor << (((supertype_term + ZeroOrMore((AND + supertype_term))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="supertype_factor"))
|
||||
supertype_rule << (((SUPERTYPE + subtype_constraint))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="supertype_rule"))
|
||||
supertype_term << (((one_of | (CaselessLiteral("(") + supertype_expression + CaselessLiteral(")")) | entity_ref))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="supertype_term"))
|
||||
syntax << (((schema_decl + ZeroOrMore(schema_decl)))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="syntax"))
|
||||
term << (((factor + ZeroOrMore((multiplication_like_op + factor))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="term"))
|
||||
type_decl << (((TYPE + type_id + CaselessLiteral("=") + underlying_type + CaselessLiteral(";") + Optional(where_clause) + END_TYPE + CaselessLiteral(";")))).set_parse_action(TypeDeclaration)
|
||||
underlying_type << (((constructed_types | concrete_types))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="underlying_type"))
|
||||
until_control << (((UNTIL + logical_expression))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="until_control"))
|
||||
where_clause << (((WHERE + domain_rule + CaselessLiteral(";") + ZeroOrMore((domain_rule + CaselessLiteral(";")))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="where_clause"))
|
||||
while_control << (((WHILE + logical_expression))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="while_control"))
|
||||
width << (numeric_expression)
|
||||
width_spec << (((CaselessLiteral("(") + width + CaselessLiteral(")") + Optional(FIXED)))).set_parse_action(WidthSpec)
|
||||
|
||||
syntax.ignore("--" + restOfLine)
|
||||
syntax.ignore(Regex(r"\((?:\*(?:[^*]*\*+)+?\))"))
|
||||
ast = syntax.parseFile(fn)
|
||||
ast = syntax.parse_file(fn)
|
||||
s = schema.Schema(ast)
|
||||
m = mapping.Mapping(s)
|
||||
|
||||
with open(cache_file, "wb") as f:
|
||||
pickle.dump(m, f, protocol=0)
|
||||
return m
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
m = parse(sys.argv[1])
|
||||
import importlib
|
||||
|
||||
@@ -11,16 +11,16 @@ ENTITY file_name;
|
||||
time_stamp : time_stamp_text;
|
||||
author : LIST [1:?] OF STRING (256);
|
||||
organization : LIST [1:?] OF STRING (256);
|
||||
preprocessor_version : STRING (256);
|
||||
preprocessor_version : STRING (256);
|
||||
originating_system : STRING (256);
|
||||
authorisation : STRING (256);
|
||||
authorisation : STRING (256);
|
||||
END_ENTITY;
|
||||
|
||||
ENTITY file_description;
|
||||
description : LIST [1:?] OF STRING (256);
|
||||
implementation_level : STRING (256);
|
||||
END_ENTITY;
|
||||
|
||||
|
||||
ENTITY file_schema;
|
||||
schema_identifiers : LIST [1:?] OF UNIQUE schema_name;
|
||||
END_ENTITY;
|
||||
|
||||
@@ -263,7 +263,7 @@ context_class = context
|
||||
|
||||
class codegen_rule:
|
||||
def __init__(self, pattern, fn):
|
||||
self.pattern = tuple(rule.parseString(pattern))
|
||||
self.pattern = tuple(rule.parse_string(pattern))
|
||||
self.fn = fn
|
||||
if not hasattr(codegen_rule, "all_rules"):
|
||||
codegen_rule.all_rules = []
|
||||
@@ -292,7 +292,7 @@ def process_rule_decl(context):
|
||||
class {context.rule_head.rule_id}:
|
||||
SCOPE = "file"
|
||||
|
||||
@staticmethod
|
||||
@staticmethod
|
||||
def __call__(file):
|
||||
{context.rule_head.entity_ref} = file.by_type("{context.rule_head.entity_ref}")
|
||||
{indent(8, context.algorithm_head.local_decl)}
|
||||
@@ -335,7 +335,7 @@ class {class_name}_{domain_rule.rule_label_id}:
|
||||
TYPE_NAME = "{class_name}"
|
||||
RULE_NAME = "{domain_rule.rule_label_id}"
|
||||
|
||||
@staticmethod
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
{indent(8, (f"{a.lower()} = self.{a}" for a in attributes if re.search(f'{wb}{a.lower()}{wb}', str(domain_rule))))}
|
||||
{indent(8, domain_rule)}
|
||||
@@ -741,7 +741,7 @@ class AttributeGetattrTransformer(ast.NodeTransformer):
|
||||
func=ast.Name(id="express_getattr", ctx=ast.Load()),
|
||||
args=[
|
||||
new_value,
|
||||
ast.Str(s=node.attr),
|
||||
ast.Constant(value=node.attr),
|
||||
ast.Name(id="INDETERMINATE", ctx=ast.Load()),
|
||||
],
|
||||
keywords=[],
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -4618,7 +4618,7 @@ class IfcConstructionMaterialResource_WR2:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or express_getattr(express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjectsType', INDETERMINATE) == express_getattr(IfcObjectTypeEnum, 'PRODUCT', INDETERMINATE)) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or express_getattr(express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjectsType', INDETERMINATE) == express_getattr(IfcObjectTypeEnum, 'PRODUCT', INDETERMINATE)) is not False
|
||||
|
||||
class IfcConstructionProductResource_WR1:
|
||||
SCOPE = 'entity'
|
||||
@@ -4636,7 +4636,7 @@ class IfcConstructionProductResource_WR2:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or express_getattr(express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjectsType', INDETERMINATE) == express_getattr(IfcObjectTypeEnum, 'PRODUCT', INDETERMINATE)) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or express_getattr(express_getitem(express_getattr(self, 'ResourceOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjectsType', INDETERMINATE) == express_getattr(IfcObjectTypeEnum, 'PRODUCT', INDETERMINATE)) is not False
|
||||
|
||||
class IfcCooledBeamType_WR1:
|
||||
SCOPE = 'entity'
|
||||
@@ -4876,7 +4876,7 @@ class IfcDocumentReference_WR1:
|
||||
def __call__(self):
|
||||
name = express_getattr(self, 'Name', INDETERMINATE)
|
||||
referencetodocument = express_getattr(self, 'ReferenceToDocument', INDETERMINATE)
|
||||
assert exists(name) ^ exists(lambda : express_getitem(referencetodocument, 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) is not False
|
||||
assert exists(name) ^ exists(lambda: express_getitem(referencetodocument, 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) is not False
|
||||
|
||||
class IfcDoorLiningProperties_WR31:
|
||||
SCOPE = 'entity'
|
||||
@@ -4929,7 +4929,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_WR31:
|
||||
SCOPE = 'entity'
|
||||
@@ -4938,7 +4938,7 @@ class IfcDoorPanelProperties_WR31:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
|
||||
class IfcDraughtingPreDefinedColour_WR31:
|
||||
SCOPE = 'entity'
|
||||
@@ -7195,7 +7195,7 @@ class IfcTypeProduct_WR41:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'ObjectTypeOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'ObjectTypeOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc2x3.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'ObjectTypeOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'ObjectTypeOf', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc2x3.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_WR21:
|
||||
SCOPE = 'entity'
|
||||
@@ -7331,7 +7331,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc2x3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
|
||||
class IfcWorkControl_WR1:
|
||||
SCOPE = 'entity'
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -6565,7 +6565,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -6574,7 +6574,7 @@ class IfcDoorPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -10952,7 +10952,7 @@ class IfcTypeProduct_ApplicableOccurrence:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_ValidFlangeThickness:
|
||||
SCOPE = 'entity'
|
||||
@@ -11258,7 +11258,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -11267,7 +11267,7 @@ class IfcWindowPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -6656,7 +6656,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -6665,7 +6665,7 @@ class IfcDoorPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -11103,7 +11103,7 @@ class IfcTypeProduct_ApplicableOccurrence:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x1.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x1.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_ValidFlangeThickness:
|
||||
SCOPE = 'entity'
|
||||
@@ -11409,7 +11409,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -11418,7 +11418,7 @@ class IfcWindowPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -6877,7 +6877,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -6886,7 +6886,7 @@ class IfcDoorPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -11365,7 +11365,7 @@ class IfcTypeProduct_ApplicableOccurrence:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x2.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x2.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_ValidFlangeThickness:
|
||||
SCOPE = 'entity'
|
||||
@@ -11701,7 +11701,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -11710,7 +11710,7 @@ class IfcWindowPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -7650,7 +7650,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -7659,7 +7659,7 @@ class IfcDoorPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
|
||||
class IfcDoorType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -12698,7 +12698,7 @@ class IfcTypeProduct_ApplicableOccurrence:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_add2.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_add2.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_ValidFlangeThickness:
|
||||
SCOPE = 'entity'
|
||||
@@ -13075,7 +13075,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
|
||||
class IfcWindowPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -13084,7 +13084,7 @@ class IfcWindowPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and 'ifc4x3_add2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE))) is not False
|
||||
|
||||
class IfcWindowType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -7549,7 +7549,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -7558,7 +7558,7 @@ class IfcDoorPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -12384,7 +12384,7 @@ class IfcTypeProduct_ApplicableOccurrence:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc1.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc1.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_ValidFlangeThickness:
|
||||
SCOPE = 'entity'
|
||||
@@ -12720,7 +12720,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -12729,7 +12729,7 @@ class IfcWindowPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc1.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc1.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -7637,7 +7637,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -7646,7 +7646,7 @@ class IfcDoorPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -12479,7 +12479,7 @@ class IfcTypeProduct_ApplicableOccurrence:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc2.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc2.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_ValidFlangeThickness:
|
||||
SCOPE = 'entity'
|
||||
@@ -12815,7 +12815,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -12824,7 +12824,7 @@ class IfcWindowPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc2.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc2.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -246,7 +246,7 @@ notdefined = IfcAlarmTypeEnum.NOTDEFINED
|
||||
IfcAlignmentCantSegmentTypeEnum = enum_namespace()
|
||||
constantcant = IfcAlignmentCantSegmentTypeEnum.CONSTANTCANT
|
||||
lineartransition = IfcAlignmentCantSegmentTypeEnum.LINEARTRANSITION
|
||||
helmertcurve = IfcAlignmentCantSegmentTypeEnum.HELMERTCURVE
|
||||
biquadraticparabola = IfcAlignmentCantSegmentTypeEnum.BIQUADRATICPARABOLA
|
||||
blosscurve = IfcAlignmentCantSegmentTypeEnum.BLOSSCURVE
|
||||
cosinecurve = IfcAlignmentCantSegmentTypeEnum.COSINECURVE
|
||||
sinecurve = IfcAlignmentCantSegmentTypeEnum.SINECURVE
|
||||
@@ -256,7 +256,7 @@ line = IfcAlignmentHorizontalSegmentTypeEnum.LINE
|
||||
circulararc = IfcAlignmentHorizontalSegmentTypeEnum.CIRCULARARC
|
||||
clothoid = IfcAlignmentHorizontalSegmentTypeEnum.CLOTHOID
|
||||
cubic = IfcAlignmentHorizontalSegmentTypeEnum.CUBIC
|
||||
helmertcurve = IfcAlignmentHorizontalSegmentTypeEnum.HELMERTCURVE
|
||||
biquadraticparabola = IfcAlignmentHorizontalSegmentTypeEnum.BIQUADRATICPARABOLA
|
||||
blosscurve = IfcAlignmentHorizontalSegmentTypeEnum.BLOSSCURVE
|
||||
cubicspiral = IfcAlignmentHorizontalSegmentTypeEnum.CUBICSPIRAL
|
||||
cosinecurve = IfcAlignmentHorizontalSegmentTypeEnum.COSINECURVE
|
||||
@@ -802,9 +802,9 @@ soundabsorption = IfcDiscreteAccessoryTypeEnum.SOUNDABSORPTION
|
||||
pointmachinemountingdevice = IfcDiscreteAccessoryTypeEnum.POINTMACHINEMOUNTINGDEVICE
|
||||
point_machine_locking_device = IfcDiscreteAccessoryTypeEnum.POINT_MACHINE_LOCKING_DEVICE
|
||||
rail_mechanical_equipment = IfcDiscreteAccessoryTypeEnum.RAIL_MECHANICAL_EQUIPMENT
|
||||
birdprotection = IfcDiscreteAccessoryTypeEnum.BIRDPROTECTION
|
||||
userdefined = IfcDiscreteAccessoryTypeEnum.USERDEFINED
|
||||
notdefined = IfcDiscreteAccessoryTypeEnum.NOTDEFINED
|
||||
birdprotection = IfcDiscreteAccessoryTypeEnum.BIRDPROTECTION
|
||||
IfcDistributionBoardTypeEnum = enum_namespace()
|
||||
switchboard = IfcDistributionBoardTypeEnum.SWITCHBOARD
|
||||
consumerunit = IfcDistributionBoardTypeEnum.CONSUMERUNIT
|
||||
@@ -1418,7 +1418,7 @@ logicalnotor = IfcLogicalOperatorEnum.LOGICALNOTOR
|
||||
IfcMarineFacilityTypeEnum = enum_namespace()
|
||||
canal = IfcMarineFacilityTypeEnum.CANAL
|
||||
waterwayshiplift = IfcMarineFacilityTypeEnum.WATERWAYSHIPLIFT
|
||||
revetment = IfcMarineFacilityTypeEnum.REVETMENT
|
||||
embankment = IfcMarineFacilityTypeEnum.EMBANKMENT
|
||||
launchrecovery = IfcMarineFacilityTypeEnum.LAUNCHRECOVERY
|
||||
marinedefence = IfcMarineFacilityTypeEnum.MARINEDEFENCE
|
||||
hydrolift = IfcMarineFacilityTypeEnum.HYDROLIFT
|
||||
@@ -1587,11 +1587,6 @@ dataoutlet = IfcOutletTypeEnum.DATAOUTLET
|
||||
telephoneoutlet = IfcOutletTypeEnum.TELEPHONEOUTLET
|
||||
userdefined = IfcOutletTypeEnum.USERDEFINED
|
||||
notdefined = IfcOutletTypeEnum.NOTDEFINED
|
||||
IfcPavementTypeEnum = enum_namespace()
|
||||
flexible = IfcPavementTypeEnum.FLEXIBLE
|
||||
rigid = IfcPavementTypeEnum.RIGID
|
||||
userdefined = IfcPavementTypeEnum.USERDEFINED
|
||||
notdefined = IfcPavementTypeEnum.NOTDEFINED
|
||||
IfcPerformanceHistoryTypeEnum = enum_namespace()
|
||||
userdefined = IfcPerformanceHistoryTypeEnum.USERDEFINED
|
||||
notdefined = IfcPerformanceHistoryTypeEnum.NOTDEFINED
|
||||
@@ -2073,7 +2068,6 @@ parking = IfcSpaceTypeEnum.PARKING
|
||||
gfa = IfcSpaceTypeEnum.GFA
|
||||
internal = IfcSpaceTypeEnum.INTERNAL
|
||||
external = IfcSpaceTypeEnum.EXTERNAL
|
||||
berth = IfcSpaceTypeEnum.BERTH
|
||||
userdefined = IfcSpaceTypeEnum.USERDEFINED
|
||||
notdefined = IfcSpaceTypeEnum.NOTDEFINED
|
||||
IfcSpatialZoneTypeEnum = enum_namespace()
|
||||
@@ -3126,9 +3120,6 @@ def IfcDirection(*args, **kwargs):
|
||||
def IfcDirectrixCurveSweptAreaSolid(*args, **kwargs):
|
||||
return ifcopenshell.create_entity('IfcDirectrixCurveSweptAreaSolid', 'IFC4X3_RC3', *args, **kwargs)
|
||||
|
||||
def IfcDirectrixDerivedReferenceSweptAreaSolid(*args, **kwargs):
|
||||
return ifcopenshell.create_entity('IfcDirectrixDerivedReferenceSweptAreaSolid', 'IFC4X3_RC3', *args, **kwargs)
|
||||
|
||||
def IfcDirectrixDistanceSweptAreaSolid(*args, **kwargs):
|
||||
return ifcopenshell.create_entity('IfcDirectrixDistanceSweptAreaSolid', 'IFC4X3_RC3', *args, **kwargs)
|
||||
|
||||
@@ -7670,7 +7661,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -7679,7 +7670,7 @@ class IfcDoorPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -8276,7 +8267,7 @@ class IfcFacilityPart_CorrectPredefinedType:
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE)
|
||||
assert ((predefinedtype != express_getattr(IfcBridgePartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcRailwayPartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcRoadPartTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype != express_getattr(IfcMarinePartTypeEnum, 'USERDEFINED', INDETERMINATE)) or (predefinedtype != express_getattr(IfcFacilityPartCommonTypeEnum, 'USERDEFINED', INDETERMINATE))) or ((predefinedtype == express_getattr(IfcBridgePartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcRailwayPartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcRoadPartTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcMarinePartTypeEnum, 'USERDEFINED', INDETERMINATE)) or (predefinedtype == express_getattr(IfcFacilityPartCommonTypeEnum, 'USERDEFINED', INDETERMINATE))) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False
|
||||
assert (not exists(predefinedtype) or (predefinedtype != express_getattr(IfcBridgePartTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcRailwayPartTypeEnum, 'USERDEFINED', INDETERMINATE) and (predefinedtype != express_getattr(IfcRoadPartTypeEnum, 'USERDEFINED', INDETERMINATE)) and (predefinedtype != express_getattr(IfcMarinePartTypeEnum, 'USERDEFINED', INDETERMINATE)) and (predefinedtype != express_getattr(IfcFacilityPartCommonTypeEnum, 'USERDEFINED', INDETERMINATE))) or ((predefinedtype == express_getattr(IfcBridgePartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcRailwayPartTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcRoadPartTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcMarinePartTypeEnum, 'USERDEFINED', INDETERMINATE)) or (predefinedtype == express_getattr(IfcFacilityPartCommonTypeEnum, 'USERDEFINED', INDETERMINATE))) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False
|
||||
|
||||
class IfcFan_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -8834,7 +8825,7 @@ class IfcImpactProtectionDevice_CorrectPredefinedType:
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE)
|
||||
assert (not exists(predefinedtype) or (predefinedtype != express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) or ((predefinedtype == express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False
|
||||
assert (not exists(predefinedtype) or (predefinedtype != express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) and (predefinedtype != express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE))) or ((predefinedtype == express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False
|
||||
|
||||
class IfcImpactProtectionDevice_CorrectTypeAssigned:
|
||||
SCOPE = 'entity'
|
||||
@@ -8854,7 +8845,7 @@ class IfcImpactProtectionDeviceType_CorrectPredefinedType:
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE)
|
||||
assert ((predefinedtype != express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype != express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) or ((predefinedtype == express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False
|
||||
assert (predefinedtype != express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) and (predefinedtype != express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) or ((predefinedtype == express_getattr(IfcImpactProtectionDeviceTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationDamperTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcVibrationIsolatorTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False
|
||||
|
||||
class IfcIndexedPolyCurve_Consecutive:
|
||||
SCOPE = 'entity'
|
||||
@@ -9523,36 +9514,6 @@ class IfcPath_IsContinuous:
|
||||
def __call__(self):
|
||||
assert IfcPathHeadToTail(self) is not False
|
||||
|
||||
class IfcPavement_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
TYPE_NAME = 'IfcPavement'
|
||||
RULE_NAME = 'CorrectPredefinedType'
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE)
|
||||
assert (not exists(predefinedtype) or predefinedtype != express_getattr(IfcPavementTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcPavementTypeEnum, 'USERDEFINED', INDETERMINATE) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False
|
||||
|
||||
class IfcPavement_CorrectTypeAssigned:
|
||||
SCOPE = 'entity'
|
||||
TYPE_NAME = 'IfcPavement'
|
||||
RULE_NAME = 'CorrectTypeAssigned'
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
istypedby = express_getattr(self, 'IsTypedBy', INDETERMINATE)
|
||||
assert (sizeof(istypedby) == 0 or 'ifc4x3_rc3.ifcpavementtype' in typeof(express_getattr(express_getitem(express_getattr(self, 'IsTypedBy', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatingType', INDETERMINATE))) is not False
|
||||
|
||||
class IfcPavementType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
TYPE_NAME = 'IfcPavementType'
|
||||
RULE_NAME = 'CorrectPredefinedType'
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE)
|
||||
assert (predefinedtype != express_getattr(IfcPavementTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcPavementTypeEnum, 'USERDEFINED', INDETERMINATE) and exists(express_getattr(self, 'ElementType', INDETERMINATE)))) is not False
|
||||
|
||||
class IfcPcurve_DimIs2D:
|
||||
SCOPE = 'entity'
|
||||
TYPE_NAME = 'IfcPcurve'
|
||||
@@ -9844,29 +9805,6 @@ class IfcPolyline_SameDim:
|
||||
points = express_getattr(self, 'Points', INDETERMINATE)
|
||||
assert (sizeof([temp for temp in points if express_getattr(temp, 'Dim', INDETERMINATE) != express_getattr(express_getitem(points, 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'Dim', INDETERMINATE)]) == 0) is not False
|
||||
|
||||
class IfcPolynomialCurve_ValidCoefficients:
|
||||
SCOPE = 'entity'
|
||||
TYPE_NAME = 'IfcPolynomialCurve'
|
||||
RULE_NAME = 'ValidCoefficients'
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
coefficientsx = express_getattr(self, 'CoefficientsX', INDETERMINATE)
|
||||
coefficientsy = express_getattr(self, 'CoefficientsY', INDETERMINATE)
|
||||
coefficientsz = express_getattr(self, 'CoefficientsZ', INDETERMINATE)
|
||||
assert (exists(coefficientsx) and exists(coefficientsy) or (exists(coefficientsx) and exists(coefficientsz)) or (exists(coefficientsy) and exists(coefficientsz)) or (exists(coefficientsx) and exists(coefficientsy) and exists(coefficientsz))) is not False
|
||||
|
||||
class IfcPolynomialCurve_CorrectPositionDim:
|
||||
SCOPE = 'entity'
|
||||
TYPE_NAME = 'IfcPolynomialCurve'
|
||||
RULE_NAME = 'CorrectPositionDim'
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
position = express_getattr(self, 'Position', INDETERMINATE)
|
||||
coefficientsz = express_getattr(self, 'CoefficientsZ', INDETERMINATE)
|
||||
assert (express_getattr(position, 'Dim', INDETERMINATE) == 2 and (not exists(coefficientsz)) or express_getattr(position, 'Dim', INDETERMINATE) == 3) is not False
|
||||
|
||||
class IfcPositioningElement_HasPlacement:
|
||||
SCOPE = 'entity'
|
||||
TYPE_NAME = 'IfcPositioningElement'
|
||||
@@ -11154,7 +11092,7 @@ class IfcSectionedSolidHorizontal_NoLongitudinalOffsets:
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
crosssectionpositions = express_getattr(self, 'CrossSectionPositions', INDETERMINATE)
|
||||
assert (sizeof([temp for temp in crosssectionpositions if exists(express_getattr(express_getattr(temp, 'Location', INDETERMINATE), 'OffsetLongitudinal', INDETERMINATE))]) == 0) is not False
|
||||
assert (sizeof([temp for temp in crosssectionpositions if exists(express_getattr(temp, 'OffsetLongitudinal', INDETERMINATE))]) == 0) is not False
|
||||
|
||||
class IfcSectionedSpine_CorrespondingSectionPositions:
|
||||
SCOPE = 'entity'
|
||||
@@ -12514,7 +12452,7 @@ class IfcTransportElement_CorrectPredefinedType:
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE)
|
||||
assert (not exists(predefinedtype) or (predefinedtype != express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE)) or ((predefinedtype == express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ElementType', INDETERMINATE)))) is not False
|
||||
assert (not exists(predefinedtype) or (predefinedtype != express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE)) or ((predefinedtype == express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ObjectType', INDETERMINATE)))) is not False
|
||||
|
||||
class IfcTransportElement_CorrectTypeAssigned:
|
||||
SCOPE = 'entity'
|
||||
@@ -12534,7 +12472,7 @@ class IfcTransportElementType_CorrectPredefinedType:
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
predefinedtype = express_getattr(self, 'PredefinedType', INDETERMINATE)
|
||||
assert (predefinedtype != express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or (predefinedtype == express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE) and exists(express_getattr(self, 'ElementType', INDETERMINATE))))) is not False
|
||||
assert (predefinedtype != express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) and predefinedtype != express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or ((predefinedtype == express_getattr(IfcTransportElementFixedTypeEnum, 'USERDEFINED', INDETERMINATE) or predefinedtype == express_getattr(IfcTransportElementNonFixedTypeEnum, 'USERDEFINED', INDETERMINATE)) and exists(express_getattr(self, 'ElementType', INDETERMINATE)))) is not False
|
||||
|
||||
def calc_IfcTriangulatedFaceSet_NumberOfTriangles(self):
|
||||
coordindex = express_getattr(self, 'CoordIndex', INDETERMINATE)
|
||||
@@ -12635,7 +12573,7 @@ class IfcTypeProduct_ApplicableOccurrence:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc3.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc3.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_ValidFlangeThickness:
|
||||
SCOPE = 'entity'
|
||||
@@ -12991,7 +12929,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -13000,7 +12938,7 @@ class IfcWindowPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc3.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc3.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -13440,8 +13378,6 @@ def IfcCurveDim(curve):
|
||||
if 'ifc4x3_rc3.ifccurvesegment2d' in typeof(curve):
|
||||
return 2
|
||||
if 'ifc4x3_rc3.ifcpolynomialcurve' in typeof(curve):
|
||||
if not exists(express_getattr(curve, 'CoefficientsZ', INDETERMINATE)) and express_getattr(express_getattr(curve, 'Position', INDETERMINATE), 'Dim', INDETERMINATE) == 2:
|
||||
return 2
|
||||
return 3
|
||||
if 'ifc4x3_rc3.ifcpcurve' in typeof(curve):
|
||||
return 3
|
||||
|
||||
@@ -44,10 +44,10 @@ unknown = 'UNKNOWN'
|
||||
def usedin(inst, ref_name):
|
||||
if inst is None:
|
||||
return []
|
||||
(_, __, attr) = ref_name.split('.')
|
||||
_, __, attr = ref_name.split('.')
|
||||
|
||||
def filter():
|
||||
for (ref, attr_idx) in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
||||
yield ref
|
||||
return list(filter())
|
||||
@@ -7686,7 +7686,7 @@ class IfcDoorLiningProperties_WR35:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -7695,7 +7695,7 @@ class IfcDoorPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcdoortype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcdoorstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcDoorType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
@@ -12651,7 +12651,7 @@ class IfcTypeProduct_ApplicableOccurrence:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (not exists(lambda : express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc4.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
assert (not exists(lambda: express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or sizeof([temp for temp in express_getattr(express_getitem(express_getattr(self, 'Types', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE), 'RelatedObjects', INDETERMINATE) if not 'ifc4x3_rc4.ifcproduct' in typeof(temp)]) == 0) is not False
|
||||
|
||||
class IfcUShapeProfileDef_ValidFlangeThickness:
|
||||
SCOPE = 'entity'
|
||||
@@ -13007,7 +13007,7 @@ class IfcWindowLiningProperties_WR34:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowPanelProperties_ApplicableToType:
|
||||
SCOPE = 'entity'
|
||||
@@ -13016,7 +13016,7 @@ class IfcWindowPanelProperties_ApplicableToType:
|
||||
|
||||
@staticmethod
|
||||
def __call__(self):
|
||||
assert (exists(lambda : express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
assert (exists(lambda: express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) and ('ifc4x3_rc4.ifcwindowtype' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)) or 'ifc4x3_rc4.ifcwindowstyle' in typeof(express_getitem(express_getattr(self, 'DefinesType', INDETERMINATE), 1 - EXPRESS_ONE_BASED_INDEXING, INDETERMINATE)))) is not False
|
||||
|
||||
class IfcWindowType_CorrectPredefinedType:
|
||||
SCOPE = 'entity'
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
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-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
|
||||
@@ -19,7 +19,7 @@ IF EXIST IFC2X3_TC1.exp (
|
||||
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
|
||||
)
|
||||
|
||||
@@ -30,7 +30,7 @@ IF EXIST IFC4_ADD2TC1.exp (
|
||||
:: 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-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
|
||||
@@ -40,7 +40,7 @@ IF EXIST IFC4_ADD2TC1.exp (
|
||||
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
|
||||
)
|
||||
|
||||
@@ -51,10 +51,10 @@ IF EXIST IFC4x1.exp (
|
||||
:: 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-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
|
||||
)
|
||||
|
||||
@@ -65,10 +65,10 @@ IF EXIST IFC4x2.exp (
|
||||
:: 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-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
|
||||
)
|
||||
|
||||
@@ -79,10 +79,10 @@ IF EXIST IFC4x3_RC1.exp (
|
||||
:: 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-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
|
||||
)
|
||||
|
||||
@@ -93,10 +93,10 @@ IF EXIST IFC4x3_RC2.exp (
|
||||
:: 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-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
|
||||
)
|
||||
|
||||
@@ -107,10 +107,10 @@ IF EXIST IFC4x3_RC3.exp (
|
||||
:: 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-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
|
||||
)
|
||||
|
||||
@@ -121,10 +121,10 @@ IF EXIST IFC4x3_RC4.exp (
|
||||
:: 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-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
|
||||
)
|
||||
|
||||
@@ -135,10 +135,10 @@ IF EXIST IFC4X3.exp (
|
||||
:: 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-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
|
||||
)
|
||||
|
||||
@@ -149,10 +149,10 @@ IF EXIST IFC4X3_TC1.exp (
|
||||
:: 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-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
|
||||
)
|
||||
|
||||
@@ -163,10 +163,10 @@ IF EXIST IFC4X3_ADD1.exp (
|
||||
:: 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-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
|
||||
)
|
||||
|
||||
@@ -177,9 +177,9 @@ IF EXIST IFC4X3_ADD2.exp (
|
||||
:: v0.6.0
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add2.cpp txt/header_ifc4x3_add2.txt Ifc4x3_add2.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add2.h txt/header_ifc4x3_add2.txt Ifc4x3_add2.h
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add2-schema.cpp txt/header_ifc4x3_add2.txt Ifc4x3_add2-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add2-schema.cpp txt/header_ifc4x3_add2.txt Ifc4x3_add2-schema.cpp
|
||||
python cat.py -o ..\..\..\ifcparse\Ifc4x3_add2-definitions.h txt/header_ifc4x3_add2.txt Ifc4x3_add2-definitions.h
|
||||
)
|
||||
|
||||
|
||||
del *.cpp *.h
|
||||
)
|
||||
|
||||
@@ -18,15 +18,9 @@
|
||||
|
||||
|
||||
import nodes
|
||||
import platform
|
||||
import collections
|
||||
import pyparsing
|
||||
|
||||
if tuple(map(int, platform.python_version_tuple())) < (2, 7):
|
||||
import ordereddict
|
||||
|
||||
collections.OrderedDict = ordereddict.OrderedDict
|
||||
|
||||
|
||||
# According to ISO 10303-11 7.1.2: Letters: "... The case of
|
||||
# letters is significant only within explicit string literals."
|
||||
|
||||
@@ -23,7 +23,6 @@ import numbers
|
||||
import os
|
||||
import re
|
||||
import time
|
||||
import types
|
||||
import weakref
|
||||
import zipfile
|
||||
from collections.abc import Callable, Generator
|
||||
@@ -244,19 +243,14 @@ file_dict: dict[int, tuple[weakref.ReferenceType[file], int]] = {}
|
||||
"""Mapping of internal IfcFile pointer address to existing ``ifcopenshell.file``
|
||||
and the timestamp when it was created.
|
||||
|
||||
Needed only to quickly access related from ``entity_instance`` it's ``file``.
|
||||
Needed only to quickly access from ``entity_instance`` its ``file``.
|
||||
"""
|
||||
|
||||
READ_ERROR = ifcopenshell_wrapper.file_open_status.READ_ERROR
|
||||
NO_HEADER = ifcopenshell_wrapper.file_open_status.NO_HEADER
|
||||
UNSUPPORTED_SCHEMA = ifcopenshell_wrapper.file_open_status.UNSUPPORTED_SCHEMA
|
||||
INVALID_SYNTAX = ifcopenshell_wrapper.file_open_status.INVALID_SYNTAX
|
||||
|
||||
# TODO: Workaround for old builds, remove after build stabilizes.
|
||||
try:
|
||||
UNKNOWN = ifcopenshell_wrapper.file_open_status.UNKNOWN
|
||||
except:
|
||||
UNKNOWN = 5 # Workaround
|
||||
UNKNOWN = ifcopenshell_wrapper.file_open_status.UNKNOWN
|
||||
|
||||
import struct
|
||||
|
||||
@@ -594,11 +588,12 @@ class file:
|
||||
# A poweruser testing out a particular version of IFC4X3
|
||||
model = ifcopenshell.file(schema_version=(4, 3, 0, 1))
|
||||
"""
|
||||
import ifcopenshell.util.schema
|
||||
|
||||
if schema_version:
|
||||
prefixes = ("IFC", "X", "_ADD", "_TC")
|
||||
schema = "".join("".join(map(str, t)) if t[1] else "" for t in zip(prefixes, schema_version))
|
||||
schema = ifcopenshell.util.schema.get_schema_name_from_version(schema_version)
|
||||
else:
|
||||
schema = {"IFC4X3": "IFC4X3_ADD2"}.get(schema, schema)
|
||||
schema = ifcopenshell.util.schema.get_schema_identifier(schema)
|
||||
if f is not None:
|
||||
self.wrapped_data = f
|
||||
if not f.good():
|
||||
@@ -911,9 +906,16 @@ class file:
|
||||
self,
|
||||
inst: ifcopenshell.entity_instance,
|
||||
allow_duplicate: Literal[True],
|
||||
with_attribute_indices: bool = False,
|
||||
with_attribute_indices: Literal[False] = False,
|
||||
) -> list[ifcopenshell.entity_instance]: ...
|
||||
@overload
|
||||
def get_inverse(
|
||||
self,
|
||||
inst: ifcopenshell.entity_instance,
|
||||
allow_duplicate: Literal[True],
|
||||
with_attribute_indices: Literal[True],
|
||||
) -> list[tuple[ifcopenshell.entity_instance, int]]: ...
|
||||
@overload
|
||||
def get_inverse(
|
||||
self,
|
||||
inst: ifcopenshell.entity_instance,
|
||||
@@ -925,7 +927,11 @@ class file:
|
||||
inst: ifcopenshell.entity_instance,
|
||||
allow_duplicate: bool = False,
|
||||
with_attribute_indices: bool = False,
|
||||
) -> Union[list[ifcopenshell.entity_instance], set[ifcopenshell.entity_instance]]:
|
||||
) -> (
|
||||
list[ifcopenshell.entity_instance]
|
||||
| set[ifcopenshell.entity_instance]
|
||||
| list[tuple[ifcopenshell.entity_instance, int]]
|
||||
):
|
||||
"""Return a list of entities that reference this entity
|
||||
|
||||
Warning: this is a slow function, especially when there is a large
|
||||
@@ -1054,13 +1060,8 @@ class file:
|
||||
|
||||
@property
|
||||
def header(self) -> file_header:
|
||||
# TODO: Workaround for old builds, remove after build stabilizes.
|
||||
# TODO: No need for `wrapped_data.header` to be a method - should use `@property`?
|
||||
header = self.wrapped_data.header
|
||||
if isinstance(header, types.MethodType):
|
||||
return file_header(self, self.wrapped_data.header())
|
||||
else:
|
||||
return self.wrapped_data.header
|
||||
return file_header(self, self.wrapped_data.header())
|
||||
|
||||
@property
|
||||
def storage(self) -> Optional[rocksdb_file_storage]:
|
||||
|
||||
@@ -22,6 +22,8 @@ from __future__ import annotations
|
||||
from collections.abc import Generator, Iterable
|
||||
from typing import TYPE_CHECKING, Any, Literal, Optional, TypeVar, Union, cast, overload
|
||||
|
||||
import ifcopenshell
|
||||
|
||||
from .. import ifcopenshell_wrapper, open
|
||||
from ..entity_instance import entity_instance
|
||||
from ..file import file
|
||||
@@ -174,7 +176,7 @@ class settings_mixin:
|
||||
def set(self: settings, k: SETTING, v: Any) -> None: ...
|
||||
@overload
|
||||
def set(self: serializer_settings, k: SERIALIZER_SETTING, v: Any) -> None: ...
|
||||
def set(self, k: SETTING, v: Any) -> None:
|
||||
def set(self, k: Union[SETTING, SERIALIZER_SETTING], v: Any) -> None:
|
||||
"""
|
||||
Set value of the setting named `k` to `v`.
|
||||
|
||||
@@ -302,8 +304,7 @@ class iterator(ifcopenshell_wrapper.Iterator):
|
||||
logger=None,
|
||||
):
|
||||
self.settings = settings
|
||||
if logger is None and (logger_type := getattr(ifcopenshell_wrapper, "logger", None)):
|
||||
logger = logger_type.Root()
|
||||
logger = ifcopenshell.logger_or_root(logger)
|
||||
if isinstance(file_or_filename, file):
|
||||
self.file = file
|
||||
file_or_filename = file_or_filename.wrapped_data
|
||||
@@ -344,10 +345,10 @@ class iterator(ifcopenshell_wrapper.Iterator):
|
||||
include is not None,
|
||||
num_threads,
|
||||
)
|
||||
self.this = initializer(*args, *((logger,) if logger is not None else ()))
|
||||
self.this = initializer(*args, *ifcopenshell.optional_logger_args(logger))
|
||||
else:
|
||||
args = (geometry_library, self.settings, file_or_filename, num_threads)
|
||||
self.this = ifcopenshell_wrapper.construct_iterator(*args, *((logger,) if logger is not None else ()))
|
||||
self.this = ifcopenshell_wrapper.construct_iterator(*args, *ifcopenshell.optional_logger_args(logger))
|
||||
|
||||
if has_occ:
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from typing import Any, Literal, Union
|
||||
from typing import Any, Literal, Sequence, Union
|
||||
|
||||
from typing_extensions import Self
|
||||
|
||||
@@ -105,10 +105,12 @@ class IfcSpfHeader:
|
||||
"""
|
||||
|
||||
def __init__(self, *args): ...
|
||||
def assign(self, other): ...
|
||||
def file(self, *args): ...
|
||||
def file_description_py(self): ...
|
||||
def file_name_py(self): ...
|
||||
def file_schema_py(self): ...
|
||||
def logger(self) -> logger: ...
|
||||
def read(self): ...
|
||||
def tryRead(self): ...
|
||||
def write(self, out): ...
|
||||
@@ -138,7 +140,7 @@ class BRepElement(Element):
|
||||
def volume(self): ...
|
||||
|
||||
class ColladaSerializer(WriteOnlyGeometrySerializer):
|
||||
def __init__(self, dae_filename, geometry_settings, settings): ...
|
||||
def __init__(self, dae_filename, geometry_settings, settings, logger=None): ...
|
||||
def finalize(self): ...
|
||||
def isTesselated(self): ...
|
||||
def object_id(self, o): ...
|
||||
@@ -194,6 +196,7 @@ class ConversionResultShape:
|
||||
def subtract(self, arg2): ...
|
||||
def surface_area_along_direction(self, tol, arg3, along_x, along_y, along_z): ...
|
||||
def surface_genus(self): ...
|
||||
def type(self) -> str: ...
|
||||
def vertices(self): ...
|
||||
def volume(self): ...
|
||||
def wrap_in_compound(self): ...
|
||||
@@ -284,7 +287,7 @@ class GeometrySerializer:
|
||||
def write(self, *args): ...
|
||||
|
||||
class GltfSerializer(WriteOnlyGeometrySerializer):
|
||||
def __init__(self, filename, geometry_settings, settings): ...
|
||||
def __init__(self, filename, geometry_settings, settings, logger=None): ...
|
||||
def finalize(self): ...
|
||||
def isTesselated(self): ...
|
||||
def ready(self): ...
|
||||
@@ -294,7 +297,7 @@ class GltfSerializer(WriteOnlyGeometrySerializer):
|
||||
def writeHeader(self): ...
|
||||
|
||||
class HdfSerializer(GeometrySerializer):
|
||||
def __init__(self, hdf_filename, geometry_settings, settings, read_only=False): ...
|
||||
def __init__(self, hdf_filename, geometry_settings, settings, read_only=False, logger=None): ...
|
||||
def finalize(self): ...
|
||||
def isTesselated(self): ...
|
||||
def read(self, *args): ...
|
||||
@@ -370,7 +373,7 @@ class Iterator:
|
||||
...
|
||||
|
||||
def process_concurrently(self): ...
|
||||
def process_finished_rep(self, rep): ...
|
||||
def process_finished_rep(self, rep, kernel=None): ...
|
||||
def progress(self) -> int:
|
||||
"""Return current progress (0-100).
|
||||
|
||||
@@ -390,25 +393,41 @@ class JsonSerializer:
|
||||
def setFile(self, arg2): ...
|
||||
def writeHeader(self): ...
|
||||
|
||||
# TODO: MakeVolume is ignored in SWIG, remove from stub once build is bumped.
|
||||
class MakeVolume:
|
||||
defaultvalue: Any
|
||||
description: Any
|
||||
name: Any
|
||||
|
||||
class OpaqueCoordinate_3:
|
||||
def __init__(self, *args): ...
|
||||
def dot(self, other): ...
|
||||
def get(self, i): ...
|
||||
def get_double(self, i): ...
|
||||
def norm(self): ...
|
||||
def normalized(self): ...
|
||||
def normalized_by_max_abs(self): ...
|
||||
def scale(self, scalar): ...
|
||||
def set(self, i, n): ...
|
||||
def size(self): ...
|
||||
def to_double(self): ...
|
||||
|
||||
class OpaqueCoordinate_4:
|
||||
def __init__(self, *args): ...
|
||||
def dot(self, other): ...
|
||||
def get(self, i): ...
|
||||
def get_double(self, i): ...
|
||||
def norm(self): ...
|
||||
def normalized(self): ...
|
||||
def normalized_by_max_abs(self): ...
|
||||
def scale(self, scalar): ...
|
||||
def set(self, i, n): ...
|
||||
def size(self): ...
|
||||
def to_double(self): ...
|
||||
|
||||
class OpaqueNumber:
|
||||
def __init__(self, *args, **kwargs): ...
|
||||
def clone(self): ...
|
||||
def abs(self): ...
|
||||
def add(self, other): ...
|
||||
def divide(self, other): ...
|
||||
def empty(self): ...
|
||||
def equals(self, other): ...
|
||||
def less_than(self, other): ...
|
||||
def multiply(self, other): ...
|
||||
def negated(self): ...
|
||||
def same_type(self, *args): ...
|
||||
def subtract(self, other): ...
|
||||
def to_double(self): ...
|
||||
def to_string(self): ...
|
||||
|
||||
@@ -466,7 +485,7 @@ class Settings:
|
||||
def setting_names(self): ...
|
||||
|
||||
class SvgSerializer(WriteOnlyGeometrySerializer):
|
||||
def __init__(self, out_filename, geometry_settings, settings): ...
|
||||
def __init__(self, out_filename, geometry_settings, settings, logger=None): ...
|
||||
SH_NONE: Any
|
||||
SH_FULL: Any
|
||||
SH_LEFT: Any
|
||||
@@ -609,7 +628,7 @@ class TriangulationElement(Element):
|
||||
def geometry_pointer(self): ...
|
||||
|
||||
class TtlWktSerializer(WriteOnlyGeometrySerializer):
|
||||
def __init__(self, filename, geometry_settings, settings): ...
|
||||
def __init__(self, filename, geometry_settings, settings, logger=None): ...
|
||||
def finalize(self): ...
|
||||
def isTesselated(self): ...
|
||||
def ready(self): ...
|
||||
@@ -620,7 +639,7 @@ class TtlWktSerializer(WriteOnlyGeometrySerializer):
|
||||
def writeHeader(self): ...
|
||||
|
||||
class WaveFrontOBJSerializer(WriteOnlyGeometrySerializer):
|
||||
def __init__(self, obj_filename, mtl_filename, geometry_settings, settings): ...
|
||||
def __init__(self, obj_filename, mtl_filename, geometry_settings, settings, logger=None): ...
|
||||
def finalize(self): ...
|
||||
def isTesselated(self): ...
|
||||
def ready(self): ...
|
||||
@@ -635,7 +654,7 @@ class WriteOnlyGeometrySerializer(GeometrySerializer):
|
||||
def read(self, *args): ...
|
||||
|
||||
class XmlSerializer:
|
||||
def __init__(self, file, xml_filename): ...
|
||||
def __init__(self, file, xml_filename, logger=None): ...
|
||||
def finalize(self): ...
|
||||
def ready(self): ...
|
||||
def setFile(self, arg2): ...
|
||||
@@ -643,14 +662,6 @@ class XmlSerializer:
|
||||
|
||||
class _SwigNonDynamicMeta(type): ...
|
||||
|
||||
class abstract_arrangement:
|
||||
def __init__(self, *args, **kwargs): ...
|
||||
def get_face_pairs(self): ...
|
||||
def merge(self, edge_indices): ...
|
||||
def num_edges(self): ...
|
||||
def num_faces(self): ...
|
||||
def write(self, polygons, progress): ...
|
||||
|
||||
class aggregation_type(parameter_type):
|
||||
def __init__(self, type_of_aggregation, bound1, bound2, type_of_element): ...
|
||||
array_type: Any
|
||||
@@ -664,6 +675,15 @@ class aggregation_type(parameter_type):
|
||||
def type_of_aggregation_string(self): ...
|
||||
def type_of_element(self) -> parameter_type: ...
|
||||
|
||||
class arrange_polygon_settings:
|
||||
debug_output: bool
|
||||
line_cleaning_algo: int
|
||||
outer_perimiter_algo: int
|
||||
perform_cleanup: bool
|
||||
polygon_offset_distance: float
|
||||
subdivision_factor: float
|
||||
topology_reconstruction_algo: int
|
||||
|
||||
class attribute:
|
||||
def __init__(self, name, type_of_attribute, optional): ...
|
||||
def name(self) -> str: ...
|
||||
@@ -854,8 +874,22 @@ class ellipse(curve):
|
||||
|
||||
class entity(declaration):
|
||||
def __init__(self, name, is_abstract, index_in_schema, supertype): ...
|
||||
def all_attributes(self) -> tuple[attribute, ...]: ...
|
||||
def all_inverse_attributes(self) -> tuple[inverse_attribute, ...]: ...
|
||||
def all_attributes(self) -> tuple[attribute, ...]:
|
||||
"""Get a tuple of attributes, including those inherited from supertypes."""
|
||||
...
|
||||
|
||||
def attributes(self) -> tuple[attribute, ...]:
|
||||
"""Get a tuple of direct attributes."""
|
||||
...
|
||||
|
||||
def all_inverse_attributes(self) -> tuple[inverse_attribute, ...]:
|
||||
"""Get a tuple of inverse attributes, including those inherited from supertypes."""
|
||||
...
|
||||
|
||||
def inverse_attributes(self) -> tuple[inverse_attribute, ...]:
|
||||
"""Get a tuple of direct inverse attributes."""
|
||||
...
|
||||
|
||||
def argument_types(self) -> tuple[str, ...]:
|
||||
"""Get a tuple of types for each attribute in ``all_attributes()``."""
|
||||
...
|
||||
@@ -869,7 +903,6 @@ class entity(declaration):
|
||||
"""
|
||||
...
|
||||
|
||||
def attributes(self) -> tuple[attribute, ...]: ...
|
||||
def derived(self) -> tuple[bool, ...]:
|
||||
"""Return a tuple of booleans indicating whether each direct attribute is derived."""
|
||||
...
|
||||
@@ -1058,6 +1091,7 @@ class file:
|
||||
instantiate_typed_instances: bool
|
||||
def key_value_store_iter(self, prefix): ...
|
||||
def key_value_store_query(self, key): ...
|
||||
def logger(self) -> logger: ...
|
||||
def process_deletion_inverse(self, inst): ...
|
||||
def recalculate_id_counter(self): ...
|
||||
def remove(self, entity: entity_instance) -> None: ...
|
||||
@@ -1201,6 +1235,51 @@ class line_segment:
|
||||
def size(self): ...
|
||||
def swap(self, v): ...
|
||||
|
||||
class log_message:
|
||||
code: Any
|
||||
instance: Any
|
||||
message: Any
|
||||
product: Any
|
||||
severity: Any
|
||||
timestamp: Any
|
||||
|
||||
def __init__(self, severity, code_prefix, code_number, timestamp, message, inst=None, current_product=None): ...
|
||||
@property
|
||||
def severity_string(self): ...
|
||||
def to_dict(self): ...
|
||||
def to_tuple(self): ...
|
||||
|
||||
class logger:
|
||||
FMT_PLAIN: Literal[0]
|
||||
FMT_JSON: Literal[1]
|
||||
FMT_INMEMORY: Literal[2]
|
||||
|
||||
LOG_PERF: Literal[0]
|
||||
LOG_DEBUG: Literal[1]
|
||||
LOG_NOTICE: Literal[2]
|
||||
LOG_WARNING: Literal[3]
|
||||
LOG_ERROR: Literal[4]
|
||||
|
||||
@staticmethod
|
||||
def Root() -> logger: ...
|
||||
def Append(self, logger): ...
|
||||
def ClearLog(self): ...
|
||||
def Error(self, *args): ...
|
||||
def GetLog(self): ...
|
||||
def MaxSeverity(self): ...
|
||||
def Message(self, *args): ...
|
||||
def Notice(self, *args): ...
|
||||
def OutputFormat(self, *args): ...
|
||||
def PrintPerformanceStats(self): ...
|
||||
def PrintPerformanceStatsOnElement(self, *args): ...
|
||||
def ProgressBar(self, progress): ...
|
||||
def SetOutput(self, *args): ...
|
||||
def SetProduct(self, product): ...
|
||||
def Status(self, message, new_line=True): ...
|
||||
def Verbosity(self, *args): ...
|
||||
def Warning(self, *args): ...
|
||||
def log_messages(self) -> tuple[log_message, ...]: ...
|
||||
|
||||
class loft:
|
||||
axis: Any
|
||||
def calc_hash(self): ...
|
||||
@@ -1695,17 +1774,19 @@ class type_declaration(declaration):
|
||||
|
||||
class uninitialized_tag: ...
|
||||
|
||||
def arrange_polygons(settings, polygons): ...
|
||||
def arrange_polygons(
|
||||
settings: arrange_polygon_settings, polygons: Sequence[polygon_2], logger: logger | None = None
|
||||
) -> tuple[polygon_2, ...]: ...
|
||||
def clear_schemas(): ...
|
||||
def construct_iterator(geometry_library, settings, file, num_threads, logger=...): ...
|
||||
def construct_iterator(geometry_library, settings, file, num_threads, logger=None): ...
|
||||
def construct_iterator_with_include_exclude(
|
||||
geometry_library, settings, file, elems, include, num_threads, logger=...
|
||||
geometry_library, settings, file, elems, include, num_threads, logger=None
|
||||
): ...
|
||||
def construct_iterator_with_include_exclude_globalid(
|
||||
geometry_library, settings, file, elems, include, num_threads, logger=...
|
||||
geometry_library, settings, file, elems, include, num_threads, logger=None
|
||||
): ...
|
||||
def construct_iterator_with_include_exclude_id(
|
||||
geometry_library, settings, file, elems, include, num_threads, logger=...
|
||||
geometry_library, settings, file, elems, include, num_threads, logger=None
|
||||
): ...
|
||||
def convert_loop_to_function_item(loop): ...
|
||||
def create_box(*args): ...
|
||||
@@ -1721,10 +1802,11 @@ def kind_to_string(k): ...
|
||||
def less(arg1, arg2): ...
|
||||
def line_segments_to_polygons(s, eps, segments): ...
|
||||
def map_shape(settings, instance): ...
|
||||
def logger_or_root(logger) -> logger: ...
|
||||
def nary_union(sequence): ...
|
||||
def new_IfcBaseClass(schema_identifier: str, name: str) -> entity_instance: ...
|
||||
def open(fn: str, readonly: bool = False, logger=...) -> file: ...
|
||||
def parse_ifcxml(filename, logger=...): ...
|
||||
def open(fn: str, readonly: bool = False, logger=None) -> file: ...
|
||||
def parse_ifcxml(filename, logger=None): ...
|
||||
def polygons_to_svg(*args): ...
|
||||
def read(data): ...
|
||||
def register_schema(arg1): ...
|
||||
|
||||
@@ -50,6 +50,21 @@ def get_fallback_schema(version: str) -> IFC_SCHEMA:
|
||||
return version
|
||||
|
||||
|
||||
def get_schema_identifier(schema: IFC_SCHEMA) -> str:
|
||||
"""Resolve a general schema name to the specific identifier used internally
|
||||
(as in ``file.schema_identifier``).
|
||||
|
||||
E.g. ``IFC4X3`` -> ``IFC4X3_ADD2``.
|
||||
"""
|
||||
return {"IFC4X3": "IFC4X3_ADD2"}.get(schema, schema)
|
||||
|
||||
|
||||
def get_schema_name_from_version(schema_version: tuple[int, ...]) -> str:
|
||||
"""Build a schema name from a version tuple, e.g. (4, 3, 0, 1) -> "IFC4X3_TC1"."""
|
||||
prefixes = ("IFC", "X", "_ADD", "_TC")
|
||||
return "".join("".join(map(str, t)) if t[1] else "" for t in zip(prefixes, schema_version))
|
||||
|
||||
|
||||
def get_declaration(element: ifcopenshell.entity_instance):
|
||||
"""Get the schema declaration of an actively used entity instance
|
||||
|
||||
@@ -175,8 +190,8 @@ def geometry_classes_introduced_after(target_schema: IFC_SCHEMA, source_schema:
|
||||
B-splines, advanced surfaces, alignment curves on IFC4X3 → 2X3, …) or
|
||||
purge. Defaults match the IFC4 → IFC2X3 case for backwards compatibility
|
||||
with the original caller."""
|
||||
source = ifcopenshell_wrapper.schema_by_name(source_schema)
|
||||
target = ifcopenshell_wrapper.schema_by_name(target_schema)
|
||||
source = ifcopenshell.schema_by_name(source_schema)
|
||||
target = ifcopenshell.schema_by_name(target_schema)
|
||||
target_names = {decl.name() for decl in target.entities()}
|
||||
result: set[str] = set()
|
||||
for decl in source.entities():
|
||||
|
||||
@@ -473,7 +473,6 @@ class ShapeBuilder:
|
||||
if arc_points and self.file.schema == "IFC2X3":
|
||||
raise Exception("Arcs are not supported for IFC2X3.")
|
||||
|
||||
points: np.ndarray
|
||||
points = np.array(points)
|
||||
if position_offset is not None:
|
||||
points = points + position_offset
|
||||
@@ -635,7 +634,6 @@ class ShapeBuilder:
|
||||
diff = (0.01, 0.01) * diff_sign
|
||||
middle_point = points[0] + diff
|
||||
|
||||
points: list[VectorType]
|
||||
points = [points[0], middle_point, points[1]]
|
||||
points = [ifc_safe_vector_type(p) for p in points]
|
||||
seg = self.file.createIfcArcIndex((1, 2, 3))
|
||||
|
||||
@@ -27,11 +27,13 @@ dependencies = [
|
||||
|
||||
[project.optional-dependencies]
|
||||
advanced = [
|
||||
# `express` module - only for generating schemas.
|
||||
"networkx",
|
||||
]
|
||||
dev = [
|
||||
"pytest",
|
||||
"tabulate",
|
||||
"types-networkx",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Download and compile ifcopenshell.express rules for all available schemas.
|
||||
|
||||
Missing schemas that are known to be available on GitHub are downloaded first.
|
||||
|
||||
Usage:
|
||||
python compile-exp-rules.py # print this message
|
||||
python compile-exp-rules.py --check # download schemas and report which are present
|
||||
python compile-exp-rules.py --compile # implies --check, then compile rules for them
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import subprocess
|
||||
import sys
|
||||
import urllib.request
|
||||
from pathlib import Path
|
||||
from typing import NamedTuple
|
||||
|
||||
EXPRESS_DIR = Path(__file__).parent.parent / "ifcopenshell" / "express"
|
||||
|
||||
GITHUB_RAW_URL = (
|
||||
"https://raw.githubusercontent.com/buildingSMART/IFC4.x-development/refs/heads/ifc4.3-main/reference_schemas"
|
||||
)
|
||||
|
||||
# buildingSMART's website blocks automated/scripted downloads, so these have to be fetched manually.
|
||||
BUILDINGSMART_SCHEMAS_URL = "https://technical.buildingsmart.org/standards/ifc/ifc-schema-specifications/"
|
||||
|
||||
|
||||
class ExpFile(NamedTuple):
|
||||
name: str
|
||||
available_on_github: bool
|
||||
required: bool
|
||||
|
||||
|
||||
SCHEMA_TO_EXP_FILENAME = {
|
||||
# Main schemas.
|
||||
"IFC2X3": ExpFile("IFC2X3_TC1", True, True),
|
||||
"IFC4": ExpFile("IFC4_ADD2_TC1", True, True),
|
||||
# IFC4X3_ADD2 is available from https://technical.buildingsmart.org/standards/ifc/ifc-schema-specifications/
|
||||
"IFC4X3_ADD2": ExpFile("IFC4X3_ADD2", False, True),
|
||||
# Withdrawn schemas.
|
||||
"IFC4X1": ExpFile("IFC4x1", True, True),
|
||||
"IFC4X2": ExpFile("IFC4x2", True, True),
|
||||
# Retired schemas.
|
||||
"IFC4X3_RC1": ExpFile("IFC4x3_RC1", True, True),
|
||||
"IFC4X3_RC2": ExpFile("IFC4x3_RC2", True, True),
|
||||
"IFC4X3_RC3": ExpFile("IFC4x3_RC3", True, True),
|
||||
"IFC4X3_RC4": ExpFile("IFC4x3_RC4", True, True),
|
||||
## Couldn't find them anywhere, so I guess their .py will be missing updates.
|
||||
"IFC4X3": ExpFile("IFC4X3", False, False),
|
||||
"IFC4X3_ADD1": ExpFile("IFC4X3_ADD1", False, False),
|
||||
"IFC4X3_TC1": ExpFile("IFC4X3_TC1", False, False),
|
||||
}
|
||||
|
||||
|
||||
def download_schema(exp_filename: str, exp_path: Path) -> None:
|
||||
url = f"{GITHUB_RAW_URL}/{exp_filename}.exp"
|
||||
print(f"Downloading '{url}'...")
|
||||
with urllib.request.urlopen(url) as response:
|
||||
exp_path.write_bytes(response.read())
|
||||
|
||||
|
||||
def resolve_exp_paths() -> dict[str, Path]:
|
||||
exp_paths: dict[str, Path] = {}
|
||||
for schema_name, exp_file in SCHEMA_TO_EXP_FILENAME.items():
|
||||
exp_path = EXPRESS_DIR / f"{exp_file.name}.exp"
|
||||
if not exp_path.exists():
|
||||
if not exp_file.available_on_github:
|
||||
if exp_file.required:
|
||||
raise FileNotFoundError(
|
||||
f"{schema_name}: '{exp_path}' not found and not available on GitHub. "
|
||||
f"Download it from {BUILDINGSMART_SCHEMAS_URL} and save it to '{EXPRESS_DIR}'."
|
||||
)
|
||||
print(f"Skipping {schema_name}: '{exp_path}' not found and not available on GitHub.")
|
||||
continue
|
||||
download_schema(exp_file.name, exp_path)
|
||||
print(f"{schema_name}: present ({exp_path})")
|
||||
exp_paths[schema_name] = exp_path
|
||||
return exp_paths
|
||||
|
||||
|
||||
def compile_schema(schema_name: str, exp_path: Path) -> None:
|
||||
print(f"Compiling rules for {schema_name} from '{exp_path.name}'...")
|
||||
subprocess.run(
|
||||
[sys.executable, "-m", "rule_compiler", str(exp_path)],
|
||||
cwd=EXPRESS_DIR,
|
||||
check=True,
|
||||
)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
parser.add_argument("--check", action="store_true", help="download schemas and report which are present")
|
||||
parser.add_argument("--compile", action="store_true", help="implies --check, then compile rules for them")
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.check and not args.compile:
|
||||
print(__doc__)
|
||||
return
|
||||
|
||||
exp_paths = resolve_exp_paths()
|
||||
|
||||
if args.compile:
|
||||
for schema_name, exp_path in exp_paths.items():
|
||||
compile_schema(schema_name, exp_path)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Regular → Executable
+1
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Setup IfcOpenShell Development Environment.
|
||||
|
||||
Scripts creates symlinks in current user's site-packages to the IfcOpenShell repository.
|
||||
|
||||
@@ -217,6 +217,7 @@ def test_iterator():
|
||||
|
||||
|
||||
def test_logging():
|
||||
assert ifcopenshell.logger
|
||||
logger = ifcopenshell.logger()
|
||||
logger.OutputFormat(logger.FMT_INMEMORY)
|
||||
settings = ifcopenshell.geom.settings()
|
||||
|
||||
@@ -17,21 +17,11 @@
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import http.client
|
||||
from collections.abc import Sequence
|
||||
from pathlib import Path
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from typing_extensions import assert_never
|
||||
|
||||
try:
|
||||
from bs4 import BeautifulSoup
|
||||
except:
|
||||
pass
|
||||
|
||||
# Where it's also reflected:
|
||||
# - .github/workflows/ci-ifcopenshell-python.yml
|
||||
# - .github/workflows/ci-ifcopenshell-python-pypi.yml
|
||||
# - src/ifcopenshell-python/Makefile (PYVERSION check)
|
||||
SUPPORTED_PY_VERSIONS = ("310", "311", "312", "313", "314")
|
||||
SUPPORTED_PLATFORMS = ("win64", "linux64", "macos64", "macosm164")
|
||||
|
||||
@@ -41,24 +31,22 @@ WASM_TEMPLATE = "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-{BINA
|
||||
|
||||
|
||||
class TestPackageSupportedPlatforms:
|
||||
def test_run(self) -> None:
|
||||
@staticmethod
|
||||
def get_required_urls() -> list[str]:
|
||||
IOS_REPO = Path(__file__).parents[3]
|
||||
makefile = IOS_REPO / "src/ifcopenshell-python/Makefile"
|
||||
text = makefile.read_text()
|
||||
|
||||
# We don't use requests in ifcopenshell, so we use Python builtin stuff.
|
||||
parsed = urlparse("https://builds.ifcopenshell.org")
|
||||
conn = http.client.HTTPSConnection(parsed.netloc)
|
||||
conn.request("GET", parsed.path)
|
||||
response = conn.getresponse()
|
||||
build_html = response.read().decode("utf-8")
|
||||
|
||||
def find_make_var(var_name: str) -> str:
|
||||
line = next(l for l in text.splitlines() if l.startswith(f"{var_name}:="))
|
||||
return line.partition(":=")[2]
|
||||
|
||||
BINARY_VERSION = find_make_var("BINARY_VERSION")
|
||||
BUILD_COMMIT = find_make_var("BUILD_COMMIT")
|
||||
# Build workflows upload artifacts using a 7-char short SHA.
|
||||
assert (
|
||||
l := len(BUILD_COMMIT)
|
||||
) == 7, f"BUILD_COMMIT must be a 7-char short SHA, got {BUILD_COMMIT!r} (length {l})"
|
||||
|
||||
required_urls: list[str] = []
|
||||
|
||||
@@ -97,14 +85,47 @@ class TestPackageSupportedPlatforms:
|
||||
)
|
||||
required_urls.append(url)
|
||||
|
||||
# Verify all required URLs are present in the build HTML.
|
||||
missing_urls: Sequence[str]
|
||||
if "BeautifulSoup" in globals():
|
||||
missing_urls = set(required_urls) - set(a["href"] for a in BeautifulSoup(build_html).find_all("a"))
|
||||
else:
|
||||
missing_urls = []
|
||||
for url in required_urls:
|
||||
if url not in build_html:
|
||||
missing_urls.append(url)
|
||||
return required_urls
|
||||
|
||||
@staticmethod
|
||||
def get_missing_urls_fast(urls: list[str]) -> list[str]:
|
||||
"""Check `urls` against the build listing page.
|
||||
|
||||
Fast, but the listing page can lag behind what's actually on S3, so this may report URLs as
|
||||
missing that do exist.
|
||||
"""
|
||||
# We don't use requests in ifcopenshell, so we use Python builtin stuff.
|
||||
parsed = urlparse("https://builds.ifcopenshell.org")
|
||||
conn = http.client.HTTPSConnection(parsed.netloc)
|
||||
conn.request("GET", parsed.path)
|
||||
response = conn.getresponse()
|
||||
build_html = response.read().decode("utf-8")
|
||||
conn.close()
|
||||
|
||||
return [url for url in urls if url not in build_html]
|
||||
|
||||
@staticmethod
|
||||
def get_missing_urls_slow(urls: list[str]) -> list[str]:
|
||||
"""Check `urls` directly with a HEAD request each.
|
||||
|
||||
Slow, but more reliable.
|
||||
"""
|
||||
missing_urls: list[str] = []
|
||||
for url in urls:
|
||||
parsed = urlparse(url)
|
||||
conn = http.client.HTTPSConnection(parsed.netloc)
|
||||
conn.request("HEAD", parsed.path)
|
||||
response = conn.getresponse()
|
||||
response.read()
|
||||
conn.close()
|
||||
if response.status != 200:
|
||||
missing_urls.append(url)
|
||||
|
||||
return missing_urls
|
||||
|
||||
def test_run(self) -> None:
|
||||
required_urls = self.get_required_urls()
|
||||
maybe_missing_urls = self.get_missing_urls_fast(required_urls)
|
||||
missing_urls = self.get_missing_urls_slow(maybe_missing_urls)
|
||||
|
||||
assert not missing_urls
|
||||
|
||||
@@ -39,3 +39,25 @@ def ifcopenshell_open_test(str_: str, bool_: bool):
|
||||
assert_type(ifc_file, ifcopenshell.stream)
|
||||
|
||||
ifc_file = ifcopenshell.open(str_, readonly=True)
|
||||
|
||||
|
||||
def get_inverse_test(ifc_file: ifcopenshell.file, inst: ifcopenshell.entity_instance, bool_: bool):
|
||||
# Default: allow_duplicate=False, with_attribute_indices=False
|
||||
result = ifc_file.get_inverse(inst)
|
||||
assert_type(result, set[ifcopenshell.entity_instance])
|
||||
|
||||
# Explicit allow_duplicate=False
|
||||
result = ifc_file.get_inverse(inst, allow_duplicate=False)
|
||||
assert_type(result, set[ifcopenshell.entity_instance])
|
||||
|
||||
# allow_duplicate=True without indices
|
||||
result = ifc_file.get_inverse(inst, allow_duplicate=True)
|
||||
assert_type(result, list[ifcopenshell.entity_instance])
|
||||
|
||||
# allow_duplicate=True with indices
|
||||
result = ifc_file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True)
|
||||
assert_type(result, list[tuple[ifcopenshell.entity_instance, int]])
|
||||
|
||||
# Dynamic bool values (falls back to generic overload)
|
||||
result = ifc_file.get_inverse(inst, allow_duplicate=bool_)
|
||||
assert_type(result, list[ifcopenshell.entity_instance] | set[ifcopenshell.entity_instance])
|
||||
|
||||
@@ -447,7 +447,7 @@ public:
|
||||
};
|
||||
|
||||
#ifdef WITH_IFCXML
|
||||
IFC_PARSE_API IfcFile* parse_ifcxml(const std::string& filename, Logger& logger = Logger::Root());
|
||||
IFC_PARSE_API IfcFile* parse_ifcxml(const std::string& filename, Logger* logger = nullptr);
|
||||
#endif
|
||||
|
||||
namespace impl {
|
||||
|
||||
@@ -142,6 +142,13 @@ class IFC_PARSE_API Logger {
|
||||
const std::vector<log_message>& log_messages() const { return log_messages_; }
|
||||
};
|
||||
|
||||
// SWIG couldn't represent `Logger::Root()` default value using Python,
|
||||
// so when translating signature it represents it just as `fn(*args)`, losing information about args.
|
||||
// Using `Logger * = nullptr` instead of `&Logger = Logger::Root` helps,
|
||||
// since `nullptr` is convertable Python's `None`.
|
||||
// `logger_or_root` is just covering the boilerplate for this pattern.
|
||||
inline Logger& logger_or_root(Logger* logger) { return logger ? *logger : Logger::Root(); }
|
||||
|
||||
#define PERF(x) \
|
||||
\
|
||||
Logger::Root().Message(Logger::LOG_PERF, "SYS", 1, x); \
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string>
|
||||
#include <iomanip>
|
||||
#include <charconv>
|
||||
|
||||
#ifdef USE_MMAP
|
||||
#include <boost/filesystem/path.hpp>
|
||||
@@ -733,6 +732,41 @@ void IfcParse::impl::rocks_db_file_storage::remove_type_ref(IfcUtil::IfcBaseClas
|
||||
}
|
||||
|
||||
namespace {
|
||||
// Shortest decimal representation of 'd' that round-trips back to the
|
||||
// exact same double (like std::to_chars, or Python's repr).
|
||||
// Using actual `std::to_chars` requires macOS 13.3+, so we implement this manually,
|
||||
// until we drop support for older targets.
|
||||
//
|
||||
// Mirrors libstdc++'s notation-choice bounds (floating_to_chars.cc,
|
||||
// __floating_to_chars_shortest) to pick whichever of fixed/scientific is
|
||||
// shorter for a given digit count and exponent.
|
||||
static inline void format_double_shortest(char (&buf)[64], double d) {
|
||||
char sci[64];
|
||||
int mantissa_length = 17;
|
||||
for (int prec = 1; prec <= 17; ++prec) {
|
||||
snprintf(sci, sizeof(sci), "%.*e", prec - 1, d);
|
||||
if (strtod(sci, nullptr) == d) {
|
||||
mantissa_length = prec;
|
||||
break;
|
||||
}
|
||||
}
|
||||
const char* exp_str = strchr(sci, 'e');
|
||||
const int scientific_exponent = exp_str ? atoi(exp_str + 1) : 0;
|
||||
const int fd_exponent = scientific_exponent - (mantissa_length - 1);
|
||||
int lower_bound = -(mantissa_length + 3);
|
||||
int upper_bound = 5;
|
||||
if (mantissa_length == 1) {
|
||||
++lower_bound;
|
||||
--upper_bound;
|
||||
}
|
||||
if (fd_exponent >= lower_bound && fd_exponent <= upper_bound) {
|
||||
const int fixed_precision = fd_exponent < 0 ? -fd_exponent : 0;
|
||||
snprintf(buf, 64, "%.*f", fixed_precision, d);
|
||||
} else {
|
||||
snprintf(buf, 64, "%.*e", mantissa_length - 1, d);
|
||||
}
|
||||
}
|
||||
|
||||
class StringBuilderVisitor : public boost::static_visitor<void> {
|
||||
private:
|
||||
StringBuilderVisitor(const StringBuilderVisitor&); //N/A
|
||||
@@ -759,11 +793,9 @@ namespace {
|
||||
// values with noise digits (0.0174532925199433 -> 0.017453292519943299),
|
||||
// which rewrote every REAL and produced huge diffs when a file was
|
||||
// re-saved. See #7696.
|
||||
// std::to_chars is locale-independent, so no ostringstream/imbue is
|
||||
// needed here.
|
||||
char buf[64];
|
||||
const auto res = std::to_chars(buf, buf + sizeof(buf), d);
|
||||
const std::string str(buf, res.ptr);
|
||||
format_double_shortest(buf, d);
|
||||
const std::string str(buf);
|
||||
std::string::size_type e = str.find('e');
|
||||
if (e == std::string::npos) {
|
||||
e = str.find('E');
|
||||
|
||||
@@ -35,7 +35,13 @@ namespace {
|
||||
parse_context pc;
|
||||
storage->tokens->Next();
|
||||
storage->load(-1, nullptr, pc, -1);
|
||||
return pc.construct(boost::none, *storage->references_to_resolve, decl, decl->as_entity()->attribute_count(), -1, logger);
|
||||
// references_to_resolve is unset while reading the header (header
|
||||
// entities such as FILE_DESCRIPTION never reference other
|
||||
// instances), so fall back to a throwaway list instead of
|
||||
// dereferencing a null pointer.
|
||||
unresolved_references no_references;
|
||||
unresolved_references& references = storage->references_to_resolve ? *storage->references_to_resolve : no_references;
|
||||
return pc.construct(boost::none, references, decl, decl->as_entity()->attribute_count(), -1, logger);
|
||||
} else {
|
||||
// std::unreachable();
|
||||
return IfcEntityInstanceData(in_memory_attribute_storage(10));
|
||||
|
||||
@@ -695,10 +695,10 @@ end:
|
||||
return;
|
||||
}
|
||||
|
||||
IFC_PARSE_API IfcParse::IfcFile* IfcParse::parse_ifcxml(const std::string& filename, Logger& logger) {
|
||||
IFC_PARSE_API IfcParse::IfcFile* IfcParse::parse_ifcxml(const std::string& filename, Logger* logger) {
|
||||
throw std::runtime_error("IFC-XML import temporarily disabled");
|
||||
|
||||
ifcxml_parse_state state(logger);
|
||||
ifcxml_parse_state state(logger_or_root(logger));
|
||||
|
||||
xmlSAXHandler handler;
|
||||
memset(&handler, 0, sizeof(xmlSAXHandler));
|
||||
|
||||
@@ -184,7 +184,7 @@ class PatcherDoc(TypedDict):
|
||||
class InputDoc(TypedDict):
|
||||
name: str
|
||||
description: str
|
||||
type: Union[str, list[str]]
|
||||
type: NotRequired[Union[str, list[str]]]
|
||||
default: NotRequired[Any]
|
||||
generic_type: NotRequired[str]
|
||||
enum_items: NotRequired[list[str]]
|
||||
@@ -201,7 +201,7 @@ def _extract_docs(cls: type, method_name: str, boilerplate_args: Union[Sequence[
|
||||
for name, parameter in signature.parameters.items():
|
||||
if name == "self" or name in boilerplate_args:
|
||||
continue
|
||||
input_doc: InputDoc = {"name": name}
|
||||
input_doc: InputDoc = {"name": name, "description": "Undocumented"}
|
||||
inputs[name] = input_doc
|
||||
if isinstance(parameter.default, (str, float, int, bool)):
|
||||
input_doc["default"] = parameter.default
|
||||
@@ -267,10 +267,6 @@ def _extract_docs(cls: type, method_name: str, boilerplate_args: Union[Sequence[
|
||||
assert is_valid_filter_glob(filter_glob), f"Invalid filter_glob pattern: '{filter_glob}'."
|
||||
inputs[param_name]["filter_glob"] = filter_glob
|
||||
|
||||
for param_name in inputs:
|
||||
if "description" not in inputs[param_name]:
|
||||
inputs[param_name]["description"] = "Undocumented"
|
||||
|
||||
docs = PatcherDoc(
|
||||
class_=cls,
|
||||
description=doc_description,
|
||||
@@ -309,6 +305,7 @@ def parse_docstring(docstring: str) -> DocstringData:
|
||||
line = line[1:]
|
||||
if line.startswith(PREFIXES):
|
||||
prefix = line.split(" ")[0]
|
||||
assert prefix in PREFIXES, f"Invalid line: '{line}'."
|
||||
current_section = prefix
|
||||
match_ = re.match(rf"{prefix}\s+(\w+):\s+(.*)", line)
|
||||
assert match_, f"Invalid line: '{line}'."
|
||||
|
||||
@@ -24,6 +24,7 @@ import os
|
||||
import re
|
||||
import sys
|
||||
from typing import Literal, Optional, TypedDict, Union
|
||||
from typing_extensions import NotRequired
|
||||
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.element
|
||||
@@ -96,6 +97,12 @@ class ResultsSpecification(TypedDict):
|
||||
applicability: list[str]
|
||||
requirements: list[ResultsRequirement]
|
||||
|
||||
# Filled in by `Html.report()`.
|
||||
is_prohibited: NotRequired[bool]
|
||||
has_requirements: NotRequired[bool]
|
||||
has_omitted_applicable: NotRequired[bool]
|
||||
total_omitted_applicable: NotRequired[int]
|
||||
|
||||
|
||||
class ResultsRequirement(TypedDict):
|
||||
facet_type: str
|
||||
@@ -111,6 +118,15 @@ class ResultsRequirement(TypedDict):
|
||||
total_fail: int
|
||||
percent_pass: ResultsPercent
|
||||
|
||||
# Filled in by `Html.report()`.
|
||||
total_failed_entities: NotRequired[int]
|
||||
total_omitted_failures: NotRequired[int]
|
||||
has_omitted_failures: NotRequired[bool]
|
||||
total_passed_entities: NotRequired[int]
|
||||
total_omitted_passes: NotRequired[int]
|
||||
has_omitted_passes: NotRequired[bool]
|
||||
instructions: NotRequired[str | None]
|
||||
|
||||
|
||||
# use different syntax because of the "class" key
|
||||
ResultsEntity = TypedDict(
|
||||
@@ -244,7 +260,7 @@ class Txt(Console):
|
||||
class Json(Reporter):
|
||||
def __init__(self, ids: Ids, hide_skipped=False):
|
||||
super().__init__(ids)
|
||||
self.results = Results()
|
||||
self.results = Results() # ty:ignore[missing-typed-dict-key]
|
||||
self.results["hide_skipped"] = hide_skipped
|
||||
|
||||
def report(self) -> Results:
|
||||
@@ -410,7 +426,7 @@ class Json(Reporter):
|
||||
"id": e.id(),
|
||||
"global_id": getattr(e, "GlobalId", None),
|
||||
"tag": getattr(e, "Tag", None),
|
||||
}
|
||||
} # ty:ignore[missing-typed-dict-key]
|
||||
)
|
||||
for e in specification.applicable_entities
|
||||
]
|
||||
@@ -428,7 +444,7 @@ class Json(Reporter):
|
||||
"id": e.id(),
|
||||
"global_id": getattr(e, "GlobalId", None),
|
||||
"tag": getattr(e, "Tag", None),
|
||||
}
|
||||
} # ty:ignore[missing-typed-dict-key]
|
||||
)
|
||||
for e in requirement.passed_entities
|
||||
]
|
||||
|
||||
@@ -15,7 +15,17 @@ classifiers = [
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
|
||||
]
|
||||
dependencies = ["ifcopenshell", "python-dateutil", "xmlschema", "numpy", "odfpy", "pystache", "bcf-client", "flask"]
|
||||
dependencies = [
|
||||
"ifcopenshell",
|
||||
"python-dateutil",
|
||||
"xmlschema",
|
||||
"numpy",
|
||||
"odfpy",
|
||||
"pystache",
|
||||
"bcf-client",
|
||||
"flask",
|
||||
"typing_extensions",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
advanced = [
|
||||
|
||||
@@ -630,29 +630,33 @@ struct ShapeRTTI : public boost::static_visitor<PyObject*>
|
||||
// I couldn't get the vector<string> typemap to be applied when %extending Iterator constructor.
|
||||
// anyway it does not matter as SWIG generates C code without actual constructors
|
||||
%inline %{
|
||||
IfcGeom::Iterator* construct_iterator(const std::string& geometry_library, ifcopenshell::geometry::Settings settings, IfcParse::IfcFile* file, int num_threads, Logger& logger = Logger::Root()) {
|
||||
return new IfcGeom::Iterator(ifcopenshell::geometry::kernels::construct(file, geometry_library, settings, logger), settings, file, num_threads, logger);
|
||||
IfcGeom::Iterator* construct_iterator(const std::string& geometry_library, ifcopenshell::geometry::Settings settings, IfcParse::IfcFile* file, int num_threads, Logger* logger = nullptr) {
|
||||
Logger& logger_ = logger_or_root(logger);
|
||||
return new IfcGeom::Iterator(ifcopenshell::geometry::kernels::construct(file, geometry_library, settings, logger_), settings, file, num_threads, logger_);
|
||||
}
|
||||
|
||||
IfcGeom::Iterator* construct_iterator_with_include_exclude(const std::string& geometry_library, ifcopenshell::geometry::Settings settings, IfcParse::IfcFile* file, std::vector<std::string> elems, bool include, int num_threads, Logger& logger = Logger::Root()) {
|
||||
IfcGeom::Iterator* construct_iterator_with_include_exclude(const std::string& geometry_library, ifcopenshell::geometry::Settings settings, IfcParse::IfcFile* file, std::vector<std::string> elems, bool include, int num_threads, Logger* logger = nullptr) {
|
||||
Logger& logger_ = logger_or_root(logger);
|
||||
std::set<std::string> elems_set(elems.begin(), elems.end());
|
||||
IfcGeom::entity_filter ef{ include, false, elems_set };
|
||||
return new IfcGeom::Iterator(ifcopenshell::geometry::kernels::construct(file, geometry_library, settings, logger), settings, file, {ef}, num_threads, logger);
|
||||
return new IfcGeom::Iterator(ifcopenshell::geometry::kernels::construct(file, geometry_library, settings, logger_), settings, file, {ef}, num_threads, logger_);
|
||||
}
|
||||
|
||||
IfcGeom::Iterator* construct_iterator_with_include_exclude_globalid(const std::string& geometry_library, ifcopenshell::geometry::Settings settings, IfcParse::IfcFile* file, std::vector<std::string> elems, bool include, int num_threads, Logger& logger = Logger::Root()) {
|
||||
IfcGeom::Iterator* construct_iterator_with_include_exclude_globalid(const std::string& geometry_library, ifcopenshell::geometry::Settings settings, IfcParse::IfcFile* file, std::vector<std::string> elems, bool include, int num_threads, Logger* logger = nullptr) {
|
||||
Logger& logger_ = logger_or_root(logger);
|
||||
std::set<std::string> elems_set(elems.begin(), elems.end());
|
||||
IfcGeom::attribute_filter af;
|
||||
af.attribute_name = "GlobalId";
|
||||
af.populate(elems_set);
|
||||
af.include = include;
|
||||
return new IfcGeom::Iterator(ifcopenshell::geometry::kernels::construct(file, geometry_library, settings, logger), settings, file, {af}, num_threads, logger);
|
||||
return new IfcGeom::Iterator(ifcopenshell::geometry::kernels::construct(file, geometry_library, settings, logger_), settings, file, {af}, num_threads, logger_);
|
||||
}
|
||||
|
||||
IfcGeom::Iterator* construct_iterator_with_include_exclude_id(const std::string& geometry_library, ifcopenshell::geometry::Settings settings, IfcParse::IfcFile* file, std::vector<int> elems, bool include, int num_threads, Logger& logger = Logger::Root()) {
|
||||
IfcGeom::Iterator* construct_iterator_with_include_exclude_id(const std::string& geometry_library, ifcopenshell::geometry::Settings settings, IfcParse::IfcFile* file, std::vector<int> elems, bool include, int num_threads, Logger* logger = nullptr) {
|
||||
Logger& logger_ = logger_or_root(logger);
|
||||
std::set<int> elems_set(elems.begin(), elems.end());
|
||||
IfcGeom::instance_id_filter af(include, false, elems_set);
|
||||
return new IfcGeom::Iterator(ifcopenshell::geometry::kernels::construct(file, geometry_library, settings, logger), settings, file, {af}, num_threads, logger);
|
||||
return new IfcGeom::Iterator(ifcopenshell::geometry::kernels::construct(file, geometry_library, settings, logger_), settings, file, {af}, num_threads, logger_);
|
||||
}
|
||||
%}
|
||||
|
||||
@@ -1162,6 +1166,7 @@ ifcopenshell::geometry::taxonomy::item::ptr try_upcast(PyObject* obj0, swig_type
|
||||
%ignore svgfill::svg_to_polygons;
|
||||
%ignore svgfill::arrange_polygons;
|
||||
%ignore svgfill::abstract_arrangement;
|
||||
%ignore svgfill::context::delete_same_facet_edge_pairs;
|
||||
|
||||
%template(svg_line_segments) std::vector<std::array<svgfill::point_2, 2>>;
|
||||
%template(svg_groups_of_line_segments) std::vector<std::vector<std::array<svgfill::point_2, 2>>>;
|
||||
@@ -1295,9 +1300,9 @@ ifcopenshell::geometry::taxonomy::item::ptr try_upcast(PyObject* obj0, swig_type
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<svgfill::polygon_2> arrange_polygons(svgfill::arrange_polygon_settings settings, const std::vector<svgfill::polygon_2>& polygons, Logger& logger = Logger::Root()) {
|
||||
std::vector<svgfill::polygon_2> arrange_polygons(svgfill::arrange_polygon_settings settings, const std::vector<svgfill::polygon_2>& polygons, Logger* logger = nullptr) {
|
||||
std::vector<svgfill::polygon_2> r;
|
||||
if (svgfill::arrange_polygons(settings, polygons, r, logger)) {
|
||||
if (svgfill::arrange_polygons(settings, polygons, r, logger_or_root(logger))) {
|
||||
return r;
|
||||
} else {
|
||||
throw std::runtime_error("Failed to arrange polygons");
|
||||
|
||||
@@ -752,10 +752,10 @@ private:
|
||||
%newobject stream_from_string;
|
||||
|
||||
%inline %{
|
||||
IfcParse::IfcFile* open(const std::string& fn, bool readonly=false, Logger& logger=Logger::Root()) {
|
||||
IfcParse::IfcFile* open(const std::string& fn, bool readonly=false, Logger* logger=nullptr) {
|
||||
IfcParse::IfcFile* f;
|
||||
Py_BEGIN_ALLOW_THREADS;
|
||||
f = new IfcParse::IfcFile(fn, IfcParse::FT_AUTODETECT, readonly, logger);
|
||||
f = new IfcParse::IfcFile(fn, IfcParse::FT_AUTODETECT, readonly, logger_or_root(logger));
|
||||
Py_END_ALLOW_THREADS;
|
||||
return f;
|
||||
}
|
||||
|
||||
@@ -219,8 +219,8 @@ private:
|
||||
std::string unit_name;
|
||||
float unit_magnitude;
|
||||
public:
|
||||
ColladaSerializer(const std::string& dae_filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, Logger& logger = Logger::Root())
|
||||
: WriteOnlyGeometrySerializer(geometry_settings, settings, logger)
|
||||
ColladaSerializer(const std::string& dae_filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, Logger* logger = nullptr)
|
||||
: WriteOnlyGeometrySerializer(geometry_settings, settings, logger_or_root(logger))
|
||||
, exporter("IfcOpenShell", dae_filename, this, settings.get<ifcopenshell::geometry::settings::FloatingPointDigits>().get() >= 15)
|
||||
{
|
||||
exporter.serializer = this;
|
||||
|
||||
@@ -53,8 +53,8 @@ static const uint32_t PRIM_TRIANGLE_FAN = 6;
|
||||
static const uint32_t ELEMENT_ARRAY_BUFFER = 34963;
|
||||
static const uint32_t ARRAY_BUFFER = 34962;
|
||||
|
||||
GltfSerializer::GltfSerializer(const std::string& filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, Logger& logger)
|
||||
: WriteOnlyGeometrySerializer(geometry_settings, settings, logger)
|
||||
GltfSerializer::GltfSerializer(const std::string& filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, Logger* logger)
|
||||
: WriteOnlyGeometrySerializer(geometry_settings, settings, logger_or_root(logger))
|
||||
, filename_(filename)
|
||||
, tmp_filename1_(filename + ".indices.tmp")
|
||||
, tmp_filename2_(filename + ".vertices.tmp")
|
||||
|
||||
@@ -43,7 +43,7 @@ private:
|
||||
|
||||
int writeMaterial(const ifcopenshell::geometry::taxonomy::style::ptr style);
|
||||
public:
|
||||
GltfSerializer(const std::string& filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, Logger& logger = Logger::Root());
|
||||
GltfSerializer(const std::string& filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, Logger* logger = nullptr);
|
||||
virtual ~GltfSerializer();
|
||||
bool ready();
|
||||
void writeHeader();
|
||||
|
||||
@@ -55,8 +55,8 @@ herr_t print_stack(hid_t /*estack*/, void*) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
HdfSerializer::HdfSerializer(const std::string& hdf_filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, bool read_only, Logger& logger)
|
||||
: GeometrySerializer(geometry_settings, settings, logger)
|
||||
HdfSerializer::HdfSerializer(const std::string& hdf_filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, bool read_only, Logger* logger)
|
||||
: GeometrySerializer(geometry_settings, settings, logger_or_root(logger))
|
||||
, hdf_filename(hdf_filename)
|
||||
, settings_(settings)
|
||||
{
|
||||
|
||||
@@ -96,7 +96,7 @@ private:
|
||||
void write_style(surface_style_serialization& data, const ifcopenshell::geometry::taxonomy::style::ptr& s);
|
||||
|
||||
public:
|
||||
HdfSerializer(const std::string& hdf_filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, bool read_only=false, Logger& logger = Logger::Root());
|
||||
HdfSerializer(const std::string& hdf_filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, bool read_only=false, Logger* logger = nullptr);
|
||||
virtual ~HdfSerializer() {}
|
||||
bool ready();
|
||||
void writeHeader();
|
||||
|
||||
@@ -596,8 +596,8 @@ protected:
|
||||
subtract_before_project subtraction_settings_;
|
||||
|
||||
public:
|
||||
SvgSerializer(const stream_or_filename& out_filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, Logger& logger = Logger::Root())
|
||||
: WriteOnlyGeometrySerializer(geometry_settings, settings, logger)
|
||||
SvgSerializer(const stream_or_filename& out_filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, Logger* logger = nullptr)
|
||||
: WriteOnlyGeometrySerializer(geometry_settings, settings, logger_or_root(logger))
|
||||
, svg_file(out_filename)
|
||||
, xmin(+std::numeric_limits<double>::infinity())
|
||||
, ymin(+std::numeric_limits<double>::infinity())
|
||||
|
||||
@@ -233,8 +233,8 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
TtlWktSerializer::TtlWktSerializer(const stream_or_filename& filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, Logger& logger)
|
||||
: WriteOnlyGeometrySerializer(geometry_settings, settings, logger)
|
||||
TtlWktSerializer::TtlWktSerializer(const stream_or_filename& filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, Logger* logger)
|
||||
: WriteOnlyGeometrySerializer(geometry_settings, settings, logger_or_root(logger))
|
||||
, filename_(filename)
|
||||
{
|
||||
const auto& tri_setting = geometry_settings.get<ifcopenshell::geometry::settings::TriangulationType>().get();
|
||||
|
||||
@@ -32,7 +32,7 @@ class SERIALIZERS_API TtlWktSerializer : public WriteOnlyGeometrySerializer {
|
||||
private:
|
||||
stream_or_filename filename_;
|
||||
public:
|
||||
TtlWktSerializer(const stream_or_filename& filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, Logger& logger = Logger::Root());
|
||||
TtlWktSerializer(const stream_or_filename& filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, Logger* logger = nullptr);
|
||||
virtual ~TtlWktSerializer() {}
|
||||
bool ready();
|
||||
void writeHeader();
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <iomanip>
|
||||
|
||||
WaveFrontOBJSerializer::WaveFrontOBJSerializer(const stream_or_filename& obj_filename, const stream_or_filename& mtl_filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, Logger& logger)
|
||||
: WriteOnlyGeometrySerializer(geometry_settings, settings, logger)
|
||||
WaveFrontOBJSerializer::WaveFrontOBJSerializer(const stream_or_filename& obj_filename, const stream_or_filename& mtl_filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, Logger* logger)
|
||||
: WriteOnlyGeometrySerializer(geometry_settings, settings, logger_or_root(logger))
|
||||
, obj_stream(obj_filename)
|
||||
, mtl_stream(mtl_filename)
|
||||
, vcount_total(1)
|
||||
|
||||
@@ -35,7 +35,7 @@ private:
|
||||
size_t vcount_total, ncount_total;
|
||||
std::set<std::string> materials;
|
||||
public:
|
||||
WaveFrontOBJSerializer(const stream_or_filename& obj_filename, const stream_or_filename& mtl_filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, Logger& logger = Logger::Root());
|
||||
WaveFrontOBJSerializer(const stream_or_filename& obj_filename, const stream_or_filename& mtl_filename, const ifcopenshell::geometry::Settings& geometry_settings, const ifcopenshell::geometry::SerializerSettings& settings, Logger* logger = nullptr);
|
||||
virtual ~WaveFrontOBJSerializer() {}
|
||||
bool ready();
|
||||
void writeHeader();
|
||||
|
||||
@@ -31,8 +31,8 @@ XmlSerializer* XmlSerializerFactory::Factory::construct(const std::string& schem
|
||||
return it->second(file, xml_filename, logger);
|
||||
}
|
||||
|
||||
XmlSerializer::XmlSerializer(IfcParse::IfcFile* file, const std::string& xml_filename, Logger& logger)
|
||||
: Serializer(logger) {
|
||||
XmlSerializer::XmlSerializer(IfcParse::IfcFile* file, const std::string& xml_filename, Logger* logger)
|
||||
: Serializer(logger_or_root(logger)) {
|
||||
if (file) {
|
||||
implementation_ = XmlSerializerFactory::implementations().construct(file->schema()->name(), file, xml_filename, logger_);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ protected:
|
||||
std::string xml_filename;
|
||||
|
||||
public:
|
||||
XmlSerializer(IfcParse::IfcFile* file, const std::string& xml_filename, Logger& logger = Logger::Root());
|
||||
XmlSerializer(IfcParse::IfcFile* file, const std::string& xml_filename, Logger* logger = nullptr);
|
||||
|
||||
virtual ~XmlSerializer() {}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user