aas-core-codegen 0.0.16__py3-none-any.whl
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.
- aas_core_codegen/__init__.py +6 -0
- aas_core_codegen/__main__.py +8 -0
- aas_core_codegen/common.py +500 -0
- aas_core_codegen/cpp/__init__.py +1 -0
- aas_core_codegen/cpp/aas_common/__init__.py +6 -0
- aas_core_codegen/cpp/aas_common/_generate.py +713 -0
- aas_core_codegen/cpp/common.py +681 -0
- aas_core_codegen/cpp/constants/__init__.py +6 -0
- aas_core_codegen/cpp/constants/_generate.py +568 -0
- aas_core_codegen/cpp/description.py +654 -0
- aas_core_codegen/cpp/enhancing/__init__.py +4 -0
- aas_core_codegen/cpp/enhancing/_generate.py +993 -0
- aas_core_codegen/cpp/iteration/__init__.py +6 -0
- aas_core_codegen/cpp/iteration/_generate.py +2332 -0
- aas_core_codegen/cpp/jsonization/__init__.py +6 -0
- aas_core_codegen/cpp/jsonization/_generate.py +2619 -0
- aas_core_codegen/cpp/main.py +694 -0
- aas_core_codegen/cpp/naming.py +170 -0
- aas_core_codegen/cpp/optionaling.py +557 -0
- aas_core_codegen/cpp/pattern/__init__.py +6 -0
- aas_core_codegen/cpp/pattern/_generate.py +508 -0
- aas_core_codegen/cpp/revm/__init__.py +6 -0
- aas_core_codegen/cpp/revm/_generate.py +1149 -0
- aas_core_codegen/cpp/stringification/__init__.py +5 -0
- aas_core_codegen/cpp/stringification/_generate.py +955 -0
- aas_core_codegen/cpp/structure/__init__.py +7 -0
- aas_core_codegen/cpp/structure/_generate.py +1503 -0
- aas_core_codegen/cpp/transpilation.py +1383 -0
- aas_core_codegen/cpp/unrolling.py +159 -0
- aas_core_codegen/cpp/verification/__init__.py +6 -0
- aas_core_codegen/cpp/verification/_generate.py +3073 -0
- aas_core_codegen/cpp/visitation/__init__.py +6 -0
- aas_core_codegen/cpp/visitation/_generate.py +521 -0
- aas_core_codegen/cpp/wstringification/__init__.py +5 -0
- aas_core_codegen/cpp/wstringification/_generate.py +586 -0
- aas_core_codegen/cpp/xmlization/__init__.py +6 -0
- aas_core_codegen/cpp/xmlization/_generate.py +5373 -0
- aas_core_codegen/cpp/yielding.py +201 -0
- aas_core_codegen/csharp/__init__.py +1 -0
- aas_core_codegen/csharp/common.py +224 -0
- aas_core_codegen/csharp/constants/__init__.py +5 -0
- aas_core_codegen/csharp/constants/_generate.py +409 -0
- aas_core_codegen/csharp/copying/__init__.py +4 -0
- aas_core_codegen/csharp/copying/_generate.py +498 -0
- aas_core_codegen/csharp/description.py +1103 -0
- aas_core_codegen/csharp/enhancing/__init__.py +4 -0
- aas_core_codegen/csharp/enhancing/_generate.py +667 -0
- aas_core_codegen/csharp/jsonization/__init__.py +4 -0
- aas_core_codegen/csharp/jsonization/_generate.py +1630 -0
- aas_core_codegen/csharp/main.py +421 -0
- aas_core_codegen/csharp/naming.py +157 -0
- aas_core_codegen/csharp/reporting/__init__.py +4 -0
- aas_core_codegen/csharp/reporting/_generate.py +266 -0
- aas_core_codegen/csharp/stringification/__init__.py +4 -0
- aas_core_codegen/csharp/stringification/_generate.py +243 -0
- aas_core_codegen/csharp/structure/__init__.py +6 -0
- aas_core_codegen/csharp/structure/_generate.py +1341 -0
- aas_core_codegen/csharp/transpilation.py +990 -0
- aas_core_codegen/csharp/unrolling.py +211 -0
- aas_core_codegen/csharp/verification/__init__.py +6 -0
- aas_core_codegen/csharp/verification/_generate.py +1457 -0
- aas_core_codegen/csharp/visitation/__init__.py +5 -0
- aas_core_codegen/csharp/visitation/_generate.py +579 -0
- aas_core_codegen/csharp/xmlization/__init__.py +4 -0
- aas_core_codegen/csharp/xmlization/_generate.py +1980 -0
- aas_core_codegen/golang/__init__.py +1 -0
- aas_core_codegen/golang/aas_common/__init__.py +4 -0
- aas_core_codegen/golang/aas_common/_generate.py +152 -0
- aas_core_codegen/golang/common.py +303 -0
- aas_core_codegen/golang/constants/__init__.py +5 -0
- aas_core_codegen/golang/constants/_generate.py +339 -0
- aas_core_codegen/golang/description.py +501 -0
- aas_core_codegen/golang/enhancing/__init__.py +4 -0
- aas_core_codegen/golang/enhancing/_generate.py +527 -0
- aas_core_codegen/golang/jsonization/__init__.py +4 -0
- aas_core_codegen/golang/jsonization/_generate.py +1740 -0
- aas_core_codegen/golang/main.py +368 -0
- aas_core_codegen/golang/naming.py +412 -0
- aas_core_codegen/golang/pointering.py +631 -0
- aas_core_codegen/golang/reporting/__init__.py +4 -0
- aas_core_codegen/golang/reporting/_generate.py +218 -0
- aas_core_codegen/golang/stringification/__init__.py +4 -0
- aas_core_codegen/golang/stringification/_generate.py +394 -0
- aas_core_codegen/golang/structure/__init__.py +6 -0
- aas_core_codegen/golang/structure/_generate.py +1493 -0
- aas_core_codegen/golang/transpilation.py +1191 -0
- aas_core_codegen/golang/unrolling.py +159 -0
- aas_core_codegen/golang/verification/__init__.py +6 -0
- aas_core_codegen/golang/verification/_generate.py +1513 -0
- aas_core_codegen/golang/xmlization/__init__.py +4 -0
- aas_core_codegen/golang/xmlization/_generate.py +2507 -0
- aas_core_codegen/infer_for_schema/__init__.py +21 -0
- aas_core_codegen/infer_for_schema/_inline.py +693 -0
- aas_core_codegen/infer_for_schema/_len.py +527 -0
- aas_core_codegen/infer_for_schema/_pattern.py +311 -0
- aas_core_codegen/infer_for_schema/_set.py +394 -0
- aas_core_codegen/infer_for_schema/_stringify.py +201 -0
- aas_core_codegen/infer_for_schema/_types.py +135 -0
- aas_core_codegen/infer_for_schema/match.py +122 -0
- aas_core_codegen/intermediate/__init__.py +78 -0
- aas_core_codegen/intermediate/_hierarchy.py +397 -0
- aas_core_codegen/intermediate/_stringify.py +989 -0
- aas_core_codegen/intermediate/_translate.py +5128 -0
- aas_core_codegen/intermediate/_types.py +2901 -0
- aas_core_codegen/intermediate/construction.py +750 -0
- aas_core_codegen/intermediate/doc.py +344 -0
- aas_core_codegen/intermediate/pattern_verification.py +428 -0
- aas_core_codegen/intermediate/revm.py +985 -0
- aas_core_codegen/intermediate/type_inference.py +2266 -0
- aas_core_codegen/java/__init__.py +1 -0
- aas_core_codegen/java/common.py +197 -0
- aas_core_codegen/java/constants/__init__.py +5 -0
- aas_core_codegen/java/constants/_generate.py +334 -0
- aas_core_codegen/java/copying/__init__.py +4 -0
- aas_core_codegen/java/copying/_generate.py +502 -0
- aas_core_codegen/java/description.py +774 -0
- aas_core_codegen/java/enhancing/__init__.py +4 -0
- aas_core_codegen/java/enhancing/_generate.py +820 -0
- aas_core_codegen/java/generation/__init__.py +5 -0
- aas_core_codegen/java/generation/_generate.py +285 -0
- aas_core_codegen/java/jsonization/__init__.py +4 -0
- aas_core_codegen/java/jsonization/_generate.py +1472 -0
- aas_core_codegen/java/main.py +438 -0
- aas_core_codegen/java/naming.py +187 -0
- aas_core_codegen/java/optional.py +514 -0
- aas_core_codegen/java/reporting/__init__.py +4 -0
- aas_core_codegen/java/reporting/_generate.py +248 -0
- aas_core_codegen/java/stringification/__init__.py +4 -0
- aas_core_codegen/java/stringification/_generate.py +212 -0
- aas_core_codegen/java/structure/__init__.py +6 -0
- aas_core_codegen/java/structure/_generate.py +1767 -0
- aas_core_codegen/java/transpilation.py +1111 -0
- aas_core_codegen/java/verification/__init__.py +6 -0
- aas_core_codegen/java/verification/_generate.py +1536 -0
- aas_core_codegen/java/visitation/__init__.py +5 -0
- aas_core_codegen/java/visitation/_generate.py +689 -0
- aas_core_codegen/java/xmlization/__init__.py +4 -0
- aas_core_codegen/java/xmlization/_generate.py +2274 -0
- aas_core_codegen/jsonld/__init__.py +1 -0
- aas_core_codegen/jsonld/main.py +455 -0
- aas_core_codegen/jsonschema/__init__.py +1 -0
- aas_core_codegen/jsonschema/main.py +982 -0
- aas_core_codegen/main.py +245 -0
- aas_core_codegen/naming.py +133 -0
- aas_core_codegen/opcua/__init__.py +1 -0
- aas_core_codegen/opcua/main.py +1525 -0
- aas_core_codegen/opcua/naming.py +126 -0
- aas_core_codegen/parse/__init__.py +46 -0
- aas_core_codegen/parse/_rules.py +796 -0
- aas_core_codegen/parse/_stringify.py +532 -0
- aas_core_codegen/parse/_translate.py +3940 -0
- aas_core_codegen/parse/_types.py +973 -0
- aas_core_codegen/parse/retree/__init__.py +46 -0
- aas_core_codegen/parse/retree/_fix.py +434 -0
- aas_core_codegen/parse/retree/_parse.py +1143 -0
- aas_core_codegen/parse/retree/_render.py +298 -0
- aas_core_codegen/parse/retree/_stringify.py +199 -0
- aas_core_codegen/parse/retree/_types.py +362 -0
- aas_core_codegen/parse/retree/_visitor.py +70 -0
- aas_core_codegen/parse/tree.py +1303 -0
- aas_core_codegen/protobuf/__init__.py +1 -0
- aas_core_codegen/protobuf/common.py +225 -0
- aas_core_codegen/protobuf/description.py +1102 -0
- aas_core_codegen/protobuf/main.py +115 -0
- aas_core_codegen/protobuf/naming.py +143 -0
- aas_core_codegen/protobuf/structure/__init__.py +6 -0
- aas_core_codegen/protobuf/structure/_generate.py +502 -0
- aas_core_codegen/py.typed +1 -0
- aas_core_codegen/python/__init__.py +1 -0
- aas_core_codegen/python/aas_common/__init__.py +4 -0
- aas_core_codegen/python/aas_common/_generate.py +63 -0
- aas_core_codegen/python/common.py +406 -0
- aas_core_codegen/python/constants/__init__.py +5 -0
- aas_core_codegen/python/constants/_generate.py +377 -0
- aas_core_codegen/python/description.py +508 -0
- aas_core_codegen/python/jsonization/__init__.py +4 -0
- aas_core_codegen/python/jsonization/_generate.py +1391 -0
- aas_core_codegen/python/main.py +323 -0
- aas_core_codegen/python/naming.py +255 -0
- aas_core_codegen/python/stringification/__init__.py +4 -0
- aas_core_codegen/python/stringification/_generate.py +129 -0
- aas_core_codegen/python/structure/__init__.py +6 -0
- aas_core_codegen/python/structure/_generate.py +1801 -0
- aas_core_codegen/python/transpilation.py +958 -0
- aas_core_codegen/python/unrolling.py +156 -0
- aas_core_codegen/python/verification/__init__.py +6 -0
- aas_core_codegen/python/verification/_generate.py +1471 -0
- aas_core_codegen/python/xmlization/__init__.py +4 -0
- aas_core_codegen/python/xmlization/_generate.py +3003 -0
- aas_core_codegen/python_protobuf/__init__.py +1 -0
- aas_core_codegen/python_protobuf/main.py +1424 -0
- aas_core_codegen/python_protobuf/naming.py +85 -0
- aas_core_codegen/rdf_shacl/__init__.py +1 -0
- aas_core_codegen/rdf_shacl/_description.py +351 -0
- aas_core_codegen/rdf_shacl/common.py +206 -0
- aas_core_codegen/rdf_shacl/main.py +114 -0
- aas_core_codegen/rdf_shacl/naming.py +145 -0
- aas_core_codegen/rdf_shacl/rdf.py +435 -0
- aas_core_codegen/rdf_shacl/shacl.py +453 -0
- aas_core_codegen/run.py +124 -0
- aas_core_codegen/smoke/__init__.py +1 -0
- aas_core_codegen/smoke/main.py +219 -0
- aas_core_codegen/specific_implementations.py +72 -0
- aas_core_codegen/stringify.py +333 -0
- aas_core_codegen/typescript/__init__.py +1 -0
- aas_core_codegen/typescript/aas_common/__init__.py +4 -0
- aas_core_codegen/typescript/aas_common/_generate.py +472 -0
- aas_core_codegen/typescript/common.py +340 -0
- aas_core_codegen/typescript/constants/__init__.py +5 -0
- aas_core_codegen/typescript/constants/_generate.py +347 -0
- aas_core_codegen/typescript/description.py +530 -0
- aas_core_codegen/typescript/jsonization/__init__.py +4 -0
- aas_core_codegen/typescript/jsonization/_generate.py +1510 -0
- aas_core_codegen/typescript/main.py +258 -0
- aas_core_codegen/typescript/naming.py +189 -0
- aas_core_codegen/typescript/stringification/__init__.py +4 -0
- aas_core_codegen/typescript/stringification/_generate.py +367 -0
- aas_core_codegen/typescript/structure/__init__.py +6 -0
- aas_core_codegen/typescript/structure/_generate.py +2500 -0
- aas_core_codegen/typescript/transpilation.py +1051 -0
- aas_core_codegen/typescript/unrolling.py +159 -0
- aas_core_codegen/typescript/verification/__init__.py +6 -0
- aas_core_codegen/typescript/verification/_generate.py +1578 -0
- aas_core_codegen/xsd/__init__.py +1 -0
- aas_core_codegen/xsd/main.py +1187 -0
- aas_core_codegen/xsd/naming.py +83 -0
- aas_core_codegen/yielding/__init__.py +1 -0
- aas_core_codegen/yielding/flow.py +139 -0
- aas_core_codegen/yielding/linear.py +754 -0
- aas_core_codegen-0.0.16.dist-info/METADATA +211 -0
- aas_core_codegen-0.0.16.dist-info/RECORD +604 -0
- aas_core_codegen-0.0.16.dist-info/WHEEL +5 -0
- aas_core_codegen-0.0.16.dist-info/entry_points.txt +3 -0
- aas_core_codegen-0.0.16.dist-info/licenses/AUTHORS +9 -0
- aas_core_codegen-0.0.16.dist-info/licenses/LICENSE +23 -0
- aas_core_codegen-0.0.16.dist-info/top_level.txt +2 -0
- dev/continuous_integration/__init__.py +1 -0
- dev/continuous_integration/check_help_in_readme.py +208 -0
- dev/continuous_integration/check_init_and_pyproject_consistent.py +154 -0
- dev/continuous_integration/precommit.py +400 -0
- dev/dev_scripts/__init__.py +1 -0
- dev/dev_scripts/compare_rendered_regexes_against_source_py.py +42 -0
- dev/dev_scripts/copy_to_aas_core3_cpp.py +100 -0
- dev/dev_scripts/copy_to_aas_core3_java.py +90 -0
- dev/dev_scripts/download_latest_aas_core_meta_v3.py +114 -0
- dev/dev_scripts/draw_bipartite_graph_based_on_lines.py +37 -0
- dev/dev_scripts/run_tests_with_rerecord.py +69 -0
- dev/dev_scripts/update_to_aas_core_meta.py +174 -0
- dev/integration_tests/input/jsonschema/boilerplate/main.py +55 -0
- dev/integration_tests/input/meta_model.py +38 -0
- dev/integration_tests/input/python/boilerplate/main.py +153 -0
- dev/integration_tests/main.py +258 -0
- dev/test_data/csharp/test_structure/concrete_class_with_descendants/meta_model.py +15 -0
- dev/test_data/csharp/test_structure/constructor_without_arguments/all_properties_optional/meta_model.py +9 -0
- dev/test_data/csharp/test_structure/constructor_without_arguments/no_properties/meta_model.py +6 -0
- dev/test_data/csharp/test_verification/builtin_functions/len/on_list/meta_model.py +20 -0
- dev/test_data/csharp/test_verification/builtin_functions/len/on_str/meta_model.py +16 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_as_literal/as_prefix/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_as_literal/as_suffix/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_as_literal/in_group_with_quantifier/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_as_literal/in_the_middle/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_as_literal/in_union/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_as_literal/single_utf32_literal/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_as_literal/with_quantifier_within_group/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_as_literal/with_quantifier_without_group/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_in_character_set/literal/at_the_beginning/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_in_character_set/literal/at_the_end/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_in_character_set/literal/in_the_middle/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_in_character_set/literal/multiple/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_in_character_set/literal/single/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_in_character_set/literal/single_with_quantifier/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_in_character_set/range/mixed_with_non_utf32/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_in_character_set/range/more_than_two_high_surrogates/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_in_character_set/range/multiple_utf32_ranges/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_in_character_set/range/multiple_utf32_ranges_mixed_with_non_utf32/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_in_character_set/range/same_high_surrogate/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_in_character_set/range/same_high_surrogate_with_quantifier/meta_model.py +8 -0
- dev/test_data/csharp/test_verification/pattern_verification/utf32_in_character_set/range/two_high_surrogates/meta_model.py +8 -0
- dev/test_data/intermediate/expected/class/empty/meta_model.py +6 -0
- dev/test_data/intermediate/expected/class/implementation_specific_method/meta_model.py +8 -0
- dev/test_data/intermediate/expected/class/inheritance/meta_model.py +41 -0
- dev/test_data/intermediate/expected/class/methods_with_contracts/meta_model.py +15 -0
- dev/test_data/intermediate/expected/class/only_method_no_property/meta_model.py +7 -0
- dev/test_data/intermediate/expected/class/only_property_no_method/meta_model.py +9 -0
- dev/test_data/intermediate/expected/constant/constant_set/of_enum/meta_model.py +12 -0
- dev/test_data/intermediate/expected/constant/constant_set/of_str/meta_model.py +4 -0
- dev/test_data/intermediate/expected/constant/constant_set/with_description/meta_model.py +6 -0
- dev/test_data/intermediate/expected/constant/constant_set/with_superset_of/meta_model.py +14 -0
- dev/test_data/intermediate/expected/constant/constant_str/only_value/meta_model.py +7 -0
- dev/test_data/intermediate/expected/constant/constant_str/with_description/meta_model.py +5 -0
- dev/test_data/intermediate/expected/documentation/docstring_with_special_characters_in_literal/meta_model.py +20 -0
- dev/test_data/intermediate/expected/documentation/docstring_with_special_characters_outside_literal/meta_model.py +20 -0
- dev/test_data/intermediate/expected/empty/meta_model.py +2 -0
- dev/test_data/intermediate/expected/enumeration/meta_model.py +9 -0
- dev/test_data/intermediate/expected/interface/basic/meta_model.py +14 -0
- dev/test_data/intermediate/expected/interface/empty/meta_model.py +7 -0
- dev/test_data/intermediate/expected/interface/inheritance/meta_model.py +27 -0
- dev/test_data/intermediate/expected/interface/method_signature/meta_model.py +10 -0
- dev/test_data/intermediate/expected/interface/only_constructor/meta_model.py +11 -0
- dev/test_data/intermediate/expected/method/non_mutating/implementation_specific/meta_model.py +12 -0
- dev/test_data/intermediate/expected/method/non_mutating/understood/meta_model.py +11 -0
- dev/test_data/intermediate/expected/type_annotation/atomic/meta_model.py +9 -0
- dev/test_data/intermediate/expected/type_annotation/subscripted/class/meta_model.py +13 -0
- dev/test_data/intermediate/expected/type_annotation/subscripted/primitive/meta_model.py +9 -0
- dev/test_data/intermediate/unexpected/constant_set/of_enum/enumeration_literals_in_subset_outside_of_superset/meta_model.py +20 -0
- dev/test_data/intermediate/unexpected/constant_set/of_enum/invalid_literal/meta_model.py +11 -0
- dev/test_data/intermediate/unexpected/constant_set/of_enum/mismatch_between_enumeration_and_literal/meta_model.py +30 -0
- dev/test_data/intermediate/unexpected/constant_set/of_enum/mismatch_in_enumerations_between_subset_and_superset/meta_model.py +21 -0
- dev/test_data/intermediate/unexpected/constant_set/of_str/literals_in_subset_outside_of_superset/meta_model.py +18 -0
- dev/test_data/intermediate/unexpected/constant_set/of_str/mismatch_between_type_annotation_and_literals/meta_model.py +10 -0
- dev/test_data/intermediate/unexpected/constant_set/of_str/superset_and_subset_mismatch_in_type/meta_model.py +12 -0
- dev/test_data/intermediate/unexpected/constraints/dangling_constraintref/meta_model.py +18 -0
- dev/test_data/intermediate/unexpected/constraints/duplicate_constraints/meta_model.py +20 -0
- dev/test_data/intermediate/unexpected/documentation/unexpected_documentation_elements/meta_model.py +34 -0
- dev/test_data/intermediate/unexpected/invariant/class_invariant_uses_re/meta_model.py +10 -0
- dev/test_data/intermediate/unexpected/invariant/invariant_of_constrained_primitive_uses_re/meta_model.py +7 -0
- dev/test_data/intermediate/unexpected/invariant/unexpected_argument_count_to_len/meta_model.py +20 -0
- dev/test_data/intermediate/unexpected/invariant/unhandled_built_in_function/meta_model.py +16 -0
- dev/test_data/intermediate/unexpected/method_definitions/non_constant_default/meta_model.py +7 -0
- dev/test_data/intermediate/unexpected/optional_constructor_arguments_wo_default/default_non_none/meta_model.py +16 -0
- dev/test_data/intermediate/unexpected/optional_constructor_arguments_wo_default/no_default/meta_model.py +16 -0
- dev/test_data/intermediate/unexpected/properties_and_constructor_arguments_do_not_match/after_inheritance/meta_model.py +58 -0
- dev/test_data/intermediate/unexpected/properties_and_constructor_arguments_do_not_match/type_missmatch/meta_model.py +9 -0
- dev/test_data/intermediate/unexpected/properties_and_constructor_arguments_do_not_match/within_class/meta_model.py +22 -0
- dev/test_data/jsonschema/test_main/regression_when_len_constraints_on_inherited_property/meta_model.py +28 -0
- dev/test_data/opcua/test_main/abstract_and_concrete_classes/meta_model.py +37 -0
- dev/test_data/opcua/test_main/classes_with_invariants/meta_model.py +21 -0
- dev/test_data/opcua/test_main/concrete_class_with_descendant/meta_model.py +27 -0
- dev/test_data/opcua/test_main/concrete_class_with_enum/meta_model.py +21 -0
- dev/test_data/opcua/test_main/concrete_class_with_list_of_instances/meta_model.py +21 -0
- dev/test_data/opcua/test_main/concrete_class_with_primitive_attributes/meta_model.py +41 -0
- dev/test_data/opcua/test_main/concrete_class_with_string/meta_model.py +13 -0
- dev/test_data/opcua/test_main/constrained_primitive/meta_model.py +20 -0
- dev/test_data/opcua/test_main/multiple_inheritance/meta_model.py +25 -0
- dev/test_data/parse/expected/constant/constant_set/of_enum/meta_model.py +12 -0
- dev/test_data/parse/expected/constant/constant_set/of_str/meta_model.py +4 -0
- dev/test_data/parse/expected/constant/constant_set/with_description/meta_model.py +6 -0
- dev/test_data/parse/expected/constant/constant_set/with_superset_of/meta_model.py +14 -0
- dev/test_data/parse/expected/constant/constant_str/only_value/meta_model.py +7 -0
- dev/test_data/parse/expected/constant/constant_str/with_description/meta_model.py +5 -0
- dev/test_data/parse/expected/enum/ok/meta_model.py +15 -0
- dev/test_data/parse/expected/implementation_specific_class/properties_and_methods_in_implementation_specific_class/meta_model.py +17 -0
- dev/test_data/parse/expected/inheritance/basic/meta_model.py +11 -0
- dev/test_data/parse/expected/inheritance/diamond/meta_model.py +26 -0
- dev/test_data/parse/expected/inheritance/inheritance_from_concrete_class/meta_model.py +10 -0
- dev/test_data/parse/expected/invariants/in_relation/meta_model.py +16 -0
- dev/test_data/parse/expected/method/arguments/meta_model.py +7 -0
- dev/test_data/parse/expected/method/basic/meta_model.py +7 -0
- dev/test_data/parse/expected/method/contracts/condition_as_keyword_argument/meta_model.py +8 -0
- dev/test_data/parse/expected/method/contracts/condition_as_positional_argument/meta_model.py +8 -0
- dev/test_data/parse/expected/method/contracts/description_as_keyword_argument/meta_model.py +8 -0
- dev/test_data/parse/expected/method/contracts/description_as_positional_argument/meta_model.py +8 -0
- dev/test_data/parse/expected/method/contracts/multiple_contracts_in_order/meta_model.py +17 -0
- dev/test_data/parse/expected/method/contracts/postcondition/basic/meta_model.py +10 -0
- dev/test_data/parse/expected/method/contracts/postcondition/snapshot/with_keyword_arguments/meta_model.py +9 -0
- dev/test_data/parse/expected/method/contracts/postcondition/snapshot/with_positional_arguments/meta_model.py +9 -0
- dev/test_data/parse/expected/method/default/meta_model.py +9 -0
- dev/test_data/parse/expected/method/description/meta_model.py +8 -0
- dev/test_data/parse/expected/method/is_implementation_specific/meta_model.py +8 -0
- dev/test_data/parse/expected/method/non_mutating/meta_model.py +11 -0
- dev/test_data/parse/expected/method/returns_none/meta_model.py +7 -0
- dev/test_data/parse/expected/method/returns_something/meta_model.py +7 -0
- dev/test_data/parse/expected/single_class/description/meta_model.py +12 -0
- dev/test_data/parse/expected/single_class/empty/meta_model.py +6 -0
- dev/test_data/parse/expected/single_class/property/description/meta_model.py +14 -0
- dev/test_data/parse/expected/single_class/property/mandatory/meta_model.py +6 -0
- dev/test_data/parse/expected/single_class/property/optional/meta_model.py +6 -0
- dev/test_data/parse/expected/single_class/property/recursion_to_entity/meta_model.py +6 -0
- dev/test_data/parse/unexpected/class_decorators/non_name_decorator/meta_model.py +7 -0
- dev/test_data/parse/unexpected/class_decorators/unknown_decorator/meta_model.py +7 -0
- dev/test_data/parse/unexpected/class_definitions/is_abstract_and_implementation_specific/meta_model.py +8 -0
- dev/test_data/parse/unexpected/class_definitions/unexpected_docstring_before_a_method/meta_model.py +11 -0
- dev/test_data/parse/unexpected/class_definitions/unexpected_docstring_for_a_pass/meta_model.py +9 -0
- dev/test_data/parse/unexpected/class_definitions/unexpected_double_description_for_a_property/meta_model.py +10 -0
- dev/test_data/parse/unexpected/class_inheritances/inheriting_from_implementation_specific_parent/meta_model.py +20 -0
- dev/test_data/parse/unexpected/class_inheritances/non_name_super_class/meta_model.py +6 -0
- dev/test_data/parse/unexpected/enum/expression_as_assignment_value/meta_model.py +6 -0
- dev/test_data/parse/unexpected/enum/non_assignment/meta_model.py +8 -0
- dev/test_data/parse/unexpected/enum/non_string_literal/meta_model.py +6 -0
- dev/test_data/parse/unexpected/enum/unexpected_inheritance/meta_model.py +6 -0
- dev/test_data/parse/unexpected/method_contracts/contract/non_lambda_condition/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_contracts/contract/non_string_literal_description/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_contracts/contract/without_any_arguments/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_contracts/contract/without_condition/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_contracts/postcondition/OLD_in_postcondition_without_snapshot/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_contracts/postcondition/argument_missing_in_function/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_contracts/precondition/argument_missing_in_function/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_contracts/snapshot/argument_missing_in_function/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_contracts/snapshot/capture_not_a_lambda/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_contracts/snapshot/invalid_name/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_contracts/snapshot/name_not_a_string_literal/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_contracts/snapshot/without_a_capture/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_contracts/snapshot/without_a_name/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_decorators/non_mutating/non_mutating_constructor/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_decorators/non_mutating/non_mutating_verification_function/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_decorators/non_name_decorator/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_decorators/unknown_call_decorator/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_decorators/unknown_name_decorator/meta_model.py +8 -0
- dev/test_data/parse/unexpected/method_definitions/argument_with_final/meta_model.py +7 -0
- dev/test_data/parse/unexpected/method_definitions/argument_without_a_type_annotation/meta_model.py +7 -0
- dev/test_data/parse/unexpected/method_definitions/default_for_self/meta_model.py +7 -0
- dev/test_data/parse/unexpected/method_definitions/dunder/meta_model.py +7 -0
- dev/test_data/parse/unexpected/method_definitions/init_with_return_type/meta_model.py +7 -0
- dev/test_data/parse/unexpected/method_definitions/with_keyword_only_arguments/meta_model.py +7 -0
- dev/test_data/parse/unexpected/method_definitions/with_positional_arguments/meta_model.py +7 -0
- dev/test_data/parse/unexpected/method_definitions/with_type_annotation_for_self/meta_model.py +7 -0
- dev/test_data/parse/unexpected/method_definitions/with_variable_arguments/meta_model.py +7 -0
- dev/test_data/parse/unexpected/method_definitions/with_variable_keyword_arguments/meta_model.py +7 -0
- dev/test_data/parse/unexpected/method_definitions/without_arguments/meta_model.py +7 -0
- dev/test_data/parse/unexpected/method_definitions/without_self/meta_model.py +7 -0
- dev/test_data/parse/unexpected/method_definitions/without_type_annotation_for_result/meta_model.py +7 -0
- dev/test_data/parse/unexpected/property_definitions/final_without_subscript/meta_model.py +6 -0
- dev/test_data/parse/unexpected/property_definitions/nested_final/meta_model.py +6 -0
- dev/test_data/parse/unexpected/property_definitions/non_simple/meta_model.py +6 -0
- dev/test_data/parse/unexpected/property_definitions/unexpected_assignment/meta_model.py +6 -0
- dev/test_data/parse/unexpected/property_definitions/unexpected_non_name_property/meta_model.py +6 -0
- dev/test_data/parse/unexpected/property_definitions/without_type_annotation/meta_model.py +6 -0
- dev/test_data/parse/unexpected/symbol_table/constant_set_with_a_non_set_subset/meta_model.py +6 -0
- dev/test_data/parse/unexpected/symbol_table/dangling_inheritance/meta_model.py +6 -0
- dev/test_data/parse/unexpected/symbol_table/dangling_reference_in_type_annotation_of_a_property/meta_model.py +6 -0
- dev/test_data/parse/unexpected/symbol_table/dangling_reference_in_type_annotation_of_an_argument/meta_model.py +7 -0
- dev/test_data/parse/unexpected/symbol_table/dangling_reference_in_type_annotation_of_constant_set/meta_model.py +6 -0
- dev/test_data/parse/unexpected/symbol_table/dangling_subset_in_constant_set/meta_model.py +4 -0
- dev/test_data/parse/unexpected/symbol_table/inheritance_from_non_class/meta_model.py +10 -0
- dev/test_data/parse_retree/expected/character_set/common_escaping/source.py +1 -0
- dev/test_data/parse_retree/expected/character_set/complementing/double_caret/source.py +1 -0
- dev/test_data/parse_retree/expected/character_set/complementing/multiple_ranges/source.py +1 -0
- dev/test_data/parse_retree/expected/character_set/complementing/suffix_dash/source.py +1 -0
- dev/test_data/parse_retree/expected/character_set/escape_first_caret/source.py +1 -0
- dev/test_data/parse_retree/expected/character_set/literals_which_need_no_escaping_in_characters_set_but_need_escaping_outside/source.py +1 -0
- dev/test_data/parse_retree/expected/character_set/multiple_ranges/source.py +1 -0
- dev/test_data/parse_retree/expected/character_set/single_literal/source.py +1 -0
- dev/test_data/parse_retree/expected/character_set/single_range/source.py +1 -0
- dev/test_data/parse_retree/expected/character_set/unescaped_dash/only_dash/source.py +1 -0
- dev/test_data/parse_retree/expected/character_set/unescaped_dash/prefix_dash/source.py +1 -0
- dev/test_data/parse_retree/expected/character_set/unescaped_dash/suffix_dash/source.py +1 -0
- dev/test_data/parse_retree/expected/dot/source.py +1 -0
- dev/test_data/parse_retree/expected/empty/group/source.py +1 -0
- dev/test_data/parse_retree/expected/empty/group_in_a_group/source.py +1 -0
- dev/test_data/parse_retree/expected/empty/group_of_union_of_empty_concatenations/source.py +1 -0
- dev/test_data/parse_retree/expected/empty/regex/source.py +1 -0
- dev/test_data/parse_retree/expected/empty/union_of_empty_concatenations/source.py +1 -0
- dev/test_data/parse_retree/expected/escaped_literals/source.py +1 -0
- dev/test_data/parse_retree/expected/formatted_value/at_the_beginning/source.py +1 -0
- dev/test_data/parse_retree/expected/formatted_value/at_the_end/source.py +1 -0
- dev/test_data/parse_retree/expected/formatted_value/in_the_middle/source.py +1 -0
- dev/test_data/parse_retree/expected/formatted_value/single_formatted_value/source.py +1 -0
- dev/test_data/parse_retree/expected/literal/source.py +1 -0
- dev/test_data/parse_retree/expected/quantifier/greedy/at_least_3/source.py +1 -0
- dev/test_data/parse_retree/expected/quantifier/greedy/at_least_one/source.py +1 -0
- dev/test_data/parse_retree/expected/quantifier/greedy/at_most_3/source.py +1 -0
- dev/test_data/parse_retree/expected/quantifier/greedy/exactly_3/source.py +1 -0
- dev/test_data/parse_retree/expected/quantifier/greedy/maybe/source.py +1 -0
- dev/test_data/parse_retree/expected/quantifier/greedy/zero_or_more/source.py +1 -0
- dev/test_data/parse_retree/expected/quantifier/non_greedy/at_least_3/source.py +1 -0
- dev/test_data/parse_retree/expected/quantifier/non_greedy/at_least_one/source.py +1 -0
- dev/test_data/parse_retree/expected/quantifier/non_greedy/at_most_3/source.py +1 -0
- dev/test_data/parse_retree/expected/quantifier/non_greedy/exactly_3/source.py +1 -0
- dev/test_data/parse_retree/expected/quantifier/non_greedy/maybe/source.py +1 -0
- dev/test_data/parse_retree/expected/quantifier/non_greedy/zero_or_more/source.py +1 -0
- dev/test_data/parse_retree/expected/quantifier/on_a_character_set/source.py +1 -0
- dev/test_data/parse_retree/expected/quantifier/on_a_formatted_value/source.py +1 -0
- dev/test_data/parse_retree/expected/quantifier/on_a_group/source.py +1 -0
- dev/test_data/parse_retree/expected/quantifier/on_a_literal/source.py +1 -0
- dev/test_data/parse_retree/expected/start_and_stop_symbols/double_end_symbol/source.py +1 -0
- dev/test_data/parse_retree/expected/start_and_stop_symbols/double_start_symbol/source.py +1 -0
- dev/test_data/parse_retree/expected/start_and_stop_symbols/end_symbol_in_the_middle/source.py +1 -0
- dev/test_data/parse_retree/expected/start_and_stop_symbols/only_start_symbol/source.py +1 -0
- dev/test_data/parse_retree/expected/start_and_stop_symbols/only_stop_symbol/source.py +1 -0
- dev/test_data/parse_retree/expected/start_and_stop_symbols/start_symbol_at_the_beginning/source.py +1 -0
- dev/test_data/parse_retree/expected/start_and_stop_symbols/start_symbol_in_the_middle/source.py +1 -0
- dev/test_data/parse_retree/expected/start_and_stop_symbols/stop_symbol_at_the_end/source.py +1 -0
- dev/test_data/parse_retree/expected/union/of_character_sets/source.py +1 -0
- dev/test_data/parse_retree/expected/union/of_groups/source.py +1 -0
- dev/test_data/parse_retree/expected/union/of_string_literals/source.py +1 -0
- dev/test_data/parse_retree/expected/union/within_group/source.py +1 -0
- dev/test_data/parse_retree/expected/whitespace/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/character_literal/Uxxxxxxxx_out_of_range/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/character_literal/only_backslash/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/character_literal/short_Uxxxxxxxx/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/character_literal/short_uxxxx/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/character_literal/short_x/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/character_literal/unexpected_escaping/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/character_literal/unhandled/digit/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/character_literal/unhandled/not_digit/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/character_literal/unhandled/not_whitespace/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/character_literal/unhandled/not_word/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/character_literal/unhandled/whitespace/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/character_literal/unhandled/word/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/range_character/Uxxxxxxxx_out_of_range/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/range_character/only_backslash/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/range_character/short_Uxxxxxxxx/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/range_character/short_uxxxx/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/range_character/short_x/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/range_character/unexpected_escaping/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/range_character/unhandled/digit/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/range_character/unhandled/not_digit/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/range_character/unhandled/not_whitespace/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/range_character/unhandled/not_word/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/range_character/unhandled/whitespace/source.py +1 -0
- dev/test_data/parse_retree/unexpected/improper_escaping/range_character/unhandled/word/source.py +1 -0
- dev/test_data/parse_retree/unexpected/invalid_character_range/source.py +1 -0
- dev/test_data/parse_retree/unexpected/invalid_quantifier/at_least_x/source.py +1 -0
- dev/test_data/parse_retree/unexpected/invalid_quantifier/between_3_and_x/source.py +1 -0
- dev/test_data/parse_retree/unexpected/invalid_quantifier/exactly_x/source.py +1 -0
- dev/test_data/parse_retree/unexpected/unhandled_group_directives/source.py +1 -0
- dev/test_data/parse_retree/unexpected/unterminated/character_set/source.py +1 -0
- dev/test_data/parse_retree/unexpected/unterminated/group/source.py +1 -0
- dev/test_data/parse_retree/unexpected/unterminated/group_of_union_of_empty_concatenations/source.py +1 -0
- dev/test_data/parse_retree/unexpected/unterminated/quantifier/source.py +1 -0
- dev/test_data/parse_retree/unexpected/unterminated/quantifier_with_comma/source.py +1 -0
- dev/test_data/parse_retree/unexpected/unterminated/quantifier_with_number_and_comma/source.py +1 -0
- dev/test_data/proto/test_main/expected/abstract_and_concrete_classes/meta_model.py +37 -0
- dev/test_data/proto/test_main/expected/concrete_class_with_descendants/meta_model.py +30 -0
- dev/test_data/proto/test_main/expected/concrete_class_with_enum/meta_model.py +21 -0
- dev/test_data/proto/test_main/expected/concrete_class_with_list_of_instances/meta_model.py +21 -0
- dev/test_data/proto/test_main/expected/concrete_class_with_primitive_attributes/meta_model.py +41 -0
- dev/test_data/python_protobuf/test_main/abstract_and_concrete_classes/expected_output/pbization.py +532 -0
- dev/test_data/python_protobuf/test_main/abstract_and_concrete_classes/meta_model.py +37 -0
- dev/test_data/python_protobuf/test_main/concrete_class_with_descendant/expected_output/pbization.py +527 -0
- dev/test_data/python_protobuf/test_main/concrete_class_with_descendant/meta_model.py +27 -0
- dev/test_data/python_protobuf/test_main/concrete_class_with_enum/expected_output/pbization.py +290 -0
- dev/test_data/python_protobuf/test_main/concrete_class_with_enum/meta_model.py +21 -0
- dev/test_data/python_protobuf/test_main/concrete_class_with_list_of_instances/expected_output/pbization.py +328 -0
- dev/test_data/python_protobuf/test_main/concrete_class_with_list_of_instances/meta_model.py +23 -0
- dev/test_data/python_protobuf/test_main/concrete_class_with_primitive_attributes/expected_output/pbization.py +274 -0
- dev/test_data/python_protobuf/test_main/concrete_class_with_primitive_attributes/meta_model.py +41 -0
- dev/test_data/rdf_shacl/test_main/expected/regression_when_lang_string_class_is_missing/meta_model.py +29 -0
- dev/test_data/rdf_shacl/test_main/expected/regression_when_len_constraints_on_inherited_property/meta_model.py +27 -0
- dev/test_data/rdf_shacl/test_main/unexpected/regression_len_constraint_on_class_property/meta_model.py +61 -0
- dev/test_data/real_meta_models/aas_core_meta.v3.py +5721 -0
- dev/test_data/smoke/test_main/unexpected/infer_for_schema_error/meta_model.py +12 -0
- dev/test_data/smoke/test_main/unexpected/intermediate_error/meta_model.py +18 -0
- dev/test_data/smoke/test_main/unexpected/parse_error/meta_model.py +5 -0
- dev/test_data/smoke/test_main/unexpected/pattern_verification_unparsable_regex/direct_match/meta_model.py +8 -0
- dev/test_data/smoke/test_main/unexpected/type_error/meta_model.py +18 -0
- dev/tests/__init__.py +1 -0
- dev/tests/common.py +197 -0
- dev/tests/cpp/__init__.py +0 -0
- dev/tests/cpp/test_common.py +32 -0
- dev/tests/cpp/test_main.py +144 -0
- dev/tests/cpp/test_pattern.py +188 -0
- dev/tests/cpp/test_verification.py +189 -0
- dev/tests/cpp/test_yielding.py +225 -0
- dev/tests/csharp/__init__.py +0 -0
- dev/tests/csharp/live_test_main.py +109 -0
- dev/tests/csharp/test_common.py +28 -0
- dev/tests/csharp/test_description.py +684 -0
- dev/tests/csharp/test_main.py +129 -0
- dev/tests/csharp/test_structure.py +93 -0
- dev/tests/csharp/test_verification.py +82 -0
- dev/tests/description.py +29 -0
- dev/tests/golang/__init__.py +0 -0
- dev/tests/golang/test_common.py +78 -0
- dev/tests/golang/test_main.py +128 -0
- dev/tests/infer_for_schema/__init__.py +0 -0
- dev/tests/infer_for_schema/common.py +47 -0
- dev/tests/infer_for_schema/test_len_on_properties.py +955 -0
- dev/tests/infer_for_schema/test_len_on_self.py +580 -0
- dev/tests/infer_for_schema/test_patterns_on_properties.py +686 -0
- dev/tests/infer_for_schema/test_patterns_on_self.py +258 -0
- dev/tests/infer_for_schema/test_property_in_set_of_enumeration_literals.py +600 -0
- dev/tests/infer_for_schema/test_property_in_set_of_primitives.py +549 -0
- dev/tests/intermediate/__init__.py +0 -0
- dev/tests/intermediate/test_constructor.py +719 -0
- dev/tests/intermediate/test_hierarchy.py +221 -0
- dev/tests/intermediate/test_revm.py +134 -0
- dev/tests/intermediate/test_translate.py +337 -0
- dev/tests/intermediate/test_type_inference.py +333 -0
- dev/tests/intermediate/test_types.py +169 -0
- dev/tests/java/__init__.py +0 -0
- dev/tests/java/test_common.py +20 -0
- dev/tests/java/test_description.py +128 -0
- dev/tests/java/test_main.py +234 -0
- dev/tests/jsonld_context/test_main.py +79 -0
- dev/tests/opcua/__init__.py +3 -0
- dev/tests/opcua/test_main.py +110 -0
- dev/tests/our_jsonschema/__init__.py +3 -0
- dev/tests/our_jsonschema/test_main.py +232 -0
- dev/tests/parse/__init__.py +0 -0
- dev/tests/parse/test_parse.py +503 -0
- dev/tests/parse/test_retree.py +272 -0
- dev/tests/proto/__init__.py +0 -0
- dev/tests/proto/test_main.py +112 -0
- dev/tests/python/__init__.py +0 -0
- dev/tests/python/test_common.py +124 -0
- dev/tests/python/test_main.py +126 -0
- dev/tests/python/test_xml_playground.py +254 -0
- dev/tests/python_protobuf/__init__.py +0 -0
- dev/tests/python_protobuf/test_main.py +111 -0
- dev/tests/rdf_shacl/__init__.py +0 -0
- dev/tests/rdf_shacl/test_common.py +32 -0
- dev/tests/rdf_shacl/test_description.py +223 -0
- dev/tests/rdf_shacl/test_main.py +194 -0
- dev/tests/smoke/__init__.py +0 -0
- dev/tests/smoke/test_main.py +83 -0
- dev/tests/test_common.py +94 -0
- dev/tests/typescript/__init__.py +0 -0
- dev/tests/typescript/test_common.py +108 -0
- dev/tests/typescript/test_main.py +125 -0
- dev/tests/xsd/__init__.py +0 -0
- dev/tests/xsd/test_main.py +227 -0
- dev/tests/yielding/__init__.py +0 -0
- dev/tests/yielding/test_linear.py +558 -0
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
"""Generate C# code to handle asset administration shells based on the meta-model."""
|
|
2
|
+
from typing import TextIO
|
|
3
|
+
|
|
4
|
+
from aas_core_codegen import specific_implementations, run, intermediate
|
|
5
|
+
from aas_core_codegen.csharp import (
|
|
6
|
+
common as csharp_common,
|
|
7
|
+
constants as csharp_constants,
|
|
8
|
+
structure as csharp_structure,
|
|
9
|
+
visitation as csharp_visitation,
|
|
10
|
+
verification as csharp_verification,
|
|
11
|
+
reporting as csharp_reporting,
|
|
12
|
+
stringification as csharp_stringification,
|
|
13
|
+
jsonization as csharp_jsonization,
|
|
14
|
+
xmlization as csharp_xmlization,
|
|
15
|
+
copying as csharp_copying,
|
|
16
|
+
enhancing as csharp_enhancing,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def execute(context: run.Context, stdout: TextIO, stderr: TextIO) -> int:
|
|
21
|
+
"""Generate the code."""
|
|
22
|
+
verified_ir_table, errors = csharp_structure.verify(
|
|
23
|
+
symbol_table=context.symbol_table
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
if errors is not None:
|
|
27
|
+
run.write_error_report(
|
|
28
|
+
message=f"Failed to verify the intermediate symbol table "
|
|
29
|
+
f"for generation of C# code"
|
|
30
|
+
f"based on {context.model_path}",
|
|
31
|
+
errors=[context.lineno_columner.error_message(error) for error in errors],
|
|
32
|
+
stderr=stderr,
|
|
33
|
+
)
|
|
34
|
+
return 1
|
|
35
|
+
|
|
36
|
+
assert verified_ir_table is not None
|
|
37
|
+
|
|
38
|
+
unsupported_contracts_errors = (
|
|
39
|
+
intermediate.errors_if_contracts_for_functions_or_methods_defined(
|
|
40
|
+
verified_ir_table
|
|
41
|
+
)
|
|
42
|
+
)
|
|
43
|
+
if unsupported_contracts_errors is not None:
|
|
44
|
+
run.write_error_report(
|
|
45
|
+
message=f"We do not support pre and post-conditions and snapshots "
|
|
46
|
+
f"at the moment. Please notify the developers if you need this "
|
|
47
|
+
f"feature (based on meta-model {context.model_path})",
|
|
48
|
+
errors=[
|
|
49
|
+
context.lineno_columner.error_message(error)
|
|
50
|
+
for error in unsupported_contracts_errors
|
|
51
|
+
],
|
|
52
|
+
stderr=stderr,
|
|
53
|
+
)
|
|
54
|
+
return 1
|
|
55
|
+
|
|
56
|
+
unsupported_methods_errors = (
|
|
57
|
+
intermediate.errors_if_non_implementation_specific_methods(verified_ir_table)
|
|
58
|
+
)
|
|
59
|
+
if unsupported_methods_errors is not None:
|
|
60
|
+
run.write_error_report(
|
|
61
|
+
message=f"We added some support for understood methods already and keep "
|
|
62
|
+
f"maintaining it as it is only a matter of time when we will "
|
|
63
|
+
f"introduce their transpilation. Introducing them after the fact "
|
|
64
|
+
f"would have been much more difficult.\n"
|
|
65
|
+
f"\n"
|
|
66
|
+
f"At the given moment, however, we deliberately focus only on "
|
|
67
|
+
f"implementation-specific methods. "
|
|
68
|
+
f"(based on meta-model {context.model_path})",
|
|
69
|
+
errors=[
|
|
70
|
+
context.lineno_columner.error_message(error)
|
|
71
|
+
for error in unsupported_methods_errors
|
|
72
|
+
],
|
|
73
|
+
stderr=stderr,
|
|
74
|
+
)
|
|
75
|
+
return 1
|
|
76
|
+
|
|
77
|
+
namespace_key = specific_implementations.ImplementationKey("namespace.txt")
|
|
78
|
+
namespace_text = context.spec_impls.get(namespace_key, None)
|
|
79
|
+
if namespace_text is None:
|
|
80
|
+
stderr.write(f"The namespace snippet is missing: {namespace_key}\n")
|
|
81
|
+
return 1
|
|
82
|
+
|
|
83
|
+
if not csharp_common.NAMESPACE_IDENTIFIER_RE.fullmatch(namespace_text):
|
|
84
|
+
stderr.write(
|
|
85
|
+
f"The text from the snippet {namespace_key} "
|
|
86
|
+
f"is not a valid namespace identifier: {namespace_text!r}\n"
|
|
87
|
+
)
|
|
88
|
+
return 1
|
|
89
|
+
|
|
90
|
+
namespace = csharp_common.NamespaceIdentifier(namespace_text)
|
|
91
|
+
|
|
92
|
+
# region Structure
|
|
93
|
+
|
|
94
|
+
code, errors = csharp_structure.generate(
|
|
95
|
+
symbol_table=verified_ir_table,
|
|
96
|
+
namespace=namespace,
|
|
97
|
+
spec_impls=context.spec_impls,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
if errors is not None:
|
|
101
|
+
run.write_error_report(
|
|
102
|
+
message=f"Failed to generate the structures in the C# code "
|
|
103
|
+
f"based on {context.model_path}",
|
|
104
|
+
errors=[context.lineno_columner.error_message(error) for error in errors],
|
|
105
|
+
stderr=stderr,
|
|
106
|
+
)
|
|
107
|
+
return 1
|
|
108
|
+
|
|
109
|
+
assert code is not None
|
|
110
|
+
|
|
111
|
+
pth = context.output_dir / "types.cs"
|
|
112
|
+
try:
|
|
113
|
+
pth.write_text(code, encoding="utf-8")
|
|
114
|
+
except Exception as exception:
|
|
115
|
+
run.write_error_report(
|
|
116
|
+
message=f"Failed to write the C# structures to {pth}",
|
|
117
|
+
errors=[str(exception)],
|
|
118
|
+
stderr=stderr,
|
|
119
|
+
)
|
|
120
|
+
return 1
|
|
121
|
+
|
|
122
|
+
# endregion
|
|
123
|
+
|
|
124
|
+
# region Visitation
|
|
125
|
+
|
|
126
|
+
code, errors = csharp_visitation.generate(
|
|
127
|
+
symbol_table=context.symbol_table, namespace=namespace
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
if errors is not None:
|
|
131
|
+
run.write_error_report(
|
|
132
|
+
message=f"Failed to generate the C# code for visitation "
|
|
133
|
+
f"based on {context.model_path}",
|
|
134
|
+
errors=[context.lineno_columner.error_message(error) for error in errors],
|
|
135
|
+
stderr=stderr,
|
|
136
|
+
)
|
|
137
|
+
return 1
|
|
138
|
+
|
|
139
|
+
assert code is not None
|
|
140
|
+
|
|
141
|
+
pth = context.output_dir / "visitation.cs"
|
|
142
|
+
try:
|
|
143
|
+
pth.write_text(code, encoding="utf-8")
|
|
144
|
+
except Exception as exception:
|
|
145
|
+
run.write_error_report(
|
|
146
|
+
message=f"Failed to write the visitation C# code to {pth}",
|
|
147
|
+
errors=[str(exception)],
|
|
148
|
+
stderr=stderr,
|
|
149
|
+
)
|
|
150
|
+
return 1
|
|
151
|
+
|
|
152
|
+
# endregion
|
|
153
|
+
|
|
154
|
+
# region Constants
|
|
155
|
+
|
|
156
|
+
code, errors = csharp_constants.generate(
|
|
157
|
+
symbol_table=context.symbol_table,
|
|
158
|
+
namespace=namespace,
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
if errors is not None:
|
|
162
|
+
run.write_error_report(
|
|
163
|
+
message=f"Failed to generate the constants in the C# code "
|
|
164
|
+
f"based on {context.model_path}",
|
|
165
|
+
errors=[context.lineno_columner.error_message(error) for error in errors],
|
|
166
|
+
stderr=stderr,
|
|
167
|
+
)
|
|
168
|
+
return 1
|
|
169
|
+
|
|
170
|
+
assert code is not None
|
|
171
|
+
|
|
172
|
+
pth = context.output_dir / "constants.cs"
|
|
173
|
+
pth.parent.mkdir(exist_ok=True)
|
|
174
|
+
|
|
175
|
+
try:
|
|
176
|
+
pth.write_text(code, encoding="utf-8")
|
|
177
|
+
except Exception as exception:
|
|
178
|
+
run.write_error_report(
|
|
179
|
+
message=f"Failed to write the constants in the C# code to {pth}",
|
|
180
|
+
errors=[str(exception)],
|
|
181
|
+
stderr=stderr,
|
|
182
|
+
)
|
|
183
|
+
return 1
|
|
184
|
+
|
|
185
|
+
# endregion
|
|
186
|
+
|
|
187
|
+
# region Verification
|
|
188
|
+
|
|
189
|
+
verify_errors = csharp_verification.verify(
|
|
190
|
+
spec_impls=context.spec_impls,
|
|
191
|
+
verification_functions=verified_ir_table.verification_functions,
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
if verify_errors is not None:
|
|
195
|
+
run.write_error_report(
|
|
196
|
+
message="Failed to verify for generation of C# verification code",
|
|
197
|
+
errors=verify_errors,
|
|
198
|
+
stderr=stderr,
|
|
199
|
+
)
|
|
200
|
+
return 1
|
|
201
|
+
|
|
202
|
+
code, errors = csharp_verification.generate(
|
|
203
|
+
symbol_table=verified_ir_table,
|
|
204
|
+
namespace=namespace,
|
|
205
|
+
spec_impls=context.spec_impls,
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
if errors is not None:
|
|
209
|
+
run.write_error_report(
|
|
210
|
+
message=f"Failed to generate the verification C# code "
|
|
211
|
+
f"based on {context.model_path}",
|
|
212
|
+
errors=[context.lineno_columner.error_message(error) for error in errors],
|
|
213
|
+
stderr=stderr,
|
|
214
|
+
)
|
|
215
|
+
return 1
|
|
216
|
+
|
|
217
|
+
assert code is not None
|
|
218
|
+
|
|
219
|
+
pth = context.output_dir / "verification.cs"
|
|
220
|
+
try:
|
|
221
|
+
pth.write_text(code, encoding="utf-8")
|
|
222
|
+
except Exception as exception:
|
|
223
|
+
run.write_error_report(
|
|
224
|
+
message=f"Failed to write the verification C# code to {pth}",
|
|
225
|
+
errors=[str(exception)],
|
|
226
|
+
stderr=stderr,
|
|
227
|
+
)
|
|
228
|
+
return 1
|
|
229
|
+
|
|
230
|
+
# endregion
|
|
231
|
+
|
|
232
|
+
# region Reporting
|
|
233
|
+
|
|
234
|
+
code = csharp_reporting.generate(namespace=namespace)
|
|
235
|
+
|
|
236
|
+
pth = context.output_dir / "reporting.cs"
|
|
237
|
+
pth.parent.mkdir(exist_ok=True)
|
|
238
|
+
|
|
239
|
+
try:
|
|
240
|
+
pth.write_text(code, encoding="utf-8")
|
|
241
|
+
except Exception as exception:
|
|
242
|
+
run.write_error_report(
|
|
243
|
+
message=f"Failed to write the reporting C# code to {pth}",
|
|
244
|
+
errors=[str(exception)],
|
|
245
|
+
stderr=stderr,
|
|
246
|
+
)
|
|
247
|
+
return 1
|
|
248
|
+
|
|
249
|
+
# endregion
|
|
250
|
+
|
|
251
|
+
# region Stringification
|
|
252
|
+
|
|
253
|
+
code, errors = csharp_stringification.generate(
|
|
254
|
+
symbol_table=context.symbol_table, namespace=namespace
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
if errors is not None:
|
|
258
|
+
run.write_error_report(
|
|
259
|
+
message=f"Failed to generate the stringification C# code "
|
|
260
|
+
f"based on {context.model_path}",
|
|
261
|
+
errors=[context.lineno_columner.error_message(error) for error in errors],
|
|
262
|
+
stderr=stderr,
|
|
263
|
+
)
|
|
264
|
+
return 1
|
|
265
|
+
|
|
266
|
+
assert code is not None
|
|
267
|
+
|
|
268
|
+
pth = context.output_dir / "stringification.cs"
|
|
269
|
+
pth.parent.mkdir(exist_ok=True)
|
|
270
|
+
|
|
271
|
+
try:
|
|
272
|
+
pth.write_text(code, encoding="utf-8")
|
|
273
|
+
except Exception as exception:
|
|
274
|
+
run.write_error_report(
|
|
275
|
+
message=f"Failed to write the stringification C# code to {pth}",
|
|
276
|
+
errors=[str(exception)],
|
|
277
|
+
stderr=stderr,
|
|
278
|
+
)
|
|
279
|
+
return 1
|
|
280
|
+
|
|
281
|
+
# endregion
|
|
282
|
+
|
|
283
|
+
# region Jsonization
|
|
284
|
+
|
|
285
|
+
code, errors = csharp_jsonization.generate(
|
|
286
|
+
symbol_table=context.symbol_table,
|
|
287
|
+
namespace=namespace,
|
|
288
|
+
spec_impls=context.spec_impls,
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
if errors is not None:
|
|
292
|
+
run.write_error_report(
|
|
293
|
+
message=f"Failed to generate the jsonization C# code "
|
|
294
|
+
f"based on {context.model_path}",
|
|
295
|
+
errors=[context.lineno_columner.error_message(error) for error in errors],
|
|
296
|
+
stderr=stderr,
|
|
297
|
+
)
|
|
298
|
+
return 1
|
|
299
|
+
|
|
300
|
+
assert code is not None
|
|
301
|
+
|
|
302
|
+
pth = context.output_dir / "jsonization.cs"
|
|
303
|
+
pth.parent.mkdir(exist_ok=True)
|
|
304
|
+
|
|
305
|
+
try:
|
|
306
|
+
pth.write_text(code, encoding="utf-8")
|
|
307
|
+
except Exception as exception:
|
|
308
|
+
run.write_error_report(
|
|
309
|
+
message=f"Failed to write the jsonization C# code to {pth}",
|
|
310
|
+
errors=[str(exception)],
|
|
311
|
+
stderr=stderr,
|
|
312
|
+
)
|
|
313
|
+
return 1
|
|
314
|
+
|
|
315
|
+
# endregion
|
|
316
|
+
|
|
317
|
+
# region Xmlization
|
|
318
|
+
|
|
319
|
+
code, errors = csharp_xmlization.generate(
|
|
320
|
+
symbol_table=context.symbol_table,
|
|
321
|
+
namespace=namespace,
|
|
322
|
+
spec_impls=context.spec_impls,
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
if errors is not None:
|
|
326
|
+
run.write_error_report(
|
|
327
|
+
message=f"Failed to generate the xmlization C# code "
|
|
328
|
+
f"based on {context.model_path}",
|
|
329
|
+
errors=[context.lineno_columner.error_message(error) for error in errors],
|
|
330
|
+
stderr=stderr,
|
|
331
|
+
)
|
|
332
|
+
return 1
|
|
333
|
+
|
|
334
|
+
assert code is not None
|
|
335
|
+
|
|
336
|
+
pth = context.output_dir / "xmlization.cs"
|
|
337
|
+
pth.parent.mkdir(exist_ok=True)
|
|
338
|
+
|
|
339
|
+
try:
|
|
340
|
+
pth.write_text(code, encoding="utf-8")
|
|
341
|
+
except Exception as exception:
|
|
342
|
+
run.write_error_report(
|
|
343
|
+
message=f"Failed to write the xmlization C# code to {pth}",
|
|
344
|
+
errors=[str(exception)],
|
|
345
|
+
stderr=stderr,
|
|
346
|
+
)
|
|
347
|
+
return 1
|
|
348
|
+
|
|
349
|
+
# endregion
|
|
350
|
+
|
|
351
|
+
# region Copying
|
|
352
|
+
|
|
353
|
+
code, errors = csharp_copying.generate(
|
|
354
|
+
symbol_table=context.symbol_table,
|
|
355
|
+
namespace=namespace,
|
|
356
|
+
spec_impls=context.spec_impls,
|
|
357
|
+
)
|
|
358
|
+
|
|
359
|
+
if errors is not None:
|
|
360
|
+
run.write_error_report(
|
|
361
|
+
message=f"Failed to generate the C# code for shallow and deep copying "
|
|
362
|
+
f"based on {context.model_path}",
|
|
363
|
+
errors=[context.lineno_columner.error_message(error) for error in errors],
|
|
364
|
+
stderr=stderr,
|
|
365
|
+
)
|
|
366
|
+
return 1
|
|
367
|
+
|
|
368
|
+
assert code is not None
|
|
369
|
+
|
|
370
|
+
pth = context.output_dir / "copying.cs"
|
|
371
|
+
pth.parent.mkdir(exist_ok=True)
|
|
372
|
+
|
|
373
|
+
try:
|
|
374
|
+
pth.write_text(code, encoding="utf-8")
|
|
375
|
+
except Exception as exception:
|
|
376
|
+
run.write_error_report(
|
|
377
|
+
message=f"Failed to write the C# code for shallow and deep copying "
|
|
378
|
+
f"to {pth}",
|
|
379
|
+
errors=[str(exception)],
|
|
380
|
+
stderr=stderr,
|
|
381
|
+
)
|
|
382
|
+
return 1
|
|
383
|
+
|
|
384
|
+
# endregion
|
|
385
|
+
|
|
386
|
+
# region Enhancing
|
|
387
|
+
|
|
388
|
+
code, errors = csharp_enhancing.generate(
|
|
389
|
+
symbol_table=context.symbol_table,
|
|
390
|
+
namespace=namespace,
|
|
391
|
+
spec_impls=context.spec_impls,
|
|
392
|
+
)
|
|
393
|
+
|
|
394
|
+
if errors is not None:
|
|
395
|
+
run.write_error_report(
|
|
396
|
+
message=f"Failed to generate the C# code for enhancing "
|
|
397
|
+
f"based on {context.model_path}",
|
|
398
|
+
errors=[context.lineno_columner.error_message(error) for error in errors],
|
|
399
|
+
stderr=stderr,
|
|
400
|
+
)
|
|
401
|
+
return 1
|
|
402
|
+
|
|
403
|
+
assert code is not None
|
|
404
|
+
|
|
405
|
+
pth = context.output_dir / "enhancing.cs"
|
|
406
|
+
pth.parent.mkdir(exist_ok=True)
|
|
407
|
+
|
|
408
|
+
try:
|
|
409
|
+
pth.write_text(code, encoding="utf-8")
|
|
410
|
+
except Exception as exception:
|
|
411
|
+
run.write_error_report(
|
|
412
|
+
message=f"Failed to write the C# code for enhancing to {pth}",
|
|
413
|
+
errors=[str(exception)],
|
|
414
|
+
stderr=stderr,
|
|
415
|
+
)
|
|
416
|
+
return 1
|
|
417
|
+
|
|
418
|
+
# endregion
|
|
419
|
+
|
|
420
|
+
stdout.write(f"Code generated to: {context.output_dir}\n")
|
|
421
|
+
return 0
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"""Generate C# identifiers based on the identifiers from the meta-model."""
|
|
2
|
+
from typing import Union
|
|
3
|
+
|
|
4
|
+
import aas_core_codegen.naming
|
|
5
|
+
from aas_core_codegen import intermediate
|
|
6
|
+
from aas_core_codegen.common import Identifier, assert_never
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def interface_name(identifier: Identifier) -> Identifier:
|
|
10
|
+
"""
|
|
11
|
+
Generate a C# interface name based on its meta-model ``identifier``.
|
|
12
|
+
|
|
13
|
+
>>> interface_name(Identifier("something"))
|
|
14
|
+
'ISomething'
|
|
15
|
+
|
|
16
|
+
>>> interface_name(Identifier("URL_to_something"))
|
|
17
|
+
'IUrlToSomething'
|
|
18
|
+
"""
|
|
19
|
+
return Identifier(f"I{aas_core_codegen.naming.capitalized_camel_case(identifier)}")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def enum_name(identifier: Identifier) -> Identifier:
|
|
23
|
+
"""
|
|
24
|
+
Generate a C# name for an enum based on its meta-model ``identifier``.
|
|
25
|
+
|
|
26
|
+
>>> enum_name(Identifier("something"))
|
|
27
|
+
'Something'
|
|
28
|
+
|
|
29
|
+
>>> enum_name(Identifier("URL_to_something"))
|
|
30
|
+
'UrlToSomething'
|
|
31
|
+
"""
|
|
32
|
+
return aas_core_codegen.naming.capitalized_camel_case(identifier)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def enum_literal_name(identifier: Identifier) -> Identifier:
|
|
36
|
+
"""
|
|
37
|
+
Generate a C# name for an enum literal based on its meta-model ``identifier``.
|
|
38
|
+
|
|
39
|
+
>>> enum_literal_name(Identifier("something"))
|
|
40
|
+
'Something'
|
|
41
|
+
|
|
42
|
+
>>> enum_literal_name(Identifier("URL_to_something"))
|
|
43
|
+
'UrlToSomething'
|
|
44
|
+
"""
|
|
45
|
+
return aas_core_codegen.naming.capitalized_camel_case(identifier)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def class_name(identifier: Identifier) -> Identifier:
|
|
49
|
+
"""
|
|
50
|
+
Generate a C# name for a class based on its meta-model ``identifier``.
|
|
51
|
+
|
|
52
|
+
>>> class_name(Identifier("something"))
|
|
53
|
+
'Something'
|
|
54
|
+
|
|
55
|
+
>>> class_name(Identifier("URL_to_something"))
|
|
56
|
+
'UrlToSomething'
|
|
57
|
+
"""
|
|
58
|
+
return aas_core_codegen.naming.capitalized_camel_case(identifier)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def name_of(
|
|
62
|
+
something: Union[
|
|
63
|
+
intermediate.Enumeration, intermediate.ConcreteClass, intermediate.Interface
|
|
64
|
+
]
|
|
65
|
+
) -> Identifier:
|
|
66
|
+
"""Dispatch to the appropriate naming function."""
|
|
67
|
+
if isinstance(something, intermediate.Enumeration):
|
|
68
|
+
return enum_name(something.name)
|
|
69
|
+
|
|
70
|
+
elif isinstance(something, intermediate.ConcreteClass):
|
|
71
|
+
return class_name(something.name)
|
|
72
|
+
|
|
73
|
+
elif isinstance(something, intermediate.Interface):
|
|
74
|
+
return interface_name(something.name)
|
|
75
|
+
|
|
76
|
+
else:
|
|
77
|
+
assert_never(something)
|
|
78
|
+
|
|
79
|
+
raise AssertionError("Should not have gotten here")
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def property_name(identifier: Identifier) -> Identifier:
|
|
83
|
+
"""
|
|
84
|
+
Generate a C# name for a public property based on its meta-model ``identifier``.
|
|
85
|
+
|
|
86
|
+
>>> property_name(Identifier("something"))
|
|
87
|
+
'Something'
|
|
88
|
+
|
|
89
|
+
>>> property_name(Identifier("something_to_URL"))
|
|
90
|
+
'SomethingToUrl'
|
|
91
|
+
"""
|
|
92
|
+
return aas_core_codegen.naming.capitalized_camel_case(identifier)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def private_property_name(identifier: Identifier) -> Identifier:
|
|
96
|
+
"""
|
|
97
|
+
Generate a C# name for a private property based on the ``identifier``.
|
|
98
|
+
|
|
99
|
+
>>> private_property_name(Identifier("something"))
|
|
100
|
+
'_something'
|
|
101
|
+
|
|
102
|
+
>>> private_property_name(Identifier("something_to_URL"))
|
|
103
|
+
'_somethingToUrl'
|
|
104
|
+
"""
|
|
105
|
+
return Identifier(f"_{aas_core_codegen.naming.lower_camel_case(identifier)}")
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def private_method_name(identifier: Identifier) -> Identifier:
|
|
109
|
+
"""
|
|
110
|
+
Generate a C# name for a private method based on the ``identifier``.
|
|
111
|
+
|
|
112
|
+
>>> private_method_name(Identifier("something"))
|
|
113
|
+
'_something'
|
|
114
|
+
|
|
115
|
+
>>> private_method_name(Identifier("something_to_URL"))
|
|
116
|
+
'_somethingToUrl'
|
|
117
|
+
"""
|
|
118
|
+
return Identifier(f"_{aas_core_codegen.naming.lower_camel_case(identifier)}")
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def method_name(identifier: Identifier) -> Identifier:
|
|
122
|
+
"""
|
|
123
|
+
Generate a C# name for a member method based on its meta-model ``identifier``.
|
|
124
|
+
|
|
125
|
+
>>> method_name(Identifier("do_something"))
|
|
126
|
+
'DoSomething'
|
|
127
|
+
|
|
128
|
+
>>> method_name(Identifier("do_something_to_URL"))
|
|
129
|
+
'DoSomethingToUrl'
|
|
130
|
+
"""
|
|
131
|
+
return aas_core_codegen.naming.capitalized_camel_case(identifier)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def argument_name(identifier: Identifier) -> Identifier:
|
|
135
|
+
"""
|
|
136
|
+
Generate a C# name for an argument based on its meta-model ``identifier``.
|
|
137
|
+
|
|
138
|
+
>>> argument_name(Identifier("something"))
|
|
139
|
+
'something'
|
|
140
|
+
|
|
141
|
+
>>> argument_name(Identifier("something_to_URL"))
|
|
142
|
+
'somethingToUrl'
|
|
143
|
+
"""
|
|
144
|
+
return aas_core_codegen.naming.lower_camel_case(identifier)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def variable_name(identifier: Identifier) -> Identifier:
|
|
148
|
+
"""
|
|
149
|
+
Generate a C# name for a variable based on its meta-model ``identifier``.
|
|
150
|
+
|
|
151
|
+
>>> variable_name(Identifier("something"))
|
|
152
|
+
'something'
|
|
153
|
+
|
|
154
|
+
>>> variable_name(Identifier("something_to_URL"))
|
|
155
|
+
'somethingToUrl'
|
|
156
|
+
"""
|
|
157
|
+
return aas_core_codegen.naming.lower_camel_case(identifier)
|