expressir 1.2.11-aarch64-linux → 2.4.29-aarch64-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.cargo/config.toml +3 -0
- data/.github/scripts/test_installed_gem.rb +34 -0
- data/.github/workflows/codeql.yml +35 -0
- data/.github/workflows/docs.yml +99 -0
- data/.github/workflows/links.yml +100 -0
- data/.github/workflows/native-gems.yml +201 -0
- data/.github/workflows/rake.yml +10 -296
- data/.github/workflows/release.yml +26 -114
- data/.github/workflows/rust-ext.yml +41 -0
- data/.github/workflows/stress.yml +36 -0
- data/.github/workflows/validate_schemas.yml +48 -0
- data/.github/workflows/verify_remarks.yml +33 -0
- data/.gitignore +33 -1
- data/.rubocop.yml +11 -11
- data/.rubocop_todo.yml +297 -0
- data/CHANGELOG.md +159 -0
- data/Gemfile +15 -1
- data/README.adoc +2675 -47
- data/Rakefile +34 -10
- data/TODO.bugs/01-stale-transformer-autoload.md +39 -0
- data/TODO.bugs/02-parser-class-instance-vars.md +36 -0
- data/TODO.bugs/03-builder-mutable-state.md +43 -0
- data/TODO.bugs/04-formatter-public-send-dispatch.md +53 -0
- data/TODO.bugs/05-anonymous-formatter-subclass.md +45 -0
- data/TODO.bugs/06-collection-registry-single-source.md +53 -0
- data/TODO.bugs/07-require-relative-cleanup.md +42 -0
- data/TODO.bugs/08-require-expressir-in-commands.md +34 -0
- data/TODO.bugs/09-parser-split.md +53 -0
- data/TODO.bugs/10-to-s-override.md +42 -0
- data/TODO.bugs/11-parser-class-variables.md +39 -0
- data/TODO.bugs/12-marker-modules-vs-registry.md +64 -0
- data/TODO.bugs/13-string-literal-scanner-limitation.md +52 -0
- data/TODO.bugs/14-model-formatting-leak.md +30 -0
- data/TODO.bugs/15-expression-children-macro.md +27 -0
- data/TODO.bugs/16-pretty-formatter-duplication.md +28 -0
- data/TODO.bugs/17-snake-case-cache-mutable-constant.md +28 -0
- data/TODO.bugs/18-const-get-private-constants.md +30 -0
- data/TODO.bugs/19-format-methods-public.md +22 -0
- data/TODO.bugs/20-coverage-nested-entities-dedup.md +20 -0
- data/TODO.bugs/21-operator-tokens-secondary-dispatch.md +21 -0
- data/TODO.bugs/22-builder-fast-path-wrappers.md +32 -0
- data/TODO.bugs/23-coverage-inverse-maps.md +21 -0
- data/TODO.bugs/24-streaming-builder-complexity.md +19 -0
- data/TODO.bugs/25-debug-puts-in-production.md +21 -0
- data/TODO.bugs/26-generic-entity-children-misplaced.md +21 -0
- data/TODO.bugs/27-package-build-god-method.md +19 -0
- data/TODO.bugs/28-package-god-class.md +30 -0
- data/TODO.bugs/29-validate-ascii-god-class.md +24 -0
- data/TODO.bugs/30-unicode-map-extraction.md +19 -0
- data/TODO.bugs/README.md +43 -0
- data/TODO.max-perf/01-restore-ci-green.md +36 -0
- data/TODO.max-perf/02-streaming-parse-path.md +31 -0
- data/TODO.max-perf/03-cli-parallel-opt-in.md +27 -0
- data/TODO.max-perf/04-benchmark-harness.md +28 -0
- data/TODO.max-perf/05-parallel-fidelity-specs.md +22 -0
- data/TODO.max-perf/06-builder-cpu-audit.md +41 -0
- data/TODO.max-perf/07-upstream-parsanol-roadmap.md +27 -0
- data/TODO.max-perf/08-builder-build-perf.md +45 -0
- data/TODO.max-perf/09-grammar-cold-start.md +25 -0
- data/TODO.max-perf/10-parser-facade-hygiene.md +23 -0
- data/TODO.max-perf/11-ci-green-closeout.md +25 -0
- data/TODO.max-perf/12-require-boot-profile.md +25 -0
- data/TODO.max-perf/13-key-conversion-specs.md +26 -0
- data/TODO.max-perf/14-builder-call-handler-audit.md +28 -0
- data/TODO.parity-ee/00-overview.md +76 -0
- data/TODO.parity-ee/01-annex-g-rule-extraction.md +41 -0
- data/TODO.parity-ee/02-eeng-algorithm-inventory.md +8 -0
- data/TODO.parity-ee/03-eeng-oracle-harness.md +33 -0
- data/TODO.parity-ee/04-shtolo-concatenate.md +44 -0
- data/TODO.parity-ee/05-shtolo-longform-flatten.md +53 -0
- data/TODO.parity-ee/06-interface-scheduling-parity.md +47 -0
- data/TODO.parity-ee/07-semantic-checks-port.md +35 -0
- data/TODO.parity-ee/08-pretty-roundtrip-gate.md +27 -0
- data/TODO.parity-ee/09-smrl-index-and-listing.md +22 -0
- data/TODO.parity-ee/10-interface-dot-graph.md +21 -0
- data/TODO.parity-ee/11-import-eeng-tests.md +79 -0
- data/TODO.parity-ee/12-full-check-catalog.md +67 -0
- data/TODO.parity-ee/13-population-p21.md +54 -0
- data/TODO.parity-ee/14-shtolo-completion.md +44 -0
- data/TODO.parity-ee/15-part28-xml.md +51 -0
- data/TODO.parity-ee/16-compare-patch.md +48 -0
- data/TODO.parity-ee/17-official-tests.md +42 -0
- data/TODO.parity-ee/18-mim-mapping.md +47 -0
- data/TODO.parity-ee/19-architecture.md +97 -0
- data/TODO.parity-ee/parity-matrix.md +108 -0
- data/TODO.refpath-v2/00-overview.md +64 -0
- data/TODO.suma-improvements/00-overview.md +23 -0
- data/TODO.suma-improvements/01-prebuilt-platform-gems.md +33 -0
- data/TODO.suma-improvements/02-suma-e2e.md +39 -0
- data/TODO.suma-improvements/03-item-graph.md +22 -0
- data/TODO.suma-improvements/04-compiled-set-default.md +16 -0
- data/TODO.suma-improvements/05-validation-in-docs.md +17 -0
- data/TODO.suma-improvements/06-memory-remeasure.md +36 -0
- data/TODO.suma-improvements/07-part28-xml.md +15 -0
- data/TODO.suma-improvements/08-windows-gnu-toolchain.md +15 -0
- data/TODO.suma-improvements/09-checker-tranche3.md +13 -0
- data/TODO.suma-improvements/10-expressdoc.md +8 -0
- data/benchmark/srl_benchmark.rb +458 -0
- data/benchmark/srl_native_benchmark.rb +146 -0
- data/benchmark/srl_ruby_benchmark.rb +132 -0
- data/bin/rspec +2 -1
- data/docs/Gemfile +12 -0
- data/docs/_config.yml +141 -0
- data/docs/_guides/changes/changes-format.adoc +778 -0
- data/docs/_guides/changes/importing-eengine.adoc +898 -0
- data/docs/_guides/changes/index.adoc +396 -0
- data/docs/_guides/changes/programmatic-usage.adoc +1038 -0
- data/docs/_guides/changes/validating-changes.adoc +681 -0
- data/docs/_guides/cli/benchmark-performance.adoc +834 -0
- data/docs/_guides/cli/coverage-analysis.adoc +921 -0
- data/docs/_guides/cli/format-schemas.adoc +547 -0
- data/docs/_guides/cli/index.adoc +8 -0
- data/docs/_guides/cli/managing-changes.adoc +927 -0
- data/docs/_guides/cli/validate-ascii.adoc +645 -0
- data/docs/_guides/cli/validate-schemas.adoc +534 -0
- data/docs/_guides/formatter/formatter-architecture.adoc +401 -0
- data/docs/_guides/index.adoc +165 -0
- data/docs/_guides/ler/creating-packages.adoc +664 -0
- data/docs/_guides/ler/index.adoc +305 -0
- data/docs/_guides/ler/loading-packages.adoc +707 -0
- data/docs/_guides/ler/package-formats.adoc +748 -0
- data/docs/_guides/ler/querying-packages.adoc +826 -0
- data/docs/_guides/ler/step-packages.adoc +385 -0
- data/docs/_guides/ler/validating-packages.adoc +750 -0
- data/docs/_guides/liquid/basic-templates.adoc +813 -0
- data/docs/_guides/liquid/documentation-generation.adoc +1042 -0
- data/docs/_guides/liquid/drops-reference.adoc +829 -0
- data/docs/_guides/liquid/filters-and-tags.adoc +912 -0
- data/docs/_guides/liquid/index.adoc +468 -0
- data/docs/_guides/manifests/creating-manifests.adoc +483 -0
- data/docs/_guides/manifests/index.adoc +307 -0
- data/docs/_guides/manifests/resolving-manifests.adoc +557 -0
- data/docs/_guides/manifests/validating-manifests.adoc +713 -0
- data/docs/_guides/ruby-api/formatting-schemas.adoc +605 -0
- data/docs/_guides/ruby-api/index.adoc +257 -0
- data/docs/_guides/ruby-api/parsing-files.adoc +421 -0
- data/docs/_guides/ruby-api/search-engine.adoc +609 -0
- data/docs/_guides/ruby-api/working-with-repository.adoc +577 -0
- data/docs/_pages/data-model.adoc +665 -0
- data/docs/_pages/express-language.adoc +506 -0
- data/docs/_pages/getting-started.adoc +414 -0
- data/docs/_pages/index.adoc +116 -0
- data/docs/_pages/introduction.adoc +256 -0
- data/docs/_pages/ler-packages.adoc +837 -0
- data/docs/_pages/parsers.adoc +709 -0
- data/docs/_pages/schema-manifests.adoc +431 -0
- data/docs/_references/index.adoc +228 -0
- data/docs/_tutorials/creating-ler-package.adoc +735 -0
- data/docs/_tutorials/documentation-coverage.adoc +795 -0
- data/docs/_tutorials/formatting-schemas.adoc +89 -0
- data/docs/_tutorials/index.adoc +231 -0
- data/docs/_tutorials/liquid-templates.adoc +806 -0
- data/docs/_tutorials/parsing-your-first-schema.adoc +522 -0
- data/docs/_tutorials/querying-schemas.adoc +751 -0
- data/docs/_tutorials/working-with-multiple-schemas.adoc +676 -0
- data/docs/index.adoc +242 -0
- data/docs/lychee.toml +90 -0
- data/examples/demo_ler_usage.sh +86 -0
- data/examples/ler/README.md +111 -0
- data/examples/ler/simple_example.ler +0 -0
- data/examples/ler/simple_schema.exp +33 -0
- data/examples/ler_build.rb +75 -0
- data/examples/ler_cli.rb +79 -0
- data/examples/ler_demo_complete.rb +276 -0
- data/examples/ler_query.rb +91 -0
- data/examples/ler_query_examples.rb +305 -0
- data/examples/ler_stats.rb +81 -0
- data/examples/phase3_demo.rb +159 -0
- data/examples/query_demo_simple.rb +131 -0
- data/exe/expressir +6 -17
- data/exe/expressir-format +14 -0
- data/exe/{format-test → expressir-format-test} +8 -7
- data/expressir.gemspec +50 -37
- data/lib/expressir/3.2/expressir_core.so +0 -0
- data/lib/expressir/3.3/expressir_core.so +0 -0
- data/lib/expressir/3.4/expressir_core.so +0 -0
- data/lib/expressir/4.0/expressir_core.so +0 -0
- data/lib/expressir/benchmark.rb +310 -0
- data/lib/expressir/changes/item_change.rb +20 -0
- data/lib/expressir/changes/mapping_change.rb +16 -0
- data/lib/expressir/changes/schema_change.rb +85 -0
- data/lib/expressir/changes/version_change.rb +26 -0
- data/lib/expressir/changes.rb +9 -0
- data/lib/expressir/cli.rb +138 -11
- data/lib/expressir/commands/base.rb +25 -0
- data/lib/expressir/commands/benchmark.rb +59 -0
- data/lib/expressir/commands/benchmark_cache.rb +80 -0
- data/lib/expressir/commands/changes.rb +34 -0
- data/lib/expressir/commands/changes_import_eengine.rb +146 -0
- data/lib/expressir/commands/changes_validate.rb +63 -0
- data/lib/expressir/commands/check.rb +56 -0
- data/lib/expressir/commands/clean.rb +20 -0
- data/lib/expressir/commands/coverage.rb +458 -0
- data/lib/expressir/commands/expand.rb +26 -0
- data/lib/expressir/commands/file_violations.rb +70 -0
- data/lib/expressir/commands/fix.rb +33 -0
- data/lib/expressir/commands/flatten.rb +29 -0
- data/lib/expressir/commands/format.rb +43 -0
- data/lib/expressir/commands/manifest.rb +420 -0
- data/lib/expressir/commands/mapping_validate.rb +68 -0
- data/lib/expressir/commands/non_ascii_character.rb +49 -0
- data/lib/expressir/commands/non_ascii_violation_collection.rb +301 -0
- data/lib/expressir/commands/package.rb +1222 -0
- data/lib/expressir/commands/parity_inputs.rb +160 -0
- data/lib/expressir/commands/validate.rb +106 -0
- data/lib/expressir/commands/validate_ascii.rb +94 -0
- data/lib/expressir/commands/validate_load.rb +91 -0
- data/lib/expressir/commands/version.rb +9 -0
- data/lib/expressir/commands/xsd.rb +23 -0
- data/lib/expressir/commands.rb +30 -0
- data/lib/expressir/config.rb +40 -3
- data/lib/expressir/coverage.rb +510 -0
- data/lib/expressir/eengine/arm_compare_report.rb +23 -0
- data/lib/expressir/eengine/changes_section.rb +16 -0
- data/lib/expressir/eengine/compare_report.rb +69 -0
- data/lib/expressir/eengine/mim_compare_report.rb +23 -0
- data/lib/expressir/eengine/modified_object.rb +21 -0
- data/lib/expressir/eengine.rb +9 -0
- data/lib/expressir/errors.rb +113 -0
- data/lib/expressir/express/adoc_hyperlink_formatter.rb +30 -0
- data/lib/expressir/express/adoc_source_formatter.rb +12 -0
- data/lib/expressir/express/ast_key_converter.rb +114 -0
- data/lib/expressir/express/builder.rb +277 -0
- data/lib/expressir/express/builder_context.rb +22 -0
- data/lib/expressir/express/builder_registry.rb +397 -0
- data/lib/expressir/express/builders/attribute_decl_builder.rb +32 -0
- data/lib/expressir/express/builders/built_in_builder.rb +75 -0
- data/lib/expressir/express/builders/constant_builder.rb +108 -0
- data/lib/expressir/express/builders/declaration_builder.rb +20 -0
- data/lib/expressir/express/builders/derive_clause_builder.rb +14 -0
- data/lib/expressir/express/builders/derived_attr_builder.rb +28 -0
- data/lib/expressir/express/builders/domain_rule_builder.rb +21 -0
- data/lib/expressir/express/builders/entity_decl_builder.rb +116 -0
- data/lib/expressir/express/builders/explicit_attr_builder.rb +49 -0
- data/lib/expressir/express/builders/expression_builder.rb +416 -0
- data/lib/expressir/express/builders/function_decl_builder.rb +86 -0
- data/lib/expressir/express/builders/helpers.rb +148 -0
- data/lib/expressir/express/builders/interface_builder.rb +151 -0
- data/lib/expressir/express/builders/inverse_attr_builder.rb +43 -0
- data/lib/expressir/express/builders/inverse_attr_type_builder.rb +30 -0
- data/lib/expressir/express/builders/inverse_clause_builder.rb +14 -0
- data/lib/expressir/express/builders/literal_builder.rb +93 -0
- data/lib/expressir/express/builders/procedure_decl_builder.rb +82 -0
- data/lib/expressir/express/builders/qualifier_builder.rb +102 -0
- data/lib/expressir/express/builders/reference_builder.rb +18 -0
- data/lib/expressir/express/builders/rule_decl_builder.rb +97 -0
- data/lib/expressir/express/builders/schema_body_decl_builder.rb +18 -0
- data/lib/expressir/express/builders/schema_decl_builder.rb +56 -0
- data/lib/expressir/express/builders/schema_version_builder.rb +34 -0
- data/lib/expressir/express/builders/simple_id_builder.rb +17 -0
- data/lib/expressir/express/builders/statement_builder.rb +243 -0
- data/lib/expressir/express/builders/subtype_constraint_builder.rb +166 -0
- data/lib/expressir/express/builders/syntax_builder.rb +30 -0
- data/lib/expressir/express/builders/type_builder.rb +238 -0
- data/lib/expressir/express/builders/type_decl_builder.rb +26 -0
- data/lib/expressir/express/builders/unique_clause_builder.rb +20 -0
- data/lib/expressir/express/builders/unique_rule_builder.rb +41 -0
- data/lib/expressir/express/builders/where_clause_builder.rb +20 -0
- data/lib/expressir/express/builders.rb +55 -0
- data/lib/expressir/express/cache.rb +43 -18
- data/lib/expressir/express/checker.rb +812 -0
- data/lib/expressir/express/concatenator.rb +79 -0
- data/lib/expressir/express/core.rb +95 -0
- data/lib/expressir/express/error.rb +124 -0
- data/lib/expressir/express/formatter.rb +89 -1548
- data/lib/expressir/express/formatters/data_types_formatter.rb +362 -0
- data/lib/expressir/express/formatters/declarations_formatter.rb +753 -0
- data/lib/expressir/express/formatters/expressions_formatter.rb +180 -0
- data/lib/expressir/express/formatters/literals_formatter.rb +55 -0
- data/lib/expressir/express/formatters/references_formatter.rb +53 -0
- data/lib/expressir/express/formatters/remark_formatter.rb +270 -0
- data/lib/expressir/express/formatters/remark_item_formatter.rb +28 -0
- data/lib/expressir/express/formatters/statements_formatter.rb +272 -0
- data/lib/expressir/express/formatters/supertype_expressions_formatter.rb +54 -0
- data/lib/expressir/express/formatters.rb +22 -0
- data/lib/expressir/express/grammar/parser.rb +712 -0
- data/lib/expressir/express/grammar.rb +11 -0
- data/lib/expressir/express/hyperlink_formatter.rb +4 -5
- data/lib/expressir/express/interface_dot.rb +105 -0
- data/lib/expressir/express/lazy_repository.rb +211 -0
- data/lib/expressir/express/line_map.rb +48 -0
- data/lib/expressir/express/listing.rb +174 -0
- data/lib/expressir/express/model_traversal.rb +42 -0
- data/lib/expressir/express/model_visitor.rb +11 -10
- data/lib/expressir/express/node_position_index.rb +342 -0
- data/lib/expressir/express/parallel_files.rb +229 -0
- data/lib/expressir/express/parser.rb +501 -62
- data/lib/expressir/express/pretty_formatter.rb +586 -0
- data/lib/expressir/express/pretty_gate.rb +61 -0
- data/lib/expressir/express/refs_overlay.rb +47 -0
- data/lib/expressir/express/remark_attacher.rb +1098 -0
- data/lib/expressir/express/remark_overlay.rb +86 -0
- data/lib/expressir/express/remark_scanner.rb +245 -0
- data/lib/expressir/express/resolve_references_model_visitor.rb +7 -9
- data/lib/expressir/express/schema_block_scanner.rb +137 -0
- data/lib/expressir/express/schema_head_formatter.rb +4 -5
- data/lib/expressir/express/schema_plain_source_formatter.rb +11 -0
- data/lib/expressir/express/schema_source_formatter.rb +15 -0
- data/lib/expressir/express/scope_resolver.rb +223 -0
- data/lib/expressir/express/self_schema_reference.rb +126 -0
- data/lib/expressir/express/shtolo.rb +679 -0
- data/lib/expressir/express/smrl_xml.rb +125 -0
- data/lib/expressir/express/source_formatter.rb +15 -0
- data/lib/expressir/express/streaming_builder.rb +435 -0
- data/lib/expressir/express/xsd.rb +259 -0
- data/lib/expressir/express.rb +53 -0
- data/lib/expressir/liquid.rb +1 -0
- data/lib/expressir/manifest/resolver.rb +210 -0
- data/lib/expressir/manifest/validator.rb +192 -0
- data/lib/expressir/manifest.rb +6 -0
- data/lib/expressir/mapping/refpath.rb +857 -0
- data/lib/expressir/mapping.rb +253 -0
- data/lib/expressir/model/cache.rb +10 -9
- data/lib/expressir/model/concerns.rb +42 -0
- data/lib/expressir/model/data_types/aggregate.rb +8 -13
- data/lib/expressir/model/data_types/array.rb +15 -21
- data/lib/expressir/model/data_types/bag.rb +11 -15
- data/lib/expressir/model/data_types/binary.rb +9 -12
- data/lib/expressir/model/data_types/boolean.rb +7 -2
- data/lib/expressir/model/data_types/enumeration.rb +11 -15
- data/lib/expressir/model/data_types/enumeration_item.rb +5 -7
- data/lib/expressir/model/data_types/generic.rb +6 -8
- data/lib/expressir/model/data_types/generic_entity.rb +11 -13
- data/lib/expressir/model/data_types/integer.rb +7 -2
- data/lib/expressir/model/data_types/list.rb +13 -18
- data/lib/expressir/model/data_types/logical.rb +7 -2
- data/lib/expressir/model/data_types/number.rb +7 -2
- data/lib/expressir/model/data_types/real.rb +7 -9
- data/lib/expressir/model/data_types/select.rb +13 -18
- data/lib/expressir/model/data_types/set.rb +11 -15
- data/lib/expressir/model/data_types/string.rb +9 -12
- data/lib/expressir/model/data_types.rb +25 -0
- data/lib/expressir/model/declarations/attribute.rb +19 -28
- data/lib/expressir/model/declarations/constant.rb +10 -16
- data/lib/expressir/model/declarations/derived_attribute.rb +25 -0
- data/lib/expressir/model/declarations/entity.rb +39 -30
- data/lib/expressir/model/declarations/function.rb +32 -40
- data/lib/expressir/model/declarations/informal_proposition_rule.rb +25 -0
- data/lib/expressir/model/declarations/interface.rb +25 -16
- data/lib/expressir/model/declarations/interface_item.rb +9 -11
- data/lib/expressir/model/declarations/interfaced_item.rb +15 -19
- data/lib/expressir/model/declarations/inverse_attribute.rb +25 -0
- data/lib/expressir/model/declarations/parameter.rb +10 -16
- data/lib/expressir/model/declarations/procedure.rb +30 -37
- data/lib/expressir/model/declarations/remark_item.rb +11 -11
- data/lib/expressir/model/declarations/rule.rb +38 -43
- data/lib/expressir/model/declarations/schema.rb +162 -64
- data/lib/expressir/model/declarations/schema_version.rb +8 -11
- data/lib/expressir/model/declarations/schema_version_item.rb +8 -11
- data/lib/expressir/model/declarations/subtype_constraint.rb +14 -22
- data/lib/expressir/model/declarations/type.rb +18 -18
- data/lib/expressir/model/declarations/unique_rule.rb +8 -13
- data/lib/expressir/model/declarations/variable.rb +10 -16
- data/lib/expressir/model/declarations/where_rule.rb +8 -13
- data/lib/expressir/model/declarations.rb +31 -0
- data/lib/expressir/model/dependency_resolver.rb +268 -0
- data/lib/expressir/model/exp_file.rb +42 -0
- data/lib/expressir/model/expressions/aggregate_initializer.rb +8 -9
- data/lib/expressir/model/expressions/aggregate_initializer_item.rb +10 -12
- data/lib/expressir/model/expressions/binary_expression.rb +42 -36
- data/lib/expressir/model/expressions/entity_constructor.rb +10 -12
- data/lib/expressir/model/expressions/function_call.rb +10 -12
- data/lib/expressir/model/expressions/interval.rb +18 -23
- data/lib/expressir/model/expressions/query_expression.rb +11 -15
- data/lib/expressir/model/expressions/unary_expression.rb +13 -15
- data/lib/expressir/model/expressions.rb +18 -0
- data/lib/expressir/model/identifier.rb +18 -26
- data/lib/expressir/model/indexes/entity_index.rb +103 -0
- data/lib/expressir/model/indexes/item_graph.rb +185 -0
- data/lib/expressir/model/indexes/reference_index.rb +148 -0
- data/lib/expressir/model/indexes/type_index.rb +149 -0
- data/lib/expressir/model/indexes.rb +12 -0
- data/lib/expressir/model/interface_validator.rb +384 -0
- data/lib/expressir/model/literals/binary.rb +7 -9
- data/lib/expressir/model/literals/integer.rb +7 -9
- data/lib/expressir/model/literals/logical.rb +10 -12
- data/lib/expressir/model/literals/real.rb +7 -9
- data/lib/expressir/model/literals/string.rb +10 -12
- data/lib/expressir/model/literals.rb +13 -0
- data/lib/expressir/model/model_element.rb +286 -117
- data/lib/expressir/model/references/attribute_reference.rb +9 -12
- data/lib/expressir/model/references/group_reference.rb +9 -12
- data/lib/expressir/model/references/index_reference.rb +11 -15
- data/lib/expressir/model/references/simple_reference.rb +11 -14
- data/lib/expressir/model/references.rb +12 -0
- data/lib/expressir/model/remark_format.rb +17 -0
- data/lib/expressir/model/remark_info.rb +92 -0
- data/lib/expressir/model/remark_placement.rb +42 -0
- data/lib/expressir/model/repository.rb +472 -12
- data/lib/expressir/model/repository_validator.rb +293 -0
- data/lib/expressir/model/search_engine.rb +551 -0
- data/lib/expressir/model/statements/alias.rb +12 -16
- data/lib/expressir/model/statements/assignment.rb +12 -11
- data/lib/expressir/model/statements/case.rb +31 -14
- data/lib/expressir/model/statements/case_action.rb +9 -11
- data/lib/expressir/model/statements/compound.rb +10 -8
- data/lib/expressir/model/statements/escape.rb +10 -2
- data/lib/expressir/model/statements/if.rb +15 -14
- data/lib/expressir/model/statements/null.rb +10 -2
- data/lib/expressir/model/statements/procedure_call.rb +11 -11
- data/lib/expressir/model/statements/repeat.rb +21 -28
- data/lib/expressir/model/statements/return.rb +9 -8
- data/lib/expressir/model/statements/skip.rb +10 -2
- data/lib/expressir/model/statements.rb +20 -0
- data/lib/expressir/model/supertype_expressions/binary_supertype_expression.rb +13 -17
- data/lib/expressir/model/supertype_expressions/oneof_supertype_expression.rb +7 -9
- data/lib/expressir/model/supertype_expressions.rb +12 -0
- data/lib/expressir/model.rb +38 -78
- data/lib/expressir/package/builder.rb +231 -0
- data/lib/expressir/package/metadata.rb +79 -0
- data/lib/expressir/package/reader.rb +149 -0
- data/lib/expressir/package.rb +8 -0
- data/lib/expressir/schema_manifest.rb +159 -0
- data/lib/expressir/schema_manifest_entry.rb +15 -0
- data/lib/expressir/version.rb +6 -1
- data/lib/expressir.rb +79 -9
- data/lib/tasks/verify_remarks.rake +16 -0
- data/rakelib/native.rake +24 -0
- data/rakelib/oracle.rake +52 -0
- data/rakelib/verify_remarks.rake +16 -0
- metadata +431 -129
- data/.cross_rubies +0 -20
- data/.gitmodules +0 -6
- data/.yardopts +0 -11
- data/docs/development.md +0 -90
- data/exe/format +0 -18
- data/exe/generate-parser +0 -51
- data/lib/expressir/cli/ui.rb +0 -36
- data/lib/expressir/express/2.7/express_parser.so +0 -0
- data/lib/expressir/express/3.0/express_parser.so +0 -0
- data/lib/expressir/express/3.1/express_parser.so +0 -0
- data/lib/expressir/express/3.2/express_parser.so +0 -0
- data/lib/expressir/express/visitor.rb +0 -2588
- data/lib/expressir/model/data_type.rb +0 -9
- data/lib/expressir/model/declaration.rb +0 -9
- data/lib/expressir/model/expression.rb +0 -9
- data/lib/expressir/model/literal.rb +0 -9
- data/lib/expressir/model/reference.rb +0 -9
- data/lib/expressir/model/statement.rb +0 -9
- data/lib/expressir/model/supertype_expression.rb +0 -9
- data/rakelib/antlr4-native.rake +0 -161
- data/rakelib/cross-ruby.rake +0 -368
- data/spec/acceptance/version_spec.rb +0 -27
- data/spec/expressir/express/cache_spec.rb +0 -89
- data/spec/expressir/express/formatter_spec.rb +0 -173
- data/spec/expressir/express/parser_spec.rb +0 -141
- data/spec/expressir/model/model_element_spec.rb +0 -318
- data/spec/spec_helper.rb +0 -24
- data/spec/support/console_helper.rb +0 -29
- data/spec/syntax/multiple.exp +0 -23
- data/spec/syntax/multiple.yaml +0 -198
- data/spec/syntax/multiple_formatted.exp +0 -71
- data/spec/syntax/multiple_hyperlink_formatted.exp +0 -71
- data/spec/syntax/multiple_schema_head_hyperlink_formatted.exp +0 -13
- data/spec/syntax/remark.exp +0 -193
- data/spec/syntax/remark.yaml +0 -471
- data/spec/syntax/remark_formatted.exp +0 -228
- data/spec/syntax/single.exp +0 -4
- data/spec/syntax/single.yaml +0 -18
- data/spec/syntax/single_formatted.exp +0 -10
- data/spec/syntax/single_formatted.yaml +0 -36
- data/spec/syntax/syntax.exp +0 -333
- data/spec/syntax/syntax.yaml +0 -3509
- data/spec/syntax/syntax_formatted.exp +0 -902
- data/spec/syntax/syntax_hyperlink_formatted.exp +0 -902
- data/spec/syntax/syntax_schema_head_formatted.exp +0 -18
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
# MIM application-element mapping model (expressir#88,
|
|
5
|
+
# TODO.parity-ee 18): the typed reader for the `mapping.yaml` files
|
|
6
|
+
# each STEP module carries, and validation of the
|
|
7
|
+
# `<<express:SCHEMA.ITEM,ITEM>>` links they contain against a
|
|
8
|
+
# resolved ARM/MIM repository.
|
|
9
|
+
#
|
|
10
|
+
# The model is lutaml-model Serializable — the yaml face is the
|
|
11
|
+
# module corpus format (top-level `ae` + `sc` keys); fields the
|
|
12
|
+
# corpus carries that v1 does not model (alt_map, descriptions)
|
|
13
|
+
# are ignored by the mapping and survive round-trips untouched in
|
|
14
|
+
# the source files.
|
|
15
|
+
module Mapping
|
|
16
|
+
autoload :RefPath, "#{__dir__}/mapping/refpath"
|
|
17
|
+
|
|
18
|
+
EXPRESS_LINK = /<<express:([^,>]+)(?:,([^>]+))?>>/
|
|
19
|
+
|
|
20
|
+
class ReferencePath < Lutaml::Model::Serializable
|
|
21
|
+
attribute :content, :string
|
|
22
|
+
|
|
23
|
+
key_value do
|
|
24
|
+
map "content", to: :content
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
class AttributeMapping < Lutaml::Model::Serializable
|
|
29
|
+
attribute :attribute, :string
|
|
30
|
+
attribute :aimelt, :string
|
|
31
|
+
attribute :inherited_from_entity, :string
|
|
32
|
+
attribute :assertion_to, :string
|
|
33
|
+
attribute :refpath, ReferencePath
|
|
34
|
+
|
|
35
|
+
key_value do
|
|
36
|
+
map "attribute", to: :attribute
|
|
37
|
+
map "aimelt", to: :aimelt
|
|
38
|
+
map "inherited_from_entity", to: :inherited_from_entity
|
|
39
|
+
map "assertion_to", to: :assertion_to
|
|
40
|
+
map "refpath", to: :refpath
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# An alternative mapping for an application element (corpus
|
|
45
|
+
# `alt_map:` entries): the same ARM concept mapped through a
|
|
46
|
+
# different MIM route, with its own reference path and rules.
|
|
47
|
+
class AltMap < Lutaml::Model::Serializable
|
|
48
|
+
attribute :id, :string
|
|
49
|
+
attribute :description, ReferencePath
|
|
50
|
+
attribute :aimelt, :string
|
|
51
|
+
attribute :refpath, ReferencePath
|
|
52
|
+
attribute :rules, ReferencePath
|
|
53
|
+
|
|
54
|
+
key_value do
|
|
55
|
+
map "id", to: :id
|
|
56
|
+
map "description", to: :description
|
|
57
|
+
map "aimelt", to: :aimelt
|
|
58
|
+
map "refpath", to: :refpath
|
|
59
|
+
map "rules", to: :rules
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
class ApplicationElement < Lutaml::Model::Serializable
|
|
64
|
+
attribute :entity, :string
|
|
65
|
+
attribute :aimelt, :string
|
|
66
|
+
attribute :extensible, :string
|
|
67
|
+
attribute :original_module, :string
|
|
68
|
+
attribute :refpath, ReferencePath
|
|
69
|
+
attribute :rules, ReferencePath
|
|
70
|
+
attribute :alt_map, AltMap, collection: true
|
|
71
|
+
attribute :aa, AttributeMapping, collection: true
|
|
72
|
+
|
|
73
|
+
key_value do
|
|
74
|
+
map "entity", to: :entity
|
|
75
|
+
map "aimelt", to: :aimelt
|
|
76
|
+
map "extensible", to: :extensible
|
|
77
|
+
map "original_module", to: :original_module
|
|
78
|
+
map "refpath", to: :refpath
|
|
79
|
+
map "rules", to: :rules
|
|
80
|
+
map "alt_map", to: :alt_map
|
|
81
|
+
map "aa", to: :aa
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
class SubtypeConstraintMapping < Lutaml::Model::Serializable
|
|
86
|
+
attribute :constraint, :string
|
|
87
|
+
attribute :entity, :string
|
|
88
|
+
|
|
89
|
+
key_value do
|
|
90
|
+
map "constraint", to: :constraint
|
|
91
|
+
map "entity", to: :entity
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
class Document < Lutaml::Model::Serializable
|
|
96
|
+
attribute :ae, ApplicationElement, collection: true
|
|
97
|
+
attribute :sc, SubtypeConstraintMapping, collection: true
|
|
98
|
+
|
|
99
|
+
key_value do
|
|
100
|
+
map "ae", to: :ae
|
|
101
|
+
map "sc", to: :sc
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
UnknownLink = Struct.new(:text, :schema, :item, keyword_init: true)
|
|
106
|
+
|
|
107
|
+
module_function
|
|
108
|
+
|
|
109
|
+
# @param path [String] path to a module mapping.yaml
|
|
110
|
+
# @return [Document]
|
|
111
|
+
def load_file(path)
|
|
112
|
+
Document.from_yaml(File.read(path))
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Every `<<express:...>>` link in the document, as
|
|
116
|
+
# [schema_id, item_id] pairs (duplicates preserved).
|
|
117
|
+
def links(document)
|
|
118
|
+
values(document).flat_map do |value|
|
|
119
|
+
value.to_s.scan(EXPRESS_LINK).map do |path, _id|
|
|
120
|
+
parts = path.split(".")
|
|
121
|
+
[parts[-2], parts[-1]]
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Links whose schema or item cannot be found in +repository+.
|
|
127
|
+
# A link with no item part resolves against schema presence only.
|
|
128
|
+
def unknown_links(document, repository)
|
|
129
|
+
known = repository.schemas.to_h do |schema|
|
|
130
|
+
[schema.id.safe_downcase, schema]
|
|
131
|
+
end
|
|
132
|
+
links(document).filter_map do |schema_id, item_id|
|
|
133
|
+
schema = known[schema_id&.safe_downcase]
|
|
134
|
+
if schema.nil?
|
|
135
|
+
next UnknownLink.new(text: "#{schema_id}.#{item_id}",
|
|
136
|
+
schema: schema_id, item: item_id)
|
|
137
|
+
end
|
|
138
|
+
next if item_id.nil?
|
|
139
|
+
|
|
140
|
+
unless item_declared?(schema, item_id)
|
|
141
|
+
next UnknownLink.new(text: "#{schema_id}.#{item_id}",
|
|
142
|
+
schema: schema_id, item: item_id)
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
nil
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
def item_declared?(schema, item_id)
|
|
150
|
+
key = item_id.safe_downcase
|
|
151
|
+
%i[types entities functions procedures rules constants
|
|
152
|
+
subtype_constraints].any? do |coll|
|
|
153
|
+
Array(schema.public_send(coll)).any? do |decl|
|
|
154
|
+
decl.respond_to?(:id) && decl.id&.safe_downcase == key
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
def values(document)
|
|
160
|
+
document.ae.to_a.flat_map do |element|
|
|
161
|
+
[element.entity, element.aimelt] +
|
|
162
|
+
element.aa.to_a.flat_map do |aa|
|
|
163
|
+
[aa.attribute, aa.aimelt, aa.assertion_to]
|
|
164
|
+
end +
|
|
165
|
+
element.alt_map.to_a.flat_map do |alt|
|
|
166
|
+
[alt.aimelt, alt.description&.content]
|
|
167
|
+
end
|
|
168
|
+
end.compact + subtype_constraint_values(document)
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Every declaration reference in the sc entries (#460): the
|
|
172
|
+
# constraint name and the entity it constrains.
|
|
173
|
+
def subtype_constraint_values(document)
|
|
174
|
+
document.sc.to_a.flat_map { |sc| [sc.constraint, sc.entity] }.compact
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Every reference path in the document as [location, content]
|
|
178
|
+
# pairs; location names the application element (and attribute,
|
|
179
|
+
# for attribute-level paths) the path belongs to.
|
|
180
|
+
def refpaths(document)
|
|
181
|
+
document.ae.to_a.flat_map do |element|
|
|
182
|
+
entries = []
|
|
183
|
+
if element.refpath&.content
|
|
184
|
+
entries << [element.entity.to_s, element.refpath.content]
|
|
185
|
+
end
|
|
186
|
+
element.aa.to_a.each do |aa|
|
|
187
|
+
next unless aa.refpath&.content
|
|
188
|
+
|
|
189
|
+
entries << ["#{element.entity}.#{aa.attribute}", aa.refpath.content]
|
|
190
|
+
end
|
|
191
|
+
element.alt_map.to_a.each do |alt|
|
|
192
|
+
next unless alt.refpath&.content
|
|
193
|
+
|
|
194
|
+
label = alt.id ? "#{element.entity}[#{alt.id}]" : element.entity.to_s
|
|
195
|
+
entries << [label, alt.refpath.content]
|
|
196
|
+
end
|
|
197
|
+
entries
|
|
198
|
+
end
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Every `rules:` value in the document as [mapped entity, rule
|
|
202
|
+
# name, location label] triples — the rules-list reference
|
|
203
|
+
# position. The mapped entity is the ae entity's declared name
|
|
204
|
+
# (the item of its annotated link).
|
|
205
|
+
def rules_positions(document)
|
|
206
|
+
document.ae.to_a.flat_map do |element|
|
|
207
|
+
entity = entity_item(element.entity)
|
|
208
|
+
positions = []
|
|
209
|
+
if element.rules&.content
|
|
210
|
+
positions << [entity, element.rules.content, element.entity.to_s]
|
|
211
|
+
end
|
|
212
|
+
element.alt_map.to_a.each do |alt|
|
|
213
|
+
next unless alt.rules&.content
|
|
214
|
+
|
|
215
|
+
positions << [entity, alt.rules.content,
|
|
216
|
+
"#{element.entity}[#{alt.id}]"]
|
|
217
|
+
end
|
|
218
|
+
positions
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# The declared item of an annotated link value
|
|
223
|
+
# (<<express:SCHEMA.ITEM,ITEM>> → ITEM; bare value → itself).
|
|
224
|
+
def entity_item(value)
|
|
225
|
+
match = value.to_s.match(EXPRESS_LINK)
|
|
226
|
+
match ? match[2] || match[1].split(".").last : value.to_s
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# ELF 5006 §8 rules-list validation: each named rule must be a
|
|
230
|
+
# global RULE in the repository whose FOR list includes the mapped
|
|
231
|
+
# entity (rule declarations are schema-level).
|
|
232
|
+
def rule_issues(document, repository)
|
|
233
|
+
rules_by_name = repository.schemas.flat_map(&:rules)
|
|
234
|
+
.select { |r| r.respond_to?(:id) && r.id }
|
|
235
|
+
.to_h { |r| [r.id.safe_downcase, r] }
|
|
236
|
+
rules_positions(document).filter_map do |entity, rule, _label|
|
|
237
|
+
decl = rules_by_name[rule.safe_downcase]
|
|
238
|
+
next if decl.nil? == false && entity.nil?
|
|
239
|
+
next if decl && for_list_includes?(decl, entity)
|
|
240
|
+
|
|
241
|
+
UnknownLink.new(text: "#{entity}.#{rule}", schema: entity,
|
|
242
|
+
item: rule)
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
def for_list_includes?(rule_decl, entity)
|
|
247
|
+
Array(rule_decl.applies_to).any? do |ref|
|
|
248
|
+
id = ref.respond_to?(:id) ? ref.id : ref.to_s
|
|
249
|
+
id&.safe_downcase == entity.safe_downcase
|
|
250
|
+
end
|
|
251
|
+
end
|
|
252
|
+
end
|
|
253
|
+
end
|
|
@@ -2,16 +2,17 @@ module Expressir
|
|
|
2
2
|
module Model
|
|
3
3
|
# Cache content object with Expressir version
|
|
4
4
|
class Cache < ModelElement
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
attribute :version, :string
|
|
6
|
+
attribute :root_path, :string
|
|
7
|
+
attribute :content, ModelElement
|
|
8
|
+
attribute :_class, :string, default: -> { self.class.name }
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
@content = options[:content]
|
|
10
|
+
key_value do
|
|
11
|
+
map "_class", to: :_class, render_default: true
|
|
12
|
+
map "version", to: :version
|
|
13
|
+
map "root_path", to: :root_path
|
|
14
|
+
map "content", to: :content
|
|
14
15
|
end
|
|
15
16
|
end
|
|
16
17
|
end
|
|
17
|
-
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Expressir
|
|
4
|
+
module Model
|
|
5
|
+
# Marker for types that have an id attribute
|
|
6
|
+
module HasId; end
|
|
7
|
+
|
|
8
|
+
# Marker for types that can have remark_items children
|
|
9
|
+
# These are types where RemarkItem children can be created
|
|
10
|
+
module HasRemarkItems; end
|
|
11
|
+
|
|
12
|
+
# Marker for types that have a `remarks` string collection
|
|
13
|
+
module HasRemarks; end
|
|
14
|
+
|
|
15
|
+
# Marker for scope containers (can contain declarations)
|
|
16
|
+
# Includes schemas, functions, procedures, rules, entities, types, and files
|
|
17
|
+
module ScopeContainer; end
|
|
18
|
+
|
|
19
|
+
# Marker for types supporting informal propositions
|
|
20
|
+
module HasInformalPropositions; end
|
|
21
|
+
|
|
22
|
+
# Marker for types supporting where rules
|
|
23
|
+
module HasWhereRules; end
|
|
24
|
+
|
|
25
|
+
# Marker for types that can own a remark written after them on the same
|
|
26
|
+
# line, as in `x := 1; -- why`. Includers are ModelElements, so they all
|
|
27
|
+
# carry the `untagged_remarks` collection the remark is stored in.
|
|
28
|
+
#
|
|
29
|
+
# Attachment and formatting must agree on this exactly: a type the
|
|
30
|
+
# attacher marks INLINE but the formatter declines to emit loses the
|
|
31
|
+
# remark with nothing to show for it. Both ask this one question.
|
|
32
|
+
#
|
|
33
|
+
# Not the same question as NodePositionIndex#remark_scope?, which decides
|
|
34
|
+
# who owns a remark on a line of its OWN.
|
|
35
|
+
module TakesInlineRemark; end
|
|
36
|
+
|
|
37
|
+
# Marker for executable statements (ISO 10303-11 section 13)
|
|
38
|
+
module Statement
|
|
39
|
+
include TakesInlineRemark
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -3,29 +3,24 @@ module Expressir
|
|
|
3
3
|
module DataTypes
|
|
4
4
|
# Specified in ISO 10303-11:2004
|
|
5
5
|
# - section 9.5.3.1 Aggregate data type
|
|
6
|
-
class Aggregate <
|
|
6
|
+
class Aggregate < ModelElement
|
|
7
7
|
include Identifier
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
attribute :base_type, ModelElement
|
|
10
|
+
attribute :_class, :string, default: -> { self.class.name }
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def initialize(options = {})
|
|
15
|
-
initialize_identifier(options)
|
|
16
|
-
|
|
17
|
-
@base_type = options[:base_type]
|
|
18
|
-
|
|
19
|
-
super
|
|
12
|
+
key_value do
|
|
13
|
+
map "_class", to: :_class, render_default: true
|
|
14
|
+
map "base_type", to: :base_type
|
|
20
15
|
end
|
|
21
16
|
|
|
22
17
|
# @return [Array<Declaration>]
|
|
23
18
|
def children
|
|
24
19
|
[
|
|
25
|
-
*remark_items
|
|
20
|
+
*remark_items,
|
|
26
21
|
]
|
|
27
22
|
end
|
|
28
23
|
end
|
|
29
24
|
end
|
|
30
25
|
end
|
|
31
|
-
end
|
|
26
|
+
end
|
|
@@ -3,29 +3,23 @@ module Expressir
|
|
|
3
3
|
module DataTypes
|
|
4
4
|
# Specified in ISO 10303-11:2004
|
|
5
5
|
# - section 8.2.1 Array data type
|
|
6
|
-
class Array <
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
class Array < ModelElement
|
|
7
|
+
attribute :bound1, ModelElement
|
|
8
|
+
attribute :bound2, ModelElement
|
|
9
|
+
attribute :optional, :boolean
|
|
10
|
+
attribute :unique, :boolean
|
|
11
|
+
attribute :base_type, ModelElement
|
|
12
|
+
attribute :_class, :string, default: -> { self.class.name }
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
@bound1 = options[:bound1]
|
|
21
|
-
@bound2 = options[:bound2]
|
|
22
|
-
@optional = options[:optional]
|
|
23
|
-
@unique = options[:unique]
|
|
24
|
-
@base_type = options[:base_type]
|
|
25
|
-
|
|
26
|
-
super
|
|
14
|
+
key_value do
|
|
15
|
+
map "_class", to: :_class, render_default: true
|
|
16
|
+
map "bound1", to: :bound1
|
|
17
|
+
map "bound2", to: :bound2
|
|
18
|
+
map "optional", to: :optional
|
|
19
|
+
map "unique", to: :unique
|
|
20
|
+
map "base_type", to: :base_type
|
|
27
21
|
end
|
|
28
22
|
end
|
|
29
23
|
end
|
|
30
24
|
end
|
|
31
|
-
end
|
|
25
|
+
end
|
|
@@ -3,23 +3,19 @@ module Expressir
|
|
|
3
3
|
module DataTypes
|
|
4
4
|
# Specified in ISO 10303-11:2004
|
|
5
5
|
# - section 8.2.3 Bag data type
|
|
6
|
-
class Bag <
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
class Bag < ModelElement
|
|
7
|
+
attribute :bound1, ModelElement
|
|
8
|
+
attribute :bound2, ModelElement
|
|
9
|
+
attribute :base_type, ModelElement
|
|
10
|
+
attribute :_class, :string, default: -> { self.class.name }
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@bound1 = options[:bound1]
|
|
17
|
-
@bound2 = options[:bound2]
|
|
18
|
-
@base_type = options[:base_type]
|
|
19
|
-
|
|
20
|
-
super
|
|
12
|
+
key_value do
|
|
13
|
+
map "_class", to: :_class, render_default: true
|
|
14
|
+
map "bound1", to: :bound1
|
|
15
|
+
map "bound2", to: :bound2
|
|
16
|
+
map "base_type", to: :base_type
|
|
21
17
|
end
|
|
22
18
|
end
|
|
23
19
|
end
|
|
24
20
|
end
|
|
25
|
-
end
|
|
21
|
+
end
|
|
@@ -3,20 +3,17 @@ module Expressir
|
|
|
3
3
|
module DataTypes
|
|
4
4
|
# Specified in ISO 10303-11:2004
|
|
5
5
|
# - section 8.1.7 Binary data type
|
|
6
|
-
class Binary <
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
class Binary < ModelElement
|
|
7
|
+
attribute :width, ModelElement
|
|
8
|
+
attribute :fixed, :boolean
|
|
9
|
+
attribute :_class, :string, default: -> { self.class.name }
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@width = options[:width]
|
|
15
|
-
@fixed = options[:fixed]
|
|
16
|
-
|
|
17
|
-
super
|
|
11
|
+
key_value do
|
|
12
|
+
map "_class", to: :_class, render_default: true
|
|
13
|
+
map "width", to: :width
|
|
14
|
+
map "fixed", to: :fixed
|
|
18
15
|
end
|
|
19
16
|
end
|
|
20
17
|
end
|
|
21
18
|
end
|
|
22
|
-
end
|
|
19
|
+
end
|
|
@@ -3,8 +3,13 @@ module Expressir
|
|
|
3
3
|
module DataTypes
|
|
4
4
|
# Specified in ISO 10303-11:2004
|
|
5
5
|
# - section 8.1.5 Boolean data type
|
|
6
|
-
class Boolean <
|
|
6
|
+
class Boolean < ModelElement
|
|
7
|
+
attribute :_class, :string, default: -> { self.class.name }
|
|
8
|
+
|
|
9
|
+
key_value do
|
|
10
|
+
map "_class", to: :_class, render_default: true
|
|
11
|
+
end
|
|
7
12
|
end
|
|
8
13
|
end
|
|
9
14
|
end
|
|
10
|
-
end
|
|
15
|
+
end
|
|
@@ -3,23 +3,19 @@ module Expressir
|
|
|
3
3
|
module DataTypes
|
|
4
4
|
# Specified in ISO 10303-11:2004
|
|
5
5
|
# - section 8.4.1 Enumeration data type
|
|
6
|
-
class Enumeration <
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
class Enumeration < ModelElement
|
|
7
|
+
attribute :extensible, :boolean
|
|
8
|
+
attribute :based_on, ModelElement
|
|
9
|
+
attribute :items, EnumerationItem, collection: true
|
|
10
|
+
attribute :_class, :string, default: -> { self.class.name }
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@extensible = options[:extensible]
|
|
17
|
-
@based_on = options[:based_on]
|
|
18
|
-
@items = options[:items] || []
|
|
19
|
-
|
|
20
|
-
super
|
|
12
|
+
key_value do
|
|
13
|
+
map "_class", to: :_class, render_default: true
|
|
14
|
+
map "extensible", to: :extensible
|
|
15
|
+
map "based_on", to: :based_on
|
|
16
|
+
map "items", to: :items
|
|
21
17
|
end
|
|
22
18
|
end
|
|
23
19
|
end
|
|
24
20
|
end
|
|
25
|
-
end
|
|
21
|
+
end
|
|
@@ -6,21 +6,19 @@ module Expressir
|
|
|
6
6
|
class EnumerationItem < ModelElement
|
|
7
7
|
include Identifier
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
# @option (see Identifier#initialize_identifier)
|
|
11
|
-
def initialize(options = {})
|
|
12
|
-
initialize_identifier(options)
|
|
9
|
+
attribute :_class, :string, default: -> { self.class.name }
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
key_value do
|
|
12
|
+
map "_class", to: :_class, render_default: true
|
|
15
13
|
end
|
|
16
14
|
|
|
17
15
|
# @return [Array<Declaration>]
|
|
18
16
|
def children
|
|
19
17
|
[
|
|
20
|
-
*remark_items
|
|
18
|
+
*remark_items,
|
|
21
19
|
]
|
|
22
20
|
end
|
|
23
21
|
end
|
|
24
22
|
end
|
|
25
23
|
end
|
|
26
|
-
end
|
|
24
|
+
end
|
|
@@ -3,24 +3,22 @@ module Expressir
|
|
|
3
3
|
module DataTypes
|
|
4
4
|
# Specified in ISO 10303-11:2004
|
|
5
5
|
# - section 9.5.3.2 Generic data type
|
|
6
|
-
class Generic <
|
|
6
|
+
class Generic < ModelElement
|
|
7
7
|
include Identifier
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
# @option (see Identifier#initialize_identifier)
|
|
11
|
-
def initialize(options = {})
|
|
12
|
-
initialize_identifier(options)
|
|
9
|
+
attribute :_class, :string, default: -> { self.class.name }
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
key_value do
|
|
12
|
+
map "_class", to: :_class, render_default: true
|
|
15
13
|
end
|
|
16
14
|
|
|
17
15
|
# @return [Array<Declaration>]
|
|
18
16
|
def children
|
|
19
17
|
[
|
|
20
|
-
*remark_items
|
|
18
|
+
*remark_items,
|
|
21
19
|
]
|
|
22
20
|
end
|
|
23
21
|
end
|
|
24
22
|
end
|
|
25
23
|
end
|
|
26
|
-
end
|
|
24
|
+
end
|
|
@@ -3,24 +3,22 @@ module Expressir
|
|
|
3
3
|
module DataTypes
|
|
4
4
|
# Specified in ISO 10303-11:2004
|
|
5
5
|
# - section 9.5.3.3 Generic entity data type
|
|
6
|
-
class GenericEntity <
|
|
6
|
+
class GenericEntity < ModelElement
|
|
7
7
|
include Identifier
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
# @option (see Identifier#initialize_identifier)
|
|
11
|
-
def initialize(options = {})
|
|
12
|
-
initialize_identifier(options)
|
|
9
|
+
attribute :_class, :string, default: -> { self.class.name }
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
key_value do
|
|
12
|
+
map "_class", to: :_class, render_default: true
|
|
15
13
|
end
|
|
16
|
-
end
|
|
17
14
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
# @return [Array<Declaration>]
|
|
16
|
+
def children
|
|
17
|
+
[
|
|
18
|
+
*remark_items,
|
|
19
|
+
]
|
|
20
|
+
end
|
|
23
21
|
end
|
|
24
22
|
end
|
|
25
23
|
end
|
|
26
|
-
end
|
|
24
|
+
end
|
|
@@ -3,8 +3,13 @@ module Expressir
|
|
|
3
3
|
module DataTypes
|
|
4
4
|
# Specified in ISO 10303-11:2004
|
|
5
5
|
# - section 8.1.3 Integer data type
|
|
6
|
-
class Integer <
|
|
6
|
+
class Integer < ModelElement
|
|
7
|
+
attribute :_class, :string, default: -> { self.class.name }
|
|
8
|
+
|
|
9
|
+
key_value do
|
|
10
|
+
map "_class", to: :_class, render_default: true
|
|
11
|
+
end
|
|
7
12
|
end
|
|
8
13
|
end
|
|
9
14
|
end
|
|
10
|
-
end
|
|
15
|
+
end
|