expressir 0.2.4-x64-mingw32 → 0.2.10-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.cross_rubies +30 -0
- data/.github/workflows/rake.yml +45 -46
- data/.github/workflows/release.yml +83 -75
- data/.gitignore +17 -15
- data/.gitmodules +3 -3
- data/.rspec +2 -2
- data/.rubocop.yml +508 -508
- data/Gemfile +4 -6
- data/README.adoc +147 -147
- data/Rakefile +11 -17
- data/bin/console +12 -12
- data/bin/rspec +29 -29
- data/bin/setup +8 -8
- data/demo.rb +18 -18
- data/docs/development.md +90 -90
- data/exe/expressir +20 -20
- data/exe/generate-parser +47 -47
- data/expressir.gemspec +43 -40
- data/lib/expressir.rb +21 -21
- data/lib/expressir/cli.rb +27 -27
- data/lib/expressir/cli/ui.rb +36 -36
- data/lib/expressir/config.rb +23 -23
- data/lib/expressir/express.rb +11 -11
- data/lib/expressir/express/aggregate_dimension.rb +38 -38
- data/lib/expressir/express/attribute.rb +15 -15
- data/lib/expressir/express/comment.rb +7 -7
- data/lib/expressir/express/defined_type.rb +36 -36
- data/lib/expressir/express/derived.rb +65 -65
- data/lib/expressir/express/derived_aggregate.rb +43 -43
- data/lib/expressir/express/entity.rb +137 -137
- data/lib/expressir/express/explicit.rb +70 -70
- data/lib/expressir/express/explicit_aggregate.rb +46 -46
- data/lib/expressir/express/explicit_or_derived.rb +16 -16
- data/lib/expressir/express/global_rule.rb +44 -44
- data/lib/expressir/express/interface_specification.rb +51 -51
- data/lib/expressir/express/interfaced_item.rb +38 -38
- data/lib/expressir/express/inverse.rb +46 -46
- data/lib/expressir/express/inverse_aggregate.rb +37 -37
- data/lib/expressir/express/model_element.rb +7 -7
- data/lib/expressir/express/named_type.rb +19 -19
- data/lib/expressir/express/remark.rb +8 -8
- data/lib/expressir/express/repository.rb +306 -306
- data/lib/expressir/express/schema_definition.rb +96 -96
- data/lib/expressir/express/subtype_constraint.rb +14 -14
- data/lib/expressir/express/type.rb +26 -26
- data/lib/expressir/express/type_aggregate.rb +42 -42
- data/lib/expressir/express/type_enum.rb +29 -29
- data/lib/expressir/express/type_parser.rb +45 -45
- data/lib/expressir/express/type_select.rb +82 -82
- data/lib/expressir/express/unique_rule.rb +35 -35
- data/lib/expressir/express/where_rule.rb +32 -32
- data/lib/expressir/express_exp/2.4/express_parser.so +0 -0
- data/lib/expressir/express_exp/2.5/express_parser.so +0 -0
- data/lib/expressir/express_exp/2.6/express_parser.so +0 -0
- data/lib/expressir/express_exp/2.7/express_parser.so +0 -0
- data/lib/expressir/express_exp/3.0/express_parser.so +0 -0
- data/lib/expressir/express_exp/formatter.rb +1500 -1449
- data/lib/expressir/express_exp/parser.rb +53 -35
- data/lib/expressir/express_exp/visitor.rb +2555 -2450
- data/lib/expressir/express_parser.rb +30 -30
- data/lib/expressir/model.rb +67 -64
- data/lib/expressir/model/attribute.rb +28 -26
- data/lib/expressir/model/constant.rb +18 -16
- data/lib/expressir/model/entity.rb +38 -45
- data/lib/expressir/model/enumeration_item.rb +12 -10
- data/lib/expressir/model/expressions/aggregate_initializer.rb +12 -12
- data/lib/expressir/model/expressions/aggregate_item.rb +14 -14
- data/lib/expressir/model/expressions/attribute_reference.rb +14 -14
- data/lib/expressir/model/expressions/binary_expression.rb +39 -39
- data/lib/expressir/model/expressions/call.rb +14 -14
- data/lib/expressir/model/expressions/entity_constructor.rb +14 -14
- data/lib/expressir/model/expressions/group_reference.rb +14 -14
- data/lib/expressir/model/expressions/index_reference.rb +16 -16
- data/lib/expressir/model/expressions/interval.rb +20 -20
- data/lib/expressir/model/expressions/query_expression.rb +27 -25
- data/lib/expressir/model/expressions/simple_reference.rb +12 -12
- data/lib/expressir/model/expressions/unary_expression.rb +18 -18
- data/lib/expressir/model/function.rb +55 -61
- data/lib/expressir/model/identifier.rb +9 -8
- data/lib/expressir/model/informal_proposition.rb +13 -0
- data/lib/expressir/model/interface.rb +17 -17
- data/lib/expressir/model/literals/binary.rb +12 -12
- data/lib/expressir/model/literals/integer.rb +12 -12
- data/lib/expressir/model/literals/logical.rb +16 -16
- data/lib/expressir/model/literals/real.rb +12 -12
- data/lib/expressir/model/literals/string.rb +14 -14
- data/lib/expressir/model/model_element.rb +67 -0
- data/lib/expressir/model/parameter.rb +18 -16
- data/lib/expressir/model/procedure.rb +53 -59
- data/lib/expressir/model/renamed_ref.rb +12 -12
- data/lib/expressir/model/repository.rb +18 -18
- data/lib/expressir/model/rule.rb +58 -61
- data/lib/expressir/model/schema.rb +55 -66
- data/lib/expressir/model/scope.rb +62 -16
- data/lib/expressir/model/statements/alias.rb +27 -25
- data/lib/expressir/model/statements/assignment.rb +14 -14
- data/lib/expressir/model/statements/call.rb +14 -14
- data/lib/expressir/model/statements/case.rb +16 -16
- data/lib/expressir/model/statements/case_action.rb +14 -14
- data/lib/expressir/model/statements/compound.rb +12 -12
- data/lib/expressir/model/statements/escape.rb +7 -7
- data/lib/expressir/model/statements/if.rb +16 -16
- data/lib/expressir/model/statements/null.rb +7 -7
- data/lib/expressir/model/statements/repeat.rb +35 -33
- data/lib/expressir/model/statements/return.rb +12 -12
- data/lib/expressir/model/statements/skip.rb +7 -7
- data/lib/expressir/model/subtype_constraint.rb +28 -26
- data/lib/expressir/model/type.rb +33 -23
- data/lib/expressir/model/types/aggregate.rb +18 -16
- data/lib/expressir/model/types/array.rb +20 -20
- data/lib/expressir/model/types/bag.rb +16 -16
- data/lib/expressir/model/types/binary.rb +14 -14
- data/lib/expressir/model/types/boolean.rb +7 -7
- data/lib/expressir/model/types/enumeration.rb +18 -18
- data/lib/expressir/model/types/generic.rb +14 -12
- data/lib/expressir/model/types/generic_entity.rb +14 -12
- data/lib/expressir/model/types/integer.rb +7 -7
- data/lib/expressir/model/types/list.rb +18 -18
- data/lib/expressir/model/types/logical.rb +7 -7
- data/lib/expressir/model/types/number.rb +7 -7
- data/lib/expressir/model/types/real.rb +12 -12
- data/lib/expressir/model/types/select.rb +20 -20
- data/lib/expressir/model/types/set.rb +16 -16
- data/lib/expressir/model/types/string.rb +14 -14
- data/lib/expressir/model/unique.rb +16 -14
- data/lib/expressir/model/variable.rb +18 -16
- data/lib/expressir/model/where.rb +16 -14
- data/lib/expressir/parser.rb +6 -6
- data/lib/expressir/parser/owl_parser.rb +8 -8
- data/lib/expressir/version.rb +3 -3
- data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.exp +9589 -9589
- data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.owl +36619 -36619
- data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.xml +13293 -13293
- data/original/examples/employment/eclipse/.project +17 -17
- data/original/examples/employment/eclipse/Express/employment_schema.exp +33 -33
- data/original/examples/employment/eclipse/Express/employment_schema.xmi +77 -77
- data/original/examples/employment/eclipse/Express/employment_schema.xml +92 -92
- data/original/examples/employment/eclipse/Models/Employment.uml +4 -4
- data/original/examples/employment/eclipse/Models/Employment.umldi +240 -240
- data/original/examples/employment/eclipse/readme.txt +6 -6
- data/original/examples/employment/employment_schema.exp +33 -33
- data/original/examples/employment/employment_schema.rb +232 -232
- data/original/examples/employment/employment_schema.xml +92 -92
- data/original/examples/employment/employment_schema___module.rb +46 -46
- data/original/examples/employment/employment_schema___p28attr.rb +126 -126
- data/original/examples/employment/employment_schema___p28inst.rb +26 -26
- data/original/examples/employment/example_employment_data.xml +1 -1
- data/original/examples/employment/example_employment_data_copy.xml +1 -1
- data/original/examples/employment/example_employment_reader.rb +30 -30
- data/original/examples/employment/example_employment_writer.rb +51 -51
- data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.exp +3710 -3710
- data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.owl +35880 -35880
- data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.xmi +15357 -15357
- data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.xml +9467 -9467
- data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.exp +8404 -8404
- data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.owl +43147 -43147
- data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xmi +18341 -18341
- data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xml +11631 -11631
- data/original/examples/syntax/remark.exp +189 -145
- data/original/examples/syntax/remark_formatted.exp +213 -174
- data/original/examples/syntax/simple.exp +3 -0
- data/original/examples/syntax/source.exp +16 -0
- data/original/examples/syntax/syntax.exp +323 -310
- data/original/examples/syntax/syntax_formatted.exp +753 -1186
- data/original/exp2ruby.rb +525 -525
- data/original/expsm.rb +34 -34
- data/original/mapping_owl.rb +1018 -1018
- data/original/mapping_sysml.rb +2281 -2281
- data/original/mapping_uml2.rb +598 -598
- data/original/mapping_uml2_eclipse.rb +433 -433
- data/original/reeper.rb +134 -134
- data/rakelib/cross-ruby.rake +308 -0
- data/spec/acceptance/express_to_owl_spec.rb +18 -18
- data/spec/acceptance/version_spec.rb +12 -12
- data/spec/expressir/express/repository_spec.rb +25 -25
- data/spec/expressir/express_exp/ap233_spec.rb +22 -22
- data/spec/expressir/express_exp/format_remark_spec.rb +28 -28
- data/spec/expressir/express_exp/format_syntax_spec.rb +28 -28
- data/spec/expressir/express_exp/head_source_spec.rb +38 -0
- data/spec/expressir/express_exp/parse_multiple_spec.rb +32 -0
- data/spec/expressir/express_exp/parse_remark_spec.rb +411 -345
- data/spec/expressir/express_exp/parse_syntax_spec.rb +3048 -2998
- data/spec/expressir/express_exp/source_spec.rb +29 -0
- data/spec/expressir/model/model_element_spec.rb +59 -0
- data/spec/expressir/model/{find_spec.rb → scope_spec.rb} +123 -110
- data/spec/expressr_spec.rb +5 -5
- data/spec/spec_helper.rb +17 -17
- data/spec/support/console_helper.rb +29 -29
- metadata +41 -371
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/CMakeLists.txt +0 -118
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2013.vcxproj +0 -637
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2013.vcxproj.filters +0 -984
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2015.vcxproj +0 -652
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2015.vcxproj.filters +0 -990
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2017.vcxproj +0 -652
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2017.vcxproj.filters +0 -990
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj +0 -652
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj.filters +0 -990
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp-ios/Info.plist +0 -26
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp-ios/antlrcpp_ios.h +0 -17
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.pbxproj +0 -3024
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/xcshareddata/xcschemes/antlr4.xcscheme +0 -76
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/xcshareddata/xcschemes/antlr4_ios.xcscheme +0 -80
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/xcshareddata/xcschemes/antlr4_static.xcscheme +0 -80
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorListener.cpp +0 -10
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorListener.h +0 -167
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorStrategy.cpp +0 -10
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorStrategy.h +0 -121
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRFileStream.cpp +0 -34
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRFileStream.h +0 -27
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRInputStream.cpp +0 -155
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRInputStream.h +0 -69
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BailErrorStrategy.cpp +0 -61
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BailErrorStrategy.h +0 -59
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BaseErrorListener.cpp +0 -25
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BaseErrorListener.h +0 -36
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BufferedTokenStream.cpp +0 -414
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BufferedTokenStream.h +0 -200
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CharStream.cpp +0 -11
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CharStream.h +0 -37
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonToken.cpp +0 -195
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonToken.h +0 -158
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenFactory.cpp +0 -39
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenFactory.h +0 -74
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenStream.cpp +0 -78
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenStream.h +0 -79
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ConsoleErrorListener.cpp +0 -15
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ConsoleErrorListener.h +0 -35
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/DefaultErrorStrategy.cpp +0 -333
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/DefaultErrorStrategy.h +0 -466
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/DiagnosticErrorListener.cpp +0 -84
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/DiagnosticErrorListener.h +0 -80
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Exceptions.cpp +0 -64
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Exceptions.h +0 -99
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/FailedPredicateException.cpp +0 -51
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/FailedPredicateException.h +0 -32
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/InputMismatchException.cpp +0 -18
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/InputMismatchException.h +0 -24
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/IntStream.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/IntStream.h +0 -218
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/InterpreterRuleContext.cpp +0 -19
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/InterpreterRuleContext.h +0 -45
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Lexer.cpp +0 -295
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Lexer.h +0 -196
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerInterpreter.cpp +0 -75
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerInterpreter.h +0 -52
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerNoViableAltException.cpp +0 -36
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerNoViableAltException.h +0 -31
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ListTokenSource.cpp +0 -92
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ListTokenSource.h +0 -88
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/NoViableAltException.cpp +0 -46
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/NoViableAltException.h +0 -42
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Parser.cpp +0 -648
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Parser.h +0 -467
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserInterpreter.cpp +0 -306
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserInterpreter.h +0 -179
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserRuleContext.cpp +0 -141
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserRuleContext.h +0 -147
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ProxyErrorListener.cpp +0 -53
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ProxyErrorListener.h +0 -38
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RecognitionException.cpp +0 -66
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RecognitionException.h +0 -98
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Recognizer.cpp +0 -167
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Recognizer.h +0 -164
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContext.cpp +0 -143
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContext.h +0 -137
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContextWithAltNum.cpp +0 -27
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContextWithAltNum.h +0 -32
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuntimeMetaData.cpp +0 -53
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuntimeMetaData.h +0 -155
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Token.cpp +0 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Token.h +0 -92
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenFactory.h +0 -30
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenSource.cpp +0 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenSource.h +0 -85
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStream.cpp +0 -11
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStream.h +0 -137
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStreamRewriter.cpp +0 -425
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStreamRewriter.h +0 -293
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedCharStream.cpp +0 -211
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedCharStream.h +0 -123
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedTokenStream.cpp +0 -270
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedTokenStream.h +0 -115
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Vocabulary.cpp +0 -104
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Vocabulary.h +0 -193
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/WritableToken.cpp +0 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/WritableToken.h +0 -23
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/antlr4-common.h +0 -137
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/antlr4-runtime.h +0 -167
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATN.cpp +0 -209
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATN.h +0 -112
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfig.cpp +0 -113
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfig.h +0 -148
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfigSet.cpp +0 -228
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfigSet.h +0 -110
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.cpp +0 -64
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.h +0 -50
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializer.cpp +0 -758
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializer.h +0 -85
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSerializer.cpp +0 -621
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSerializer.h +0 -61
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSimulator.cpp +0 -63
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSimulator.h +0 -87
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNState.cpp +0 -72
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNState.h +0 -133
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNType.h +0 -20
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AbstractPredicateTransition.cpp +0 -14
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AbstractPredicateTransition.h +0 -24
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ActionTransition.cpp +0 -33
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ActionTransition.h +0 -33
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AmbiguityInfo.cpp +0 -16
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AmbiguityInfo.h +0 -68
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.cpp +0 -82
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.h +0 -43
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AtomTransition.cpp +0 -31
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AtomTransition.h +0 -30
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicBlockStartState.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicBlockStartState.h +0 -22
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicState.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicState.h +0 -21
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockEndState.cpp +0 -15
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockEndState.h +0 -24
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockStartState.cpp +0 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockStartState.h +0 -21
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ContextSensitivityInfo.cpp +0 -14
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ContextSensitivityInfo.h +0 -47
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionEventInfo.cpp +0 -14
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionEventInfo.h +0 -70
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionInfo.cpp +0 -25
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionInfo.h +0 -227
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionState.cpp +0 -17
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionState.h +0 -30
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EmptyPredictionContext.cpp +0 -35
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EmptyPredictionContext.h +0 -27
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EpsilonTransition.cpp +0 -35
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EpsilonTransition.h +0 -39
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ErrorInfo.cpp +0 -15
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ErrorInfo.h +0 -43
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LL1Analyzer.cpp +0 -158
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LL1Analyzer.h +0 -109
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp +0 -84
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNConfig.h +0 -44
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNSimulator.cpp +0 -628
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNSimulator.h +0 -210
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerAction.cpp +0 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerAction.h +0 -66
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp +0 -107
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionExecutor.h +0 -115
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionType.h +0 -55
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerChannelAction.cpp +0 -55
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerChannelAction.h +0 -63
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerCustomAction.cpp +0 -62
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerCustomAction.h +0 -87
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp +0 -63
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.h +0 -82
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerModeAction.cpp +0 -56
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerModeAction.h +0 -61
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerMoreAction.cpp +0 -47
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerMoreAction.h +0 -57
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPopModeAction.cpp +0 -47
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPopModeAction.h +0 -57
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPushModeAction.cpp +0 -56
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPushModeAction.h +0 -61
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerSkipAction.cpp +0 -47
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerSkipAction.h +0 -55
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerTypeAction.cpp +0 -56
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerTypeAction.h +0 -55
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LookaheadEventInfo.cpp +0 -16
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LookaheadEventInfo.h +0 -42
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LoopEndState.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LoopEndState.h +0 -22
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Makefile +0 -67
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/NotSetTransition.cpp +0 -27
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/NotSetTransition.h +0 -25
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.h +0 -20
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParseInfo.cpp +0 -102
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParseInfo.h +0 -102
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp +0 -1366
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulator.h +0 -904
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusBlockStartState.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusBlockStartState.h +0 -25
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusLoopbackState.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusLoopbackState.h +0 -22
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.cpp +0 -32
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.h +0 -29
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.cpp +0 -17
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.h +0 -62
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateTransition.cpp +0 -34
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateTransition.h +0 -39
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContext.cpp +0 -662
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContext.h +0 -254
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionMode.cpp +0 -201
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionMode.h +0 -436
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp +0 -179
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.h +0 -60
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RangeTransition.cpp +0 -30
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RangeTransition.h +0 -29
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStartState.cpp +0 -16
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStartState.h +0 -25
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStopState.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStopState.h +0 -25
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleTransition.cpp +0 -37
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleTransition.h +0 -40
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContext.cpp +0 -377
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContext.h +0 -222
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SetTransition.cpp +0 -32
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SetTransition.h +0 -30
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.cpp +0 -81
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.h +0 -36
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarBlockStartState.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarBlockStartState.h +0 -21
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopEntryState.cpp +0 -15
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopEntryState.h +0 -35
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopbackState.cpp +0 -19
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopbackState.h +0 -21
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TokensStartState.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TokensStartState.h +0 -21
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Transition.cpp +0 -44
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Transition.h +0 -76
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/WildcardTransition.cpp +0 -25
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/WildcardTransition.h +0 -25
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFA.cpp +0 -127
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFA.h +0 -91
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFASerializer.cpp +0 -67
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFASerializer.h +0 -32
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFAState.cpp +0 -100
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFAState.h +0 -144
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.cpp +0 -20
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.h +0 -23
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/InterpreterDataReader.cpp +0 -124
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/InterpreterDataReader.h +0 -31
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Interval.cpp +0 -89
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Interval.h +0 -84
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/IntervalSet.cpp +0 -521
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/IntervalSet.h +0 -198
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/MurmurHash.cpp +0 -134
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/MurmurHash.h +0 -76
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Predicate.cpp +0 -4
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Predicate.h +0 -21
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Any.cpp +0 -13
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Any.h +0 -170
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Arrays.cpp +0 -43
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Arrays.h +0 -110
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/BitSet.h +0 -76
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/CPPUtils.cpp +0 -248
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/CPPUtils.h +0 -78
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Declarations.h +0 -163
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/StringUtils.cpp +0 -36
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/StringUtils.h +0 -54
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/guid.cpp +0 -303
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/guid.h +0 -112
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/AbstractParseTreeVisitor.h +0 -128
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNode.cpp +0 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNode.h +0 -19
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.cpp +0 -23
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.h +0 -33
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.cpp +0 -71
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.h +0 -53
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTree.cpp +0 -15
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTree.h +0 -102
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeListener.cpp +0 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeListener.h +0 -39
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeProperty.h +0 -50
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.cpp +0 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.h +0 -57
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeWalker.cpp +0 -49
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeWalker.h +0 -31
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNode.cpp +0 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNode.h +0 -32
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.cpp +0 -57
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.h +0 -33
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/Trees.cpp +0 -241
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/Trees.h +0 -78
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/Chunk.cpp +0 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/Chunk.h +0 -44
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreeMatch.cpp +0 -69
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreeMatch.h +0 -132
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePattern.cpp +0 -64
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePattern.h +0 -105
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.cpp +0 -371
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.h +0 -185
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.cpp +0 -77
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.h +0 -117
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TagChunk.cpp +0 -39
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TagChunk.h +0 -86
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TextChunk.cpp +0 -28
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TextChunk.h +0 -51
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.cpp +0 -36
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.h +0 -80
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPath.cpp +0 -154
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPath.h +0 -86
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathElement.cpp +0 -31
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathElement.h +0 -40
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp +0 -173
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.g4 +0 -64
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h +0 -56
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.tokens +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexerErrorListener.cpp +0 -13
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexerErrorListener.h +0 -22
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleAnywhereElement.cpp +0 -20
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleAnywhereElement.h +0 -27
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleElement.cpp +0 -30
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleElement.h +0 -26
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenAnywhereElement.cpp +0 -20
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenAnywhereElement.h +0 -25
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenElement.cpp +0 -33
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenElement.h +0 -26
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardAnywhereElement.cpp +0 -23
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardAnywhereElement.h +0 -23
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardElement.cpp +0 -24
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardElement.h +0 -23
- data/ext/express-parser/antlrgen/Express.interp +0 -532
- data/ext/express-parser/antlrgen/Express.tokens +0 -190
- data/ext/express-parser/antlrgen/ExpressBaseListener.cpp +0 -7
- data/ext/express-parser/antlrgen/ExpressBaseListener.h +0 -623
- data/ext/express-parser/antlrgen/ExpressBaseVisitor.cpp +0 -7
- data/ext/express-parser/antlrgen/ExpressBaseVisitor.h +0 -816
- data/ext/express-parser/antlrgen/ExpressLexer.cpp +0 -1169
- data/ext/express-parser/antlrgen/ExpressLexer.h +0 -85
- data/ext/express-parser/antlrgen/ExpressLexer.interp +0 -534
- data/ext/express-parser/antlrgen/ExpressLexer.tokens +0 -190
- data/ext/express-parser/antlrgen/ExpressListener.cpp +0 -7
- data/ext/express-parser/antlrgen/ExpressListener.h +0 -616
- data/ext/express-parser/antlrgen/ExpressParser.cpp +0 -17284
- data/ext/express-parser/antlrgen/ExpressParser.h +0 -3696
- data/ext/express-parser/antlrgen/ExpressVisitor.cpp +0 -7
- data/ext/express-parser/antlrgen/ExpressVisitor.h +0 -422
- data/ext/express-parser/express_parser.cpp +0 -17931
- data/ext/express-parser/extconf.rb +0 -34
- data/lib/express_parser.so +0 -0
@@ -1,82 +1,82 @@
|
|
1
|
-
require "expressir/express/defined_type"
|
2
|
-
|
3
|
-
module Expressir
|
4
|
-
module Express
|
5
|
-
class TypeSelect < DefinedType
|
6
|
-
attr_accessor :selectitems_array, :selectitems, :extends, :extends_item,
|
7
|
-
:isExtensible, :selectitems_all, :isGenericEntity, :isBuiltin,
|
8
|
-
:cleaned_select_items
|
9
|
-
|
10
|
-
def initialize(options = {})
|
11
|
-
@isBuiltin = false
|
12
|
-
@isExtensible = false
|
13
|
-
@isGenericEntity = false
|
14
|
-
@selectitems = nil
|
15
|
-
@selectitems_array = []
|
16
|
-
@cleaned_select_items = nil
|
17
|
-
@wheres = []
|
18
|
-
@selectedBy = []
|
19
|
-
|
20
|
-
super(options)
|
21
|
-
end
|
22
|
-
|
23
|
-
##
|
24
|
-
# set cleaned_select_items = process select removing unnecessary
|
25
|
-
# entity types (i.e. if supertype is there)
|
26
|
-
#
|
27
|
-
def clean_select_items
|
28
|
-
@cleaned_select_items = ""
|
29
|
-
|
30
|
-
if selectitems != nil
|
31
|
-
itemname_list = selectitems.scan(/\w+/)
|
32
|
-
dupitem_list = []
|
33
|
-
for itemname in itemname_list
|
34
|
-
itemptr = schema.find_namedtype_by_name( itemname )
|
35
|
-
|
36
|
-
if itemptr.kind_of? EXPSM::Entity
|
37
|
-
|
38
|
-
for itemname2 in itemname_list
|
39
|
-
thetype = schema.find_namedtype_by_name( itemname2 )
|
40
|
-
|
41
|
-
if thetype != nil
|
42
|
-
if itemptr.supertypes_all != nil &&
|
43
|
-
itemptr.supertypes_all.include?(thetype.name)
|
44
|
-
|
45
|
-
dupitem_list.push itemname
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
itemname_list.each do |itemname|
|
53
|
-
if !dupitem_list.include? itemname
|
54
|
-
@cleaned_select_items = @cleaned_select_items + " " + itemname
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
@cleaned_select_items = @cleaned_select_items.lstrip
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
private
|
63
|
-
|
64
|
-
def extract_type_attributes(document)
|
65
|
-
if document.class == Nokogiri::XML::NodeSet
|
66
|
-
document = document.first
|
67
|
-
end
|
68
|
-
|
69
|
-
@selectitems = document.attributes["selectitems"]
|
70
|
-
@extends = document.attributes["basedon"]
|
71
|
-
@isExtensible = document.attributes["extensible"] == "YES"
|
72
|
-
@isGenericEntity = document.attributes["genericentity"] == "YES"
|
73
|
-
|
74
|
-
if isExtensible
|
75
|
-
@selectitems_all = selectitems
|
76
|
-
end
|
77
|
-
|
78
|
-
super(document)
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
1
|
+
require "expressir/express/defined_type"
|
2
|
+
|
3
|
+
module Expressir
|
4
|
+
module Express
|
5
|
+
class TypeSelect < DefinedType
|
6
|
+
attr_accessor :selectitems_array, :selectitems, :extends, :extends_item,
|
7
|
+
:isExtensible, :selectitems_all, :isGenericEntity, :isBuiltin,
|
8
|
+
:cleaned_select_items
|
9
|
+
|
10
|
+
def initialize(options = {})
|
11
|
+
@isBuiltin = false
|
12
|
+
@isExtensible = false
|
13
|
+
@isGenericEntity = false
|
14
|
+
@selectitems = nil
|
15
|
+
@selectitems_array = []
|
16
|
+
@cleaned_select_items = nil
|
17
|
+
@wheres = []
|
18
|
+
@selectedBy = []
|
19
|
+
|
20
|
+
super(options)
|
21
|
+
end
|
22
|
+
|
23
|
+
##
|
24
|
+
# set cleaned_select_items = process select removing unnecessary
|
25
|
+
# entity types (i.e. if supertype is there)
|
26
|
+
#
|
27
|
+
def clean_select_items
|
28
|
+
@cleaned_select_items = ""
|
29
|
+
|
30
|
+
if selectitems != nil
|
31
|
+
itemname_list = selectitems.scan(/\w+/)
|
32
|
+
dupitem_list = []
|
33
|
+
for itemname in itemname_list
|
34
|
+
itemptr = schema.find_namedtype_by_name( itemname )
|
35
|
+
|
36
|
+
if itemptr.kind_of? EXPSM::Entity
|
37
|
+
|
38
|
+
for itemname2 in itemname_list
|
39
|
+
thetype = schema.find_namedtype_by_name( itemname2 )
|
40
|
+
|
41
|
+
if thetype != nil
|
42
|
+
if itemptr.supertypes_all != nil &&
|
43
|
+
itemptr.supertypes_all.include?(thetype.name)
|
44
|
+
|
45
|
+
dupitem_list.push itemname
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
itemname_list.each do |itemname|
|
53
|
+
if !dupitem_list.include? itemname
|
54
|
+
@cleaned_select_items = @cleaned_select_items + " " + itemname
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
@cleaned_select_items = @cleaned_select_items.lstrip
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
private
|
63
|
+
|
64
|
+
def extract_type_attributes(document)
|
65
|
+
if document.class == Nokogiri::XML::NodeSet
|
66
|
+
document = document.first
|
67
|
+
end
|
68
|
+
|
69
|
+
@selectitems = document.attributes["selectitems"]
|
70
|
+
@extends = document.attributes["basedon"]
|
71
|
+
@isExtensible = document.attributes["extensible"] == "YES"
|
72
|
+
@isGenericEntity = document.attributes["genericentity"] == "YES"
|
73
|
+
|
74
|
+
if isExtensible
|
75
|
+
@selectitems_all = selectitems
|
76
|
+
end
|
77
|
+
|
78
|
+
super(document)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -1,35 +1,35 @@
|
|
1
|
-
require "expressir/express/model_element"
|
2
|
-
|
3
|
-
module Expressir
|
4
|
-
module Express
|
5
|
-
class UniqueRule < ModelElement
|
6
|
-
attr_accessor :name, :attributes
|
7
|
-
|
8
|
-
def initialize(options)
|
9
|
-
@name = nil
|
10
|
-
@attributes = []
|
11
|
-
@options = options
|
12
|
-
end
|
13
|
-
|
14
|
-
def parse
|
15
|
-
document = @options.fetch(:document, nil)
|
16
|
-
extract_unique_attributes(document)
|
17
|
-
|
18
|
-
self
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.parse(document)
|
22
|
-
new(document: document).parse
|
23
|
-
end
|
24
|
-
|
25
|
-
private
|
26
|
-
|
27
|
-
def extract_unique_attributes(document)
|
28
|
-
@name = document.attributes["label"].to_s
|
29
|
-
@attributes = document.xpath("unique.attribute").map do |attribute|
|
30
|
-
attribute.attributes["attribute"]
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
1
|
+
require "expressir/express/model_element"
|
2
|
+
|
3
|
+
module Expressir
|
4
|
+
module Express
|
5
|
+
class UniqueRule < ModelElement
|
6
|
+
attr_accessor :name, :attributes
|
7
|
+
|
8
|
+
def initialize(options)
|
9
|
+
@name = nil
|
10
|
+
@attributes = []
|
11
|
+
@options = options
|
12
|
+
end
|
13
|
+
|
14
|
+
def parse
|
15
|
+
document = @options.fetch(:document, nil)
|
16
|
+
extract_unique_attributes(document)
|
17
|
+
|
18
|
+
self
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.parse(document)
|
22
|
+
new(document: document).parse
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def extract_unique_attributes(document)
|
28
|
+
@name = document.attributes["label"].to_s
|
29
|
+
@attributes = document.xpath("unique.attribute").map do |attribute|
|
30
|
+
attribute.attributes["attribute"]
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -1,32 +1,32 @@
|
|
1
|
-
require "expressir/express/model_element"
|
2
|
-
|
3
|
-
module Expressir
|
4
|
-
module Express
|
5
|
-
class WhereRule < ModelElement
|
6
|
-
attr_accessor :name, :expression
|
7
|
-
|
8
|
-
def initialize(options = {})
|
9
|
-
@name = nil
|
10
|
-
@options = options
|
11
|
-
end
|
12
|
-
|
13
|
-
def parse
|
14
|
-
document = @options.fetch(:where, nil)
|
15
|
-
extract_where_attributes(document) if document
|
16
|
-
|
17
|
-
self
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.parse(document)
|
21
|
-
new(document: document).parse
|
22
|
-
end
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
def extract_where_attributes(document)
|
27
|
-
@name = document.attributes["label"].to_s
|
28
|
-
@expression = document.attributes["expression"]
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
1
|
+
require "expressir/express/model_element"
|
2
|
+
|
3
|
+
module Expressir
|
4
|
+
module Express
|
5
|
+
class WhereRule < ModelElement
|
6
|
+
attr_accessor :name, :expression
|
7
|
+
|
8
|
+
def initialize(options = {})
|
9
|
+
@name = nil
|
10
|
+
@options = options
|
11
|
+
end
|
12
|
+
|
13
|
+
def parse
|
14
|
+
document = @options.fetch(:where, nil)
|
15
|
+
extract_where_attributes(document) if document
|
16
|
+
|
17
|
+
self
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.parse(document)
|
21
|
+
new(document: document).parse
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def extract_where_attributes(document)
|
27
|
+
@name = document.attributes["label"].to_s
|
28
|
+
@expression = document.attributes["expression"]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,1450 +1,1501 @@
|
|
1
|
-
require 'expressir/model'
|
2
|
-
|
3
|
-
module Expressir
|
4
|
-
module ExpressExp
|
5
|
-
class Formatter
|
6
|
-
INDENT_CHAR = ' '
|
7
|
-
INDENT_WIDTH = 2
|
8
|
-
INDENT = INDENT_CHAR * INDENT_WIDTH
|
9
|
-
|
10
|
-
OPERATOR_PRECEDENCE = {
|
11
|
-
Model::Expressions::BinaryExpression::EXPONENTIATION => 1,
|
12
|
-
Model::Expressions::BinaryExpression::MULTIPLICATION => 2,
|
13
|
-
Model::Expressions::BinaryExpression::REAL_DIVISION => 2,
|
14
|
-
Model::Expressions::BinaryExpression::INTEGER_DIVISION => 2,
|
15
|
-
Model::Expressions::BinaryExpression::MODULO => 2,
|
16
|
-
Model::Expressions::BinaryExpression::AND => 2,
|
17
|
-
Model::Expressions::BinaryExpression::COMBINE => 2,
|
18
|
-
Model::Expressions::BinaryExpression::SUBTRACTION => 3,
|
19
|
-
Model::Expressions::BinaryExpression::ADDITION => 3,
|
20
|
-
Model::Expressions::BinaryExpression::OR => 3,
|
21
|
-
Model::Expressions::BinaryExpression::XOR => 3,
|
22
|
-
Model::Expressions::BinaryExpression::EQUAL => 4,
|
23
|
-
Model::Expressions::BinaryExpression::NOT_EQUAL => 4,
|
24
|
-
Model::Expressions::BinaryExpression::LESS_THAN_OR_EQUAL => 4,
|
25
|
-
Model::Expressions::BinaryExpression::GREATER_THAN_OR_EQUAL => 4,
|
26
|
-
Model::Expressions::BinaryExpression::LESS_THAN => 4,
|
27
|
-
Model::Expressions::BinaryExpression::GREATER_THAN => 4,
|
28
|
-
Model::Expressions::BinaryExpression::INSTANCE_EQUAL => 4,
|
29
|
-
Model::Expressions::BinaryExpression::INSTANCE_NOT_EQUAL => 4,
|
30
|
-
Model::Expressions::BinaryExpression::IN => 4,
|
31
|
-
Model::Expressions::BinaryExpression::LIKE => 4,
|
32
|
-
Model::Expressions::BinaryExpression::ANDOR => 4,
|
33
|
-
}
|
34
|
-
|
35
|
-
def self.format(node)
|
36
|
-
formatter = self.new
|
37
|
-
formatter.format(node)
|
38
|
-
end
|
39
|
-
|
40
|
-
def format(node)
|
41
|
-
if node.instance_of? Model::Attribute
|
42
|
-
format_attribute(node)
|
43
|
-
elsif node.instance_of? Model::Constant
|
44
|
-
format_constant(node)
|
45
|
-
elsif node.instance_of? Model::Entity
|
46
|
-
format_entity(node)
|
47
|
-
elsif node.instance_of? Model::EnumerationItem
|
48
|
-
format_enumeration_item(node)
|
49
|
-
elsif node.instance_of? Model::Function
|
50
|
-
format_function(node)
|
51
|
-
elsif node.instance_of? Model::Interface
|
52
|
-
format_interface(node)
|
53
|
-
elsif node.instance_of? Model::Parameter
|
54
|
-
format_parameter(node)
|
55
|
-
elsif node.instance_of? Model::Procedure
|
56
|
-
format_procedure(node)
|
57
|
-
elsif node.instance_of? Model::RenamedRef
|
58
|
-
format_renamed_ref(node)
|
59
|
-
elsif node.instance_of? Model::Repository
|
60
|
-
format_repository(node)
|
61
|
-
elsif node.instance_of? Model::Rule
|
62
|
-
format_rule(node)
|
63
|
-
elsif node.instance_of? Model::Schema
|
64
|
-
format_schema(node)
|
65
|
-
elsif node.instance_of? Model::SubtypeConstraint
|
66
|
-
format_subtype_constraint(node)
|
67
|
-
elsif node.instance_of? Model::Type
|
68
|
-
format_type(node)
|
69
|
-
elsif node.instance_of? Model::Unique
|
70
|
-
format_unique(node)
|
71
|
-
elsif node.instance_of? Model::Variable
|
72
|
-
format_variable(node)
|
73
|
-
elsif node.instance_of? Model::Where
|
74
|
-
format_where(node)
|
75
|
-
elsif node.instance_of? Model::Expressions::AggregateInitializer
|
76
|
-
format_expressions_aggregate_initializer(node)
|
77
|
-
elsif node.instance_of? Model::Expressions::AggregateItem
|
78
|
-
format_expressions_aggregate_item(node)
|
79
|
-
elsif node.instance_of? Model::Expressions::AttributeReference
|
80
|
-
format_expressions_attribute_reference(node)
|
81
|
-
elsif node.instance_of? Model::Expressions::BinaryExpression
|
82
|
-
format_expressions_binary_expression(node)
|
83
|
-
elsif node.instance_of? Model::Expressions::Call
|
84
|
-
format_expressions_call(node)
|
85
|
-
elsif node.instance_of? Model::Expressions::EntityConstructor
|
86
|
-
format_expressions_entity_constructor(node)
|
87
|
-
elsif node.instance_of? Model::Expressions::GroupReference
|
88
|
-
format_expressions_group_reference(node)
|
89
|
-
elsif node.instance_of? Model::Expressions::IndexReference
|
90
|
-
format_expressions_index_reference(node)
|
91
|
-
elsif node.instance_of? Model::Expressions::Interval
|
92
|
-
format_expressions_interval(node)
|
93
|
-
elsif node.instance_of? Model::Expressions::QueryExpression
|
94
|
-
format_expressions_query_expression(node)
|
95
|
-
elsif node.instance_of? Model::Expressions::SimpleReference
|
96
|
-
format_expressions_simple_reference(node)
|
97
|
-
elsif node.instance_of? Model::Expressions::UnaryExpression
|
98
|
-
format_expressions_unary_expression(node)
|
99
|
-
elsif node.instance_of? Model::Literals::Binary
|
100
|
-
format_literals_binary(node)
|
101
|
-
elsif node.instance_of? Model::Literals::Integer
|
102
|
-
format_literals_integer(node)
|
103
|
-
elsif node.instance_of? Model::Literals::Logical
|
104
|
-
format_literals_logical(node)
|
105
|
-
elsif node.instance_of? Model::Literals::Real
|
106
|
-
format_literals_real(node)
|
107
|
-
elsif node.instance_of? Model::Literals::String
|
108
|
-
format_literals_string(node)
|
109
|
-
elsif node.instance_of? Model::Statements::Alias
|
110
|
-
format_statements_alias(node)
|
111
|
-
elsif node.instance_of? Model::Statements::Assignment
|
112
|
-
format_statements_assignment(node)
|
113
|
-
elsif node.instance_of? Model::Statements::Call
|
114
|
-
format_statements_call(node)
|
115
|
-
elsif node.instance_of? Model::Statements::Case
|
116
|
-
format_statements_case(node)
|
117
|
-
elsif node.instance_of? Model::Statements::CaseAction
|
118
|
-
format_statements_case_action(node)
|
119
|
-
elsif node.instance_of? Model::Statements::Compound
|
120
|
-
format_statements_compound(node)
|
121
|
-
elsif node.instance_of? Model::Statements::Escape
|
122
|
-
format_statements_escape(node)
|
123
|
-
elsif node.instance_of? Model::Statements::If
|
124
|
-
format_statements_if(node)
|
125
|
-
elsif node.instance_of? Model::Statements::Null
|
126
|
-
format_statements_null(node)
|
127
|
-
elsif node.instance_of? Model::Statements::Repeat
|
128
|
-
format_statements_repeat(node)
|
129
|
-
elsif node.instance_of? Model::Statements::Return
|
130
|
-
format_statements_return(node)
|
131
|
-
elsif node.instance_of? Model::Statements::Skip
|
132
|
-
format_statements_skip(node)
|
133
|
-
elsif node.instance_of? Model::Types::Aggregate
|
134
|
-
format_types_aggregate(node)
|
135
|
-
elsif node.instance_of? Model::Types::Array
|
136
|
-
format_types_array(node)
|
137
|
-
elsif node.instance_of? Model::Types::Bag
|
138
|
-
format_types_bag(node)
|
139
|
-
elsif node.instance_of? Model::Types::Binary
|
140
|
-
format_types_binary(node)
|
141
|
-
elsif node.instance_of? Model::Types::Boolean
|
142
|
-
format_types_boolean(node)
|
143
|
-
elsif node.instance_of? Model::Types::Enumeration
|
144
|
-
format_types_enumeration(node)
|
145
|
-
elsif node.instance_of? Model::Types::GenericEntity
|
146
|
-
format_types_generic_entity(node)
|
147
|
-
elsif node.instance_of? Model::Types::Generic
|
148
|
-
format_types_generic(node)
|
149
|
-
elsif node.instance_of? Model::Types::Integer
|
150
|
-
format_types_integer(node)
|
151
|
-
elsif node.instance_of? Model::Types::List
|
152
|
-
format_types_list(node)
|
153
|
-
elsif node.instance_of? Model::Types::Logical
|
154
|
-
format_types_logical(node)
|
155
|
-
elsif node.instance_of? Model::Types::Number
|
156
|
-
format_types_number(node)
|
157
|
-
elsif node.instance_of? Model::Types::Real
|
158
|
-
format_types_real(node)
|
159
|
-
elsif node.instance_of? Model::Types::Select
|
160
|
-
format_types_select(node)
|
161
|
-
elsif node.instance_of? Model::Types::Set
|
162
|
-
format_types_set(node)
|
163
|
-
elsif node.instance_of? Model::Types::String
|
164
|
-
format_types_string(node)
|
165
|
-
else
|
166
|
-
puts node.class
|
167
|
-
end
|
168
|
-
end
|
169
|
-
|
170
|
-
private
|
171
|
-
|
172
|
-
def format_attribute(node)
|
173
|
-
[
|
174
|
-
*if node.supertype_attribute
|
175
|
-
[
|
176
|
-
format(node.supertype_attribute),
|
177
|
-
' ',
|
178
|
-
].join('')
|
179
|
-
end,
|
180
|
-
*if node.supertype_attribute and node.id
|
181
|
-
[
|
182
|
-
'RENAMED',
|
183
|
-
' '
|
184
|
-
].join('')
|
185
|
-
end,
|
186
|
-
*if node.id
|
187
|
-
[
|
188
|
-
node.id,
|
189
|
-
' '
|
190
|
-
].join('')
|
191
|
-
end,
|
192
|
-
':',
|
193
|
-
*if node.optional
|
194
|
-
[
|
195
|
-
' ',
|
196
|
-
'OPTIONAL'
|
197
|
-
].join('')
|
198
|
-
end,
|
199
|
-
' ',
|
200
|
-
format(node.type),
|
201
|
-
*if node.kind == Model::Attribute::DERIVED
|
202
|
-
[
|
203
|
-
' ',
|
204
|
-
':=',
|
205
|
-
' ',
|
206
|
-
format(node.expression)
|
207
|
-
].join('')
|
208
|
-
elsif node.kind == Model::Attribute::INVERSE
|
209
|
-
[
|
210
|
-
' ',
|
211
|
-
'FOR',
|
212
|
-
' ',
|
213
|
-
format(node.expression)
|
214
|
-
].join('')
|
215
|
-
end,
|
216
|
-
';',
|
217
|
-
].join('')
|
218
|
-
end
|
219
|
-
|
220
|
-
def format_constant(node)
|
221
|
-
[
|
222
|
-
node.id,
|
223
|
-
' ',
|
224
|
-
':',
|
225
|
-
' ',
|
226
|
-
format(node.type),
|
227
|
-
' ',
|
228
|
-
':=',
|
229
|
-
' ',
|
230
|
-
format(node.expression),
|
231
|
-
';'
|
232
|
-
].join('')
|
233
|
-
end
|
234
|
-
|
235
|
-
def format_entity(node)
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
'
|
259
|
-
' ',
|
260
|
-
'
|
261
|
-
|
262
|
-
'
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
'
|
274
|
-
|
275
|
-
'
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
'
|
287
|
-
|
288
|
-
'
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
end
|
330
|
-
|
331
|
-
def
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
'
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
end,
|
363
|
-
*if node.
|
364
|
-
indent(
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
end,
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
].join('')
|
420
|
-
end
|
421
|
-
|
422
|
-
def
|
423
|
-
[
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
'
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
[
|
492
|
-
'
|
493
|
-
'
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
*if node.
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
end,
|
569
|
-
*if node.
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
'
|
586
|
-
'
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
end,
|
599
|
-
*if node.
|
600
|
-
|
601
|
-
'
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
'
|
629
|
-
'
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
'
|
641
|
-
'
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
'
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
node.
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
'
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
' ',
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
'
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
' ',
|
833
|
-
'
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
format(node.
|
840
|
-
|
841
|
-
|
842
|
-
].join('')
|
843
|
-
end
|
844
|
-
|
845
|
-
def
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
end,
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
'
|
872
|
-
node.
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
' '
|
913
|
-
|
914
|
-
|
915
|
-
'
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
].join(
|
929
|
-
end
|
930
|
-
|
931
|
-
def
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
'
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
end,
|
978
|
-
|
979
|
-
|
980
|
-
'
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
format(
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
'
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
end
|
1099
|
-
|
1100
|
-
def
|
1101
|
-
[
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
'
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
end,
|
1147
|
-
*
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
'
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
'
|
1173
|
-
'
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
'
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
'
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
'
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
'
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
'
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
'
|
1272
|
-
'
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
'
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
'
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
'
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
'
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
'
|
1396
|
-
].join('')
|
1397
|
-
end
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
[
|
1406
|
-
'
|
1407
|
-
'
|
1408
|
-
|
1409
|
-
'
|
1410
|
-
|
1411
|
-
|
1412
|
-
'
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1
|
+
require 'expressir/model'
|
2
|
+
|
3
|
+
module Expressir
|
4
|
+
module ExpressExp
|
5
|
+
class Formatter
|
6
|
+
INDENT_CHAR = ' '
|
7
|
+
INDENT_WIDTH = 2
|
8
|
+
INDENT = INDENT_CHAR * INDENT_WIDTH
|
9
|
+
|
10
|
+
OPERATOR_PRECEDENCE = {
|
11
|
+
Model::Expressions::BinaryExpression::EXPONENTIATION => 1,
|
12
|
+
Model::Expressions::BinaryExpression::MULTIPLICATION => 2,
|
13
|
+
Model::Expressions::BinaryExpression::REAL_DIVISION => 2,
|
14
|
+
Model::Expressions::BinaryExpression::INTEGER_DIVISION => 2,
|
15
|
+
Model::Expressions::BinaryExpression::MODULO => 2,
|
16
|
+
Model::Expressions::BinaryExpression::AND => 2,
|
17
|
+
Model::Expressions::BinaryExpression::COMBINE => 2,
|
18
|
+
Model::Expressions::BinaryExpression::SUBTRACTION => 3,
|
19
|
+
Model::Expressions::BinaryExpression::ADDITION => 3,
|
20
|
+
Model::Expressions::BinaryExpression::OR => 3,
|
21
|
+
Model::Expressions::BinaryExpression::XOR => 3,
|
22
|
+
Model::Expressions::BinaryExpression::EQUAL => 4,
|
23
|
+
Model::Expressions::BinaryExpression::NOT_EQUAL => 4,
|
24
|
+
Model::Expressions::BinaryExpression::LESS_THAN_OR_EQUAL => 4,
|
25
|
+
Model::Expressions::BinaryExpression::GREATER_THAN_OR_EQUAL => 4,
|
26
|
+
Model::Expressions::BinaryExpression::LESS_THAN => 4,
|
27
|
+
Model::Expressions::BinaryExpression::GREATER_THAN => 4,
|
28
|
+
Model::Expressions::BinaryExpression::INSTANCE_EQUAL => 4,
|
29
|
+
Model::Expressions::BinaryExpression::INSTANCE_NOT_EQUAL => 4,
|
30
|
+
Model::Expressions::BinaryExpression::IN => 4,
|
31
|
+
Model::Expressions::BinaryExpression::LIKE => 4,
|
32
|
+
Model::Expressions::BinaryExpression::ANDOR => 4,
|
33
|
+
}
|
34
|
+
|
35
|
+
def self.format(node)
|
36
|
+
formatter = self.new
|
37
|
+
formatter.format(node)
|
38
|
+
end
|
39
|
+
|
40
|
+
def format(node)
|
41
|
+
if node.instance_of? Model::Attribute
|
42
|
+
format_attribute(node)
|
43
|
+
elsif node.instance_of? Model::Constant
|
44
|
+
format_constant(node)
|
45
|
+
elsif node.instance_of? Model::Entity
|
46
|
+
format_entity(node)
|
47
|
+
elsif node.instance_of? Model::EnumerationItem
|
48
|
+
format_enumeration_item(node)
|
49
|
+
elsif node.instance_of? Model::Function
|
50
|
+
format_function(node)
|
51
|
+
elsif node.instance_of? Model::Interface
|
52
|
+
format_interface(node)
|
53
|
+
elsif node.instance_of? Model::Parameter
|
54
|
+
format_parameter(node)
|
55
|
+
elsif node.instance_of? Model::Procedure
|
56
|
+
format_procedure(node)
|
57
|
+
elsif node.instance_of? Model::RenamedRef
|
58
|
+
format_renamed_ref(node)
|
59
|
+
elsif node.instance_of? Model::Repository
|
60
|
+
format_repository(node)
|
61
|
+
elsif node.instance_of? Model::Rule
|
62
|
+
format_rule(node)
|
63
|
+
elsif node.instance_of? Model::Schema
|
64
|
+
format_schema(node)
|
65
|
+
elsif node.instance_of? Model::SubtypeConstraint
|
66
|
+
format_subtype_constraint(node)
|
67
|
+
elsif node.instance_of? Model::Type
|
68
|
+
format_type(node)
|
69
|
+
elsif node.instance_of? Model::Unique
|
70
|
+
format_unique(node)
|
71
|
+
elsif node.instance_of? Model::Variable
|
72
|
+
format_variable(node)
|
73
|
+
elsif node.instance_of? Model::Where
|
74
|
+
format_where(node)
|
75
|
+
elsif node.instance_of? Model::Expressions::AggregateInitializer
|
76
|
+
format_expressions_aggregate_initializer(node)
|
77
|
+
elsif node.instance_of? Model::Expressions::AggregateItem
|
78
|
+
format_expressions_aggregate_item(node)
|
79
|
+
elsif node.instance_of? Model::Expressions::AttributeReference
|
80
|
+
format_expressions_attribute_reference(node)
|
81
|
+
elsif node.instance_of? Model::Expressions::BinaryExpression
|
82
|
+
format_expressions_binary_expression(node)
|
83
|
+
elsif node.instance_of? Model::Expressions::Call
|
84
|
+
format_expressions_call(node)
|
85
|
+
elsif node.instance_of? Model::Expressions::EntityConstructor
|
86
|
+
format_expressions_entity_constructor(node)
|
87
|
+
elsif node.instance_of? Model::Expressions::GroupReference
|
88
|
+
format_expressions_group_reference(node)
|
89
|
+
elsif node.instance_of? Model::Expressions::IndexReference
|
90
|
+
format_expressions_index_reference(node)
|
91
|
+
elsif node.instance_of? Model::Expressions::Interval
|
92
|
+
format_expressions_interval(node)
|
93
|
+
elsif node.instance_of? Model::Expressions::QueryExpression
|
94
|
+
format_expressions_query_expression(node)
|
95
|
+
elsif node.instance_of? Model::Expressions::SimpleReference
|
96
|
+
format_expressions_simple_reference(node)
|
97
|
+
elsif node.instance_of? Model::Expressions::UnaryExpression
|
98
|
+
format_expressions_unary_expression(node)
|
99
|
+
elsif node.instance_of? Model::Literals::Binary
|
100
|
+
format_literals_binary(node)
|
101
|
+
elsif node.instance_of? Model::Literals::Integer
|
102
|
+
format_literals_integer(node)
|
103
|
+
elsif node.instance_of? Model::Literals::Logical
|
104
|
+
format_literals_logical(node)
|
105
|
+
elsif node.instance_of? Model::Literals::Real
|
106
|
+
format_literals_real(node)
|
107
|
+
elsif node.instance_of? Model::Literals::String
|
108
|
+
format_literals_string(node)
|
109
|
+
elsif node.instance_of? Model::Statements::Alias
|
110
|
+
format_statements_alias(node)
|
111
|
+
elsif node.instance_of? Model::Statements::Assignment
|
112
|
+
format_statements_assignment(node)
|
113
|
+
elsif node.instance_of? Model::Statements::Call
|
114
|
+
format_statements_call(node)
|
115
|
+
elsif node.instance_of? Model::Statements::Case
|
116
|
+
format_statements_case(node)
|
117
|
+
elsif node.instance_of? Model::Statements::CaseAction
|
118
|
+
format_statements_case_action(node)
|
119
|
+
elsif node.instance_of? Model::Statements::Compound
|
120
|
+
format_statements_compound(node)
|
121
|
+
elsif node.instance_of? Model::Statements::Escape
|
122
|
+
format_statements_escape(node)
|
123
|
+
elsif node.instance_of? Model::Statements::If
|
124
|
+
format_statements_if(node)
|
125
|
+
elsif node.instance_of? Model::Statements::Null
|
126
|
+
format_statements_null(node)
|
127
|
+
elsif node.instance_of? Model::Statements::Repeat
|
128
|
+
format_statements_repeat(node)
|
129
|
+
elsif node.instance_of? Model::Statements::Return
|
130
|
+
format_statements_return(node)
|
131
|
+
elsif node.instance_of? Model::Statements::Skip
|
132
|
+
format_statements_skip(node)
|
133
|
+
elsif node.instance_of? Model::Types::Aggregate
|
134
|
+
format_types_aggregate(node)
|
135
|
+
elsif node.instance_of? Model::Types::Array
|
136
|
+
format_types_array(node)
|
137
|
+
elsif node.instance_of? Model::Types::Bag
|
138
|
+
format_types_bag(node)
|
139
|
+
elsif node.instance_of? Model::Types::Binary
|
140
|
+
format_types_binary(node)
|
141
|
+
elsif node.instance_of? Model::Types::Boolean
|
142
|
+
format_types_boolean(node)
|
143
|
+
elsif node.instance_of? Model::Types::Enumeration
|
144
|
+
format_types_enumeration(node)
|
145
|
+
elsif node.instance_of? Model::Types::GenericEntity
|
146
|
+
format_types_generic_entity(node)
|
147
|
+
elsif node.instance_of? Model::Types::Generic
|
148
|
+
format_types_generic(node)
|
149
|
+
elsif node.instance_of? Model::Types::Integer
|
150
|
+
format_types_integer(node)
|
151
|
+
elsif node.instance_of? Model::Types::List
|
152
|
+
format_types_list(node)
|
153
|
+
elsif node.instance_of? Model::Types::Logical
|
154
|
+
format_types_logical(node)
|
155
|
+
elsif node.instance_of? Model::Types::Number
|
156
|
+
format_types_number(node)
|
157
|
+
elsif node.instance_of? Model::Types::Real
|
158
|
+
format_types_real(node)
|
159
|
+
elsif node.instance_of? Model::Types::Select
|
160
|
+
format_types_select(node)
|
161
|
+
elsif node.instance_of? Model::Types::Set
|
162
|
+
format_types_set(node)
|
163
|
+
elsif node.instance_of? Model::Types::String
|
164
|
+
format_types_string(node)
|
165
|
+
else
|
166
|
+
puts node.class
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
private
|
171
|
+
|
172
|
+
def format_attribute(node)
|
173
|
+
[
|
174
|
+
*if node.supertype_attribute
|
175
|
+
[
|
176
|
+
format(node.supertype_attribute),
|
177
|
+
' ',
|
178
|
+
].join('')
|
179
|
+
end,
|
180
|
+
*if node.supertype_attribute and node.id
|
181
|
+
[
|
182
|
+
'RENAMED',
|
183
|
+
' '
|
184
|
+
].join('')
|
185
|
+
end,
|
186
|
+
*if node.id
|
187
|
+
[
|
188
|
+
node.id,
|
189
|
+
' '
|
190
|
+
].join('')
|
191
|
+
end,
|
192
|
+
':',
|
193
|
+
*if node.optional
|
194
|
+
[
|
195
|
+
' ',
|
196
|
+
'OPTIONAL'
|
197
|
+
].join('')
|
198
|
+
end,
|
199
|
+
' ',
|
200
|
+
format(node.type),
|
201
|
+
*if node.kind == Model::Attribute::DERIVED
|
202
|
+
[
|
203
|
+
' ',
|
204
|
+
':=',
|
205
|
+
' ',
|
206
|
+
format(node.expression)
|
207
|
+
].join('')
|
208
|
+
elsif node.kind == Model::Attribute::INVERSE
|
209
|
+
[
|
210
|
+
' ',
|
211
|
+
'FOR',
|
212
|
+
' ',
|
213
|
+
format(node.expression)
|
214
|
+
].join('')
|
215
|
+
end,
|
216
|
+
';',
|
217
|
+
].join('')
|
218
|
+
end
|
219
|
+
|
220
|
+
def format_constant(node)
|
221
|
+
[
|
222
|
+
node.id,
|
223
|
+
' ',
|
224
|
+
':',
|
225
|
+
' ',
|
226
|
+
format(node.type),
|
227
|
+
' ',
|
228
|
+
':=',
|
229
|
+
' ',
|
230
|
+
format(node.expression),
|
231
|
+
';'
|
232
|
+
].join('')
|
233
|
+
end
|
234
|
+
|
235
|
+
def format_entity(node)
|
236
|
+
explicit_attributes = node.attributes.select{|x| x.kind == Model::Attribute::EXPLICIT}
|
237
|
+
derived_attributes = node.attributes.select{|x| x.kind == Model::Attribute::DERIVED}
|
238
|
+
inverse_attributes = node.attributes.select{|x| x.kind == Model::Attribute::INVERSE}
|
239
|
+
|
240
|
+
[
|
241
|
+
[
|
242
|
+
'ENTITY',
|
243
|
+
' ',
|
244
|
+
node.id,
|
245
|
+
*if node.abstract and !node.supertype_expression
|
246
|
+
[
|
247
|
+
"\n",
|
248
|
+
INDENT,
|
249
|
+
'ABSTRACT',
|
250
|
+
' ',
|
251
|
+
'SUPERTYPE'
|
252
|
+
].join('')
|
253
|
+
end,
|
254
|
+
*if node.abstract and node.supertype_expression
|
255
|
+
[
|
256
|
+
"\n",
|
257
|
+
INDENT,
|
258
|
+
'ABSTRACT',
|
259
|
+
' ',
|
260
|
+
'SUPERTYPE',
|
261
|
+
' ',
|
262
|
+
'OF',
|
263
|
+
' ',
|
264
|
+
'(',
|
265
|
+
format(node.supertype_expression),
|
266
|
+
')'
|
267
|
+
].join('')
|
268
|
+
end,
|
269
|
+
*if !node.abstract and node.supertype_expression
|
270
|
+
[
|
271
|
+
"\n",
|
272
|
+
INDENT,
|
273
|
+
'SUPERTYPE',
|
274
|
+
' ',
|
275
|
+
'OF',
|
276
|
+
' ',
|
277
|
+
'(',
|
278
|
+
format(node.supertype_expression),
|
279
|
+
')'
|
280
|
+
].join('')
|
281
|
+
end,
|
282
|
+
*if node.subtype_of and node.subtype_of.length > 0
|
283
|
+
[
|
284
|
+
"\n",
|
285
|
+
INDENT,
|
286
|
+
'SUBTYPE',
|
287
|
+
' ',
|
288
|
+
'OF',
|
289
|
+
' ',
|
290
|
+
'(',
|
291
|
+
node.subtype_of.map{|x| format(x)}.join(', '),
|
292
|
+
')'
|
293
|
+
].join('')
|
294
|
+
end,
|
295
|
+
';'
|
296
|
+
].join(''),
|
297
|
+
*if explicit_attributes and explicit_attributes.length > 0
|
298
|
+
indent(explicit_attributes.map{|x| format(x)}.join("\n"))
|
299
|
+
end,
|
300
|
+
*if derived_attributes and derived_attributes.length > 0
|
301
|
+
indent([
|
302
|
+
'DERIVE',
|
303
|
+
indent(derived_attributes.map{|x| format(x)}.join("\n")),
|
304
|
+
].join("\n"))
|
305
|
+
end,
|
306
|
+
*if inverse_attributes and inverse_attributes.length > 0
|
307
|
+
indent([
|
308
|
+
'INVERSE',
|
309
|
+
indent(inverse_attributes.map{|x| format(x)}.join("\n")),
|
310
|
+
].join("\n"))
|
311
|
+
end,
|
312
|
+
*if node.unique and node.unique.length > 0
|
313
|
+
indent([
|
314
|
+
'UNIQUE',
|
315
|
+
indent(node.unique.map{|x| format(x)}.join("\n"))
|
316
|
+
].join("\n"))
|
317
|
+
end,
|
318
|
+
*if node.where and node.where.length > 0
|
319
|
+
indent([
|
320
|
+
'WHERE',
|
321
|
+
indent(node.where.map{|x| format(x)}.join("\n")),
|
322
|
+
].join("\n"))
|
323
|
+
end,
|
324
|
+
[
|
325
|
+
'END_ENTITY',
|
326
|
+
';'
|
327
|
+
].join('')
|
328
|
+
].join("\n")
|
329
|
+
end
|
330
|
+
|
331
|
+
def format_enumeration_item(node)
|
332
|
+
node.id
|
333
|
+
end
|
334
|
+
|
335
|
+
def format_function(node)
|
336
|
+
[
|
337
|
+
[
|
338
|
+
'FUNCTION',
|
339
|
+
' ',
|
340
|
+
node.id,
|
341
|
+
*if node.parameters and node.parameters.length > 0
|
342
|
+
[
|
343
|
+
'(',
|
344
|
+
node.parameters.map{|x| format(x)}.join('; '),
|
345
|
+
')'
|
346
|
+
].join('')
|
347
|
+
end,
|
348
|
+
' ',
|
349
|
+
':',
|
350
|
+
' ',
|
351
|
+
format(node.return_type),
|
352
|
+
';'
|
353
|
+
].join(''),
|
354
|
+
*if node.types and node.types.length > 0
|
355
|
+
indent(node.types.map{|x| format(x)}.join("\n"))
|
356
|
+
end,
|
357
|
+
*if node.entities and node.entities.length > 0
|
358
|
+
indent(node.entities.map{|x| format(x)}.join("\n"))
|
359
|
+
end,
|
360
|
+
*if node.subtype_constraints and node.subtype_constraints.length > 0
|
361
|
+
indent(node.subtype_constraints.map{|x| format(x)}.join("\n"))
|
362
|
+
end,
|
363
|
+
*if node.functions and node.functions.length > 0
|
364
|
+
indent(node.functions.map{|x| format(x)}.join("\n"))
|
365
|
+
end,
|
366
|
+
*if node.procedures and node.procedures.length > 0
|
367
|
+
indent(node.procedures.map{|x| format(x)}.join("\n"))
|
368
|
+
end,
|
369
|
+
*if node.constants and node.constants.length > 0
|
370
|
+
indent([
|
371
|
+
'CONSTANT',
|
372
|
+
indent(node.constants.map{|x| format(x)}.join("\n")),
|
373
|
+
[
|
374
|
+
'END_CONSTANT',
|
375
|
+
';'
|
376
|
+
].join('')
|
377
|
+
].join("\n"))
|
378
|
+
end,
|
379
|
+
*if node.variables and node.variables.length > 0
|
380
|
+
indent([
|
381
|
+
'LOCAL',
|
382
|
+
indent(node.variables.map{|x| format(x)}.join("\n")),
|
383
|
+
[
|
384
|
+
'END_LOCAL',
|
385
|
+
';'
|
386
|
+
].join('')
|
387
|
+
].join("\n"))
|
388
|
+
end,
|
389
|
+
*if node.statements and node.statements.length > 0
|
390
|
+
indent(node.statements.map{|x| format(x)}.join("\n"))
|
391
|
+
end,
|
392
|
+
[
|
393
|
+
'END_FUNCTION',
|
394
|
+
';'
|
395
|
+
].join('')
|
396
|
+
].join("\n")
|
397
|
+
end
|
398
|
+
|
399
|
+
def format_interface(node)
|
400
|
+
[
|
401
|
+
case node.kind
|
402
|
+
when Model::Interface::USE then 'USE'
|
403
|
+
when Model::Interface::REFERENCE then 'REFERENCE'
|
404
|
+
end,
|
405
|
+
' ',
|
406
|
+
'FROM',
|
407
|
+
' ',
|
408
|
+
format(node.schema),
|
409
|
+
*if node.items and node.items.length > 0
|
410
|
+
[
|
411
|
+
"\n",
|
412
|
+
INDENT,
|
413
|
+
'(',
|
414
|
+
node.items.map{|x| format(x)}.join(', '),
|
415
|
+
')'
|
416
|
+
].join('')
|
417
|
+
end,
|
418
|
+
';',
|
419
|
+
].join('')
|
420
|
+
end
|
421
|
+
|
422
|
+
def format_parameter(node)
|
423
|
+
[
|
424
|
+
*if node.var
|
425
|
+
[
|
426
|
+
'VAR',
|
427
|
+
' '
|
428
|
+
].join('')
|
429
|
+
end,
|
430
|
+
node.id,
|
431
|
+
' ',
|
432
|
+
':',
|
433
|
+
' ',
|
434
|
+
format(node.type)
|
435
|
+
].join('')
|
436
|
+
end
|
437
|
+
|
438
|
+
def format_procedure(node)
|
439
|
+
[
|
440
|
+
[
|
441
|
+
'PROCEDURE',
|
442
|
+
' ',
|
443
|
+
node.id,
|
444
|
+
*if node.parameters and node.parameters.length > 0
|
445
|
+
[
|
446
|
+
'(',
|
447
|
+
node.parameters.map{|x| format(x)}.join('; '),
|
448
|
+
')'
|
449
|
+
].join('')
|
450
|
+
end,
|
451
|
+
';'
|
452
|
+
].join(''),
|
453
|
+
*if node.types and node.types.length > 0
|
454
|
+
indent(node.types.map{|x| format(x)}.join("\n"))
|
455
|
+
end,
|
456
|
+
*if node.entities and node.entities.length > 0
|
457
|
+
indent(node.entities.map{|x| format(x)}.join("\n"))
|
458
|
+
end,
|
459
|
+
*if node.subtype_constraints and node.subtype_constraints.length > 0
|
460
|
+
indent(node.subtype_constraints.map{|x| format(x)}.join("\n"))
|
461
|
+
end,
|
462
|
+
*if node.functions and node.functions.length > 0
|
463
|
+
indent(node.functions.map{|x| format(x)}.join("\n"))
|
464
|
+
end,
|
465
|
+
*if node.procedures and node.procedures.length > 0
|
466
|
+
indent(node.procedures.map{|x| format(x)}.join("\n"))
|
467
|
+
end,
|
468
|
+
*if node.constants and node.constants.length > 0
|
469
|
+
indent([
|
470
|
+
'CONSTANT',
|
471
|
+
indent(node.constants.map{|x| format(x)}.join("\n")),
|
472
|
+
[
|
473
|
+
'END_CONSTANT',
|
474
|
+
';'
|
475
|
+
].join('')
|
476
|
+
].join("\n"))
|
477
|
+
end,
|
478
|
+
*if node.variables and node.variables.length > 0
|
479
|
+
indent([
|
480
|
+
'LOCAL',
|
481
|
+
indent(node.variables.map{|x| format(x)}.join("\n")),
|
482
|
+
[
|
483
|
+
'END_LOCAL',
|
484
|
+
';'
|
485
|
+
].join('')
|
486
|
+
].join("\n"))
|
487
|
+
end,
|
488
|
+
*if node.statements and node.statements.length > 0
|
489
|
+
indent(node.statements.map{|x| format(x)}.join("\n"))
|
490
|
+
end,
|
491
|
+
[
|
492
|
+
'END_PROCEDURE',
|
493
|
+
';'
|
494
|
+
].join('')
|
495
|
+
].join("\n")
|
496
|
+
end
|
497
|
+
|
498
|
+
def format_renamed_ref(node)
|
499
|
+
[
|
500
|
+
format(node.ref),
|
501
|
+
' ',
|
502
|
+
'AS',
|
503
|
+
' ',
|
504
|
+
node.id
|
505
|
+
].join('')
|
506
|
+
end
|
507
|
+
|
508
|
+
def format_repository(node)
|
509
|
+
[
|
510
|
+
*if node.schemas and node.schemas.length > 0
|
511
|
+
node.schemas.map{|node| format(node)}
|
512
|
+
end,
|
513
|
+
*format_scope_remarks(node)
|
514
|
+
].join("\n")
|
515
|
+
end
|
516
|
+
|
517
|
+
def format_rule(node)
|
518
|
+
[
|
519
|
+
[
|
520
|
+
'RULE',
|
521
|
+
' ',
|
522
|
+
node.id,
|
523
|
+
' ',
|
524
|
+
'FOR',
|
525
|
+
' ',
|
526
|
+
'(',
|
527
|
+
node.applies_to.map{|x| format(x)}.join(', '),
|
528
|
+
')',
|
529
|
+
';'
|
530
|
+
].join(''),
|
531
|
+
*if node.types and node.types.length > 0
|
532
|
+
indent(node.types.map{|x| format(x)}.join("\n"))
|
533
|
+
end,
|
534
|
+
*if node.entities and node.entities.length > 0
|
535
|
+
indent(node.entities.map{|x| format(x)}.join("\n"))
|
536
|
+
end,
|
537
|
+
*if node.subtype_constraints and node.subtype_constraints.length > 0
|
538
|
+
indent(node.subtype_constraints.map{|x| format(x)}.join("\n"))
|
539
|
+
end,
|
540
|
+
*if node.functions and node.functions.length > 0
|
541
|
+
indent(node.functions.map{|x| format(x)}.join("\n"))
|
542
|
+
end,
|
543
|
+
*if node.procedures and node.procedures.length > 0
|
544
|
+
indent(node.procedures.map{|x| format(x)}.join("\n"))
|
545
|
+
end,
|
546
|
+
*if node.constants and node.constants.length > 0
|
547
|
+
indent([
|
548
|
+
'CONSTANT',
|
549
|
+
indent(node.constants.map{|x| format(x)}.join("\n")),
|
550
|
+
[
|
551
|
+
'END_CONSTANT',
|
552
|
+
';'
|
553
|
+
].join('')
|
554
|
+
].join("\n"))
|
555
|
+
end,
|
556
|
+
*if node.variables and node.variables.length > 0
|
557
|
+
indent([
|
558
|
+
'LOCAL',
|
559
|
+
indent(node.variables.map{|x| format(x)}.join("\n")),
|
560
|
+
[
|
561
|
+
'END_LOCAL',
|
562
|
+
';'
|
563
|
+
].join('')
|
564
|
+
].join("\n"))
|
565
|
+
end,
|
566
|
+
*if node.statements and node.statements.length > 0
|
567
|
+
indent(node.statements.map{|x| format(x)}.join("\n"))
|
568
|
+
end,
|
569
|
+
*if node.where and node.where.length > 0
|
570
|
+
indent([
|
571
|
+
'WHERE',
|
572
|
+
indent(node.where.map{|x| format(x)}.join("\n"))
|
573
|
+
].join("\n"))
|
574
|
+
end,
|
575
|
+
[
|
576
|
+
'END_RULE',
|
577
|
+
';'
|
578
|
+
].join('')
|
579
|
+
].join("\n")
|
580
|
+
end
|
581
|
+
|
582
|
+
def format_schema(node)
|
583
|
+
[
|
584
|
+
[
|
585
|
+
'SCHEMA',
|
586
|
+
' ',
|
587
|
+
node.id,
|
588
|
+
*if node.version
|
589
|
+
[
|
590
|
+
' ',
|
591
|
+
format(node.version),
|
592
|
+
].join('')
|
593
|
+
end,
|
594
|
+
';'
|
595
|
+
].join(''),
|
596
|
+
*if node.interfaces and node.interfaces.length > 0
|
597
|
+
node.interfaces.map{|x| format(x)}.join("\n")
|
598
|
+
end,
|
599
|
+
*if node.constants and node.constants.length > 0
|
600
|
+
[
|
601
|
+
'CONSTANT',
|
602
|
+
indent(node.constants.map{|x| format(x)}.join("\n")),
|
603
|
+
[
|
604
|
+
'END_CONSTANT',
|
605
|
+
';'
|
606
|
+
].join('')
|
607
|
+
].join("\n")
|
608
|
+
end,
|
609
|
+
*if node.types and node.types.length > 0
|
610
|
+
node.types.map{|x| format(x)}.join("\n")
|
611
|
+
end,
|
612
|
+
*if node.entities and node.entities.length > 0
|
613
|
+
node.entities.map{|x| format(x)}.join("\n")
|
614
|
+
end,
|
615
|
+
*if node.subtype_constraints and node.subtype_constraints.length > 0
|
616
|
+
node.subtype_constraints.map{|x| format(x)}.join("\n")
|
617
|
+
end,
|
618
|
+
*if node.functions and node.functions.length > 0
|
619
|
+
node.functions.map{|x| format(x)}.join("\n")
|
620
|
+
end,
|
621
|
+
*if node.procedures and node.procedures.length > 0
|
622
|
+
node.procedures.map{|x| format(x)}.join("\n")
|
623
|
+
end,
|
624
|
+
*if node.rules and node.rules.length > 0
|
625
|
+
node.rules.map{|x| format(x)}.join("\n")
|
626
|
+
end,
|
627
|
+
[
|
628
|
+
'END_SCHEMA',
|
629
|
+
';'
|
630
|
+
].join('')
|
631
|
+
].join("\n")
|
632
|
+
end
|
633
|
+
|
634
|
+
def format_subtype_constraint(node)
|
635
|
+
[
|
636
|
+
[
|
637
|
+
'SUBTYPE_CONSTRAINT',
|
638
|
+
' ',
|
639
|
+
node.id,
|
640
|
+
' ',
|
641
|
+
'FOR',
|
642
|
+
' ',
|
643
|
+
format(node.applies_to),
|
644
|
+
';'
|
645
|
+
].join(''),
|
646
|
+
*if node.abstract
|
647
|
+
indent([
|
648
|
+
'ABSTRACT',
|
649
|
+
' ',
|
650
|
+
'SUPERTYPE',
|
651
|
+
';'
|
652
|
+
].join(''))
|
653
|
+
end,
|
654
|
+
*if node.total_over and node.total_over.length > 0
|
655
|
+
indent([
|
656
|
+
'TOTAL_OVER',
|
657
|
+
'(',
|
658
|
+
node.total_over.map{|x| format(x)}.join(', '),
|
659
|
+
')',
|
660
|
+
';'
|
661
|
+
].join(''))
|
662
|
+
end,
|
663
|
+
*if node.supertype_expression
|
664
|
+
indent([
|
665
|
+
format(node.supertype_expression),
|
666
|
+
';'
|
667
|
+
].join(''))
|
668
|
+
end,
|
669
|
+
[
|
670
|
+
'END_SUBTYPE_CONSTRAINT',
|
671
|
+
';'
|
672
|
+
].join('')
|
673
|
+
].join("\n")
|
674
|
+
end
|
675
|
+
|
676
|
+
def format_type(node)
|
677
|
+
[
|
678
|
+
[
|
679
|
+
'TYPE',
|
680
|
+
' ',
|
681
|
+
node.id,
|
682
|
+
' ',
|
683
|
+
'=',
|
684
|
+
' ',
|
685
|
+
format(node.type),
|
686
|
+
';',
|
687
|
+
].join(''),
|
688
|
+
*if node.where and node.where.length > 0
|
689
|
+
indent([
|
690
|
+
'WHERE',
|
691
|
+
indent(node.where.map{|x| format(x)}.join("\n"))
|
692
|
+
].join("\n"))
|
693
|
+
end,
|
694
|
+
[
|
695
|
+
'END_TYPE',
|
696
|
+
';'
|
697
|
+
].join('')
|
698
|
+
].join("\n")
|
699
|
+
end
|
700
|
+
|
701
|
+
def format_unique(node)
|
702
|
+
[
|
703
|
+
*if node.id
|
704
|
+
[
|
705
|
+
node.id,
|
706
|
+
' ',
|
707
|
+
':',
|
708
|
+
' '
|
709
|
+
].join('')
|
710
|
+
end,
|
711
|
+
node.attributes.map{|x| format(x)}.join(', '),
|
712
|
+
';'
|
713
|
+
].join('')
|
714
|
+
end
|
715
|
+
|
716
|
+
def format_variable(node)
|
717
|
+
[
|
718
|
+
node.id,
|
719
|
+
' ',
|
720
|
+
':',
|
721
|
+
' ',
|
722
|
+
format(node.type),
|
723
|
+
*if node.expression
|
724
|
+
[
|
725
|
+
' ',
|
726
|
+
':=',
|
727
|
+
' ',
|
728
|
+
format(node.expression),
|
729
|
+
].join('')
|
730
|
+
end,
|
731
|
+
';'
|
732
|
+
].join('')
|
733
|
+
end
|
734
|
+
|
735
|
+
def format_where(node)
|
736
|
+
[
|
737
|
+
*if node.id
|
738
|
+
[
|
739
|
+
node.id,
|
740
|
+
' ',
|
741
|
+
':',
|
742
|
+
' '
|
743
|
+
].join('')
|
744
|
+
end,
|
745
|
+
format(node.expression),
|
746
|
+
';'
|
747
|
+
].join('')
|
748
|
+
end
|
749
|
+
|
750
|
+
def format_expressions_aggregate_initializer(node)
|
751
|
+
[
|
752
|
+
'[',
|
753
|
+
node.items.map{|x| format(x)}.join(', '),
|
754
|
+
']'
|
755
|
+
].join('')
|
756
|
+
end
|
757
|
+
|
758
|
+
def format_expressions_aggregate_item(node)
|
759
|
+
[
|
760
|
+
format(node.expression),
|
761
|
+
':',
|
762
|
+
format(node.repetition)
|
763
|
+
].join('')
|
764
|
+
end
|
765
|
+
|
766
|
+
def format_expressions_attribute_reference(node)
|
767
|
+
[
|
768
|
+
format(node.ref),
|
769
|
+
'.',
|
770
|
+
format(node.attribute)
|
771
|
+
].join('')
|
772
|
+
end
|
773
|
+
|
774
|
+
def format_expressions_binary_expression(node)
|
775
|
+
[
|
776
|
+
*if node.operand1.instance_of? Model::Expressions::BinaryExpression and OPERATOR_PRECEDENCE[node.operand1.operator] > OPERATOR_PRECEDENCE[node.operator]
|
777
|
+
'('
|
778
|
+
end,
|
779
|
+
format(node.operand1),
|
780
|
+
*if node.operand1.instance_of? Model::Expressions::BinaryExpression and OPERATOR_PRECEDENCE[node.operand1.operator] > OPERATOR_PRECEDENCE[node.operator]
|
781
|
+
')'
|
782
|
+
end,
|
783
|
+
' ',
|
784
|
+
case node.operator
|
785
|
+
when Model::Expressions::BinaryExpression::ADDITION then '+'
|
786
|
+
when Model::Expressions::BinaryExpression::AND then 'AND'
|
787
|
+
when Model::Expressions::BinaryExpression::ANDOR then 'ANDOR'
|
788
|
+
when Model::Expressions::BinaryExpression::COMBINE then '||'
|
789
|
+
when Model::Expressions::BinaryExpression::EQUAL then '='
|
790
|
+
when Model::Expressions::BinaryExpression::EXPONENTIATION then '**'
|
791
|
+
when Model::Expressions::BinaryExpression::GREATER_THAN then '>'
|
792
|
+
when Model::Expressions::BinaryExpression::GREATER_THAN_OR_EQUAL then '>='
|
793
|
+
when Model::Expressions::BinaryExpression::IN then 'IN'
|
794
|
+
when Model::Expressions::BinaryExpression::INSTANCE_EQUAL then ':=:'
|
795
|
+
when Model::Expressions::BinaryExpression::INSTANCE_NOT_EQUAL then ':<>:'
|
796
|
+
when Model::Expressions::BinaryExpression::INTEGER_DIVISION then 'DIV'
|
797
|
+
when Model::Expressions::BinaryExpression::LESS_THAN then '<'
|
798
|
+
when Model::Expressions::BinaryExpression::LESS_THAN_OR_EQUAL then '<='
|
799
|
+
when Model::Expressions::BinaryExpression::LIKE then 'LIKE'
|
800
|
+
when Model::Expressions::BinaryExpression::MODULO then 'MOD'
|
801
|
+
when Model::Expressions::BinaryExpression::MULTIPLICATION then '*'
|
802
|
+
when Model::Expressions::BinaryExpression::NOT_EQUAL then '<>'
|
803
|
+
when Model::Expressions::BinaryExpression::OR then 'OR'
|
804
|
+
when Model::Expressions::BinaryExpression::REAL_DIVISION then '/'
|
805
|
+
when Model::Expressions::BinaryExpression::SUBTRACTION then '-'
|
806
|
+
when Model::Expressions::BinaryExpression::XOR then 'XOR'
|
807
|
+
end,
|
808
|
+
' ',
|
809
|
+
*if node.operand2.instance_of? Model::Expressions::BinaryExpression and OPERATOR_PRECEDENCE[node.operand2.operator] > OPERATOR_PRECEDENCE[node.operator]
|
810
|
+
'('
|
811
|
+
end,
|
812
|
+
format(node.operand2),
|
813
|
+
*if node.operand2.instance_of? Model::Expressions::BinaryExpression and OPERATOR_PRECEDENCE[node.operand2.operator] > OPERATOR_PRECEDENCE[node.operator]
|
814
|
+
')'
|
815
|
+
end,
|
816
|
+
].join('')
|
817
|
+
end
|
818
|
+
|
819
|
+
def format_expressions_call(node)
|
820
|
+
[
|
821
|
+
format(node.ref),
|
822
|
+
'(',
|
823
|
+
node.parameters.map{|x| format(x)}.join(', '),
|
824
|
+
')'
|
825
|
+
].join('')
|
826
|
+
end
|
827
|
+
|
828
|
+
def format_expressions_entity_constructor(node)
|
829
|
+
[
|
830
|
+
format(node.entity),
|
831
|
+
'(',
|
832
|
+
node.parameters.map{|x| format(x)}.join(', '),
|
833
|
+
')'
|
834
|
+
].join('')
|
835
|
+
end
|
836
|
+
|
837
|
+
def format_expressions_group_reference(node)
|
838
|
+
[
|
839
|
+
format(node.ref),
|
840
|
+
'\\',
|
841
|
+
format(node.entity)
|
842
|
+
].join('')
|
843
|
+
end
|
844
|
+
|
845
|
+
def format_expressions_index_reference(node)
|
846
|
+
[
|
847
|
+
format(node.ref),
|
848
|
+
'[',
|
849
|
+
format(node.index1),
|
850
|
+
*if node.index2
|
851
|
+
[
|
852
|
+
':',
|
853
|
+
format(node.index2)
|
854
|
+
].join('')
|
855
|
+
end,
|
856
|
+
']'
|
857
|
+
].join('')
|
858
|
+
end
|
859
|
+
|
860
|
+
def format_expressions_interval(node)
|
861
|
+
[
|
862
|
+
'{',
|
863
|
+
format(node.low),
|
864
|
+
' ',
|
865
|
+
case node.operator1
|
866
|
+
when Model::Expressions::BinaryExpression::LESS_THAN then '<'
|
867
|
+
when Model::Expressions::BinaryExpression::LESS_THAN_OR_EQUAL then '<='
|
868
|
+
end,
|
869
|
+
' ',
|
870
|
+
format(node.item),
|
871
|
+
' ',
|
872
|
+
case node.operator2
|
873
|
+
when Model::Expressions::BinaryExpression::LESS_THAN then '<'
|
874
|
+
when Model::Expressions::BinaryExpression::LESS_THAN_OR_EQUAL then '<='
|
875
|
+
end,
|
876
|
+
' ',
|
877
|
+
format(node.high),
|
878
|
+
'}'
|
879
|
+
].join('')
|
880
|
+
end
|
881
|
+
|
882
|
+
def format_expressions_query_expression(node)
|
883
|
+
[
|
884
|
+
'QUERY',
|
885
|
+
'(',
|
886
|
+
node.id,
|
887
|
+
' ',
|
888
|
+
'<*',
|
889
|
+
' ',
|
890
|
+
format(node.aggregate_source),
|
891
|
+
' ',
|
892
|
+
'|',
|
893
|
+
' ',
|
894
|
+
format(node.expression),
|
895
|
+
*format_remarks(node).instance_eval{|x| x.length > 0 ? ["\n", *x, "\n"] : x},
|
896
|
+
')'
|
897
|
+
].join('')
|
898
|
+
end
|
899
|
+
|
900
|
+
def format_expressions_simple_reference(node)
|
901
|
+
node.id
|
902
|
+
end
|
903
|
+
|
904
|
+
def format_expressions_unary_expression(node)
|
905
|
+
[
|
906
|
+
case node.operator
|
907
|
+
when Model::Expressions::UnaryExpression::MINUS then '-'
|
908
|
+
when Model::Expressions::UnaryExpression::NOT then 'NOT'
|
909
|
+
when Model::Expressions::UnaryExpression::PLUS then '+'
|
910
|
+
end,
|
911
|
+
if node.operator == Model::Expressions::UnaryExpression::NOT
|
912
|
+
' '
|
913
|
+
end,
|
914
|
+
*if node.operand.instance_of? Model::Expressions::BinaryExpression
|
915
|
+
'('
|
916
|
+
end,
|
917
|
+
format(node.operand),
|
918
|
+
*if node.operand.instance_of? Model::Expressions::BinaryExpression
|
919
|
+
')'
|
920
|
+
end
|
921
|
+
].join('')
|
922
|
+
end
|
923
|
+
|
924
|
+
def format_literals_binary(node)
|
925
|
+
[
|
926
|
+
'%',
|
927
|
+
node.value
|
928
|
+
].join('')
|
929
|
+
end
|
930
|
+
|
931
|
+
def format_literals_integer(node)
|
932
|
+
node.value
|
933
|
+
end
|
934
|
+
|
935
|
+
def format_literals_logical(node)
|
936
|
+
case node.value
|
937
|
+
when Model::Literals::Logical::TRUE then 'TRUE'
|
938
|
+
when Model::Literals::Logical::FALSE then 'FALSE'
|
939
|
+
when Model::Literals::Logical::UNKNOWN then 'UNKNOWN'
|
940
|
+
end
|
941
|
+
end
|
942
|
+
|
943
|
+
def format_literals_real(node)
|
944
|
+
node.value
|
945
|
+
end
|
946
|
+
|
947
|
+
def format_literals_string(node)
|
948
|
+
if node.encoded
|
949
|
+
[
|
950
|
+
"\"",
|
951
|
+
node.value,
|
952
|
+
"\""
|
953
|
+
].join('')
|
954
|
+
else
|
955
|
+
[
|
956
|
+
"'",
|
957
|
+
node.value,
|
958
|
+
"'"
|
959
|
+
].join('')
|
960
|
+
end
|
961
|
+
end
|
962
|
+
|
963
|
+
def format_statements_alias(node)
|
964
|
+
[
|
965
|
+
[
|
966
|
+
'ALIAS',
|
967
|
+
' ',
|
968
|
+
node.id,
|
969
|
+
' ',
|
970
|
+
'FOR',
|
971
|
+
' ',
|
972
|
+
format(node.expression),
|
973
|
+
';'
|
974
|
+
].join(''),
|
975
|
+
*if node.statements and node.statements.length > 0
|
976
|
+
indent(node.statements.map{|x| format(x)}.join("\n"))
|
977
|
+
end,
|
978
|
+
*format_remarks(node),
|
979
|
+
[
|
980
|
+
'END_ALIAS',
|
981
|
+
';'
|
982
|
+
].join('')
|
983
|
+
].join("\n")
|
984
|
+
end
|
985
|
+
|
986
|
+
def format_statements_assignment(node)
|
987
|
+
[
|
988
|
+
format(node.ref),
|
989
|
+
' ',
|
990
|
+
':=',
|
991
|
+
' ',
|
992
|
+
format(node.expression),
|
993
|
+
';'
|
994
|
+
].join('')
|
995
|
+
end
|
996
|
+
|
997
|
+
def format_statements_call(node)
|
998
|
+
[
|
999
|
+
format(node.ref),
|
1000
|
+
*if node.parameters and node.parameters.length > 0
|
1001
|
+
[
|
1002
|
+
'(',
|
1003
|
+
node.parameters.map{|x| format(x)}.join(', '),
|
1004
|
+
')'
|
1005
|
+
].join('')
|
1006
|
+
end,
|
1007
|
+
';'
|
1008
|
+
].join('')
|
1009
|
+
end
|
1010
|
+
|
1011
|
+
def format_statements_case(node)
|
1012
|
+
[
|
1013
|
+
[
|
1014
|
+
'CASE',
|
1015
|
+
' ',
|
1016
|
+
format(node.expression),
|
1017
|
+
' ',
|
1018
|
+
'OF'
|
1019
|
+
].join(''),
|
1020
|
+
*if node.actions and node.actions.length > 0
|
1021
|
+
node.actions.map{|x| format(x)}
|
1022
|
+
end,
|
1023
|
+
*if node.otherwise_statement
|
1024
|
+
[
|
1025
|
+
[
|
1026
|
+
'OTHERWISE',
|
1027
|
+
' ',
|
1028
|
+
':'
|
1029
|
+
].join(''),
|
1030
|
+
indent(format(node.otherwise_statement))
|
1031
|
+
]
|
1032
|
+
end,
|
1033
|
+
[
|
1034
|
+
'END_CASE',
|
1035
|
+
';'
|
1036
|
+
].join('')
|
1037
|
+
].join("\n")
|
1038
|
+
end
|
1039
|
+
|
1040
|
+
def format_statements_case_action(node)
|
1041
|
+
[
|
1042
|
+
[
|
1043
|
+
node.labels.map{|x| format(x)}.join(', '),
|
1044
|
+
' ',
|
1045
|
+
':'
|
1046
|
+
].join(''),
|
1047
|
+
indent(format(node.statement))
|
1048
|
+
].join("\n")
|
1049
|
+
end
|
1050
|
+
|
1051
|
+
def format_statements_compound(node)
|
1052
|
+
[
|
1053
|
+
'BEGIN',
|
1054
|
+
*if node.statements and node.statements.length > 0
|
1055
|
+
indent(node.statements.map{|x| format(x)}.join("\n"))
|
1056
|
+
end,
|
1057
|
+
[
|
1058
|
+
'END',
|
1059
|
+
';'
|
1060
|
+
].join('')
|
1061
|
+
].join("\n")
|
1062
|
+
end
|
1063
|
+
|
1064
|
+
def format_statements_escape(node)
|
1065
|
+
[
|
1066
|
+
'ESCAPE',
|
1067
|
+
';'
|
1068
|
+
].join('')
|
1069
|
+
end
|
1070
|
+
|
1071
|
+
def format_statements_if(node)
|
1072
|
+
[
|
1073
|
+
[
|
1074
|
+
'IF',
|
1075
|
+
' ',
|
1076
|
+
format(node.expression),
|
1077
|
+
' ',
|
1078
|
+
'THEN'
|
1079
|
+
].join(''),
|
1080
|
+
*if node.statements and node.statements.length > 0
|
1081
|
+
indent(node.statements.map{|x| format(x)}.join("\n"))
|
1082
|
+
end,
|
1083
|
+
*if node.else_statements and node.else_statements.length > 0
|
1084
|
+
[
|
1085
|
+
'ELSE',
|
1086
|
+
indent(node.else_statements.map{|x| format(x)}.join("\n")),
|
1087
|
+
].join("\n")
|
1088
|
+
end,
|
1089
|
+
[
|
1090
|
+
'END_IF',
|
1091
|
+
';'
|
1092
|
+
].join('')
|
1093
|
+
].join("\n")
|
1094
|
+
end
|
1095
|
+
|
1096
|
+
def format_statements_null(node)
|
1097
|
+
';'
|
1098
|
+
end
|
1099
|
+
|
1100
|
+
def format_statements_repeat(node)
|
1101
|
+
[
|
1102
|
+
[
|
1103
|
+
'REPEAT',
|
1104
|
+
*if node.id
|
1105
|
+
[
|
1106
|
+
' ',
|
1107
|
+
node.id,
|
1108
|
+
' ',
|
1109
|
+
':=',
|
1110
|
+
' ',
|
1111
|
+
format(node.bound1),
|
1112
|
+
' ',
|
1113
|
+
'TO',
|
1114
|
+
' ',
|
1115
|
+
format(node.bound2),
|
1116
|
+
*if node.increment
|
1117
|
+
[
|
1118
|
+
' ',
|
1119
|
+
'BY',
|
1120
|
+
' ',
|
1121
|
+
format(node.increment)
|
1122
|
+
].join('')
|
1123
|
+
end
|
1124
|
+
].join('')
|
1125
|
+
end,
|
1126
|
+
*if node.while_expression
|
1127
|
+
[
|
1128
|
+
' ',
|
1129
|
+
'WHILE',
|
1130
|
+
' ',
|
1131
|
+
format(node.while_expression)
|
1132
|
+
].join('')
|
1133
|
+
end,
|
1134
|
+
*if node.until_expression
|
1135
|
+
[
|
1136
|
+
' ',
|
1137
|
+
'UNTIL',
|
1138
|
+
' ',
|
1139
|
+
format(node.until_expression)
|
1140
|
+
].join('')
|
1141
|
+
end,
|
1142
|
+
';'
|
1143
|
+
].join(''),
|
1144
|
+
*if node.statements and node.statements.length > 0
|
1145
|
+
indent(node.statements.map{|x| format(x)}.join("\n"))
|
1146
|
+
end,
|
1147
|
+
*format_remarks(node),
|
1148
|
+
[
|
1149
|
+
'END_REPEAT',
|
1150
|
+
';'
|
1151
|
+
].join('')
|
1152
|
+
].join("\n")
|
1153
|
+
end
|
1154
|
+
|
1155
|
+
def format_statements_return(node)
|
1156
|
+
[
|
1157
|
+
'RETURN',
|
1158
|
+
*if node.expression
|
1159
|
+
[
|
1160
|
+
' ',
|
1161
|
+
'(',
|
1162
|
+
format(node.expression),
|
1163
|
+
')'
|
1164
|
+
].join('')
|
1165
|
+
end,
|
1166
|
+
';'
|
1167
|
+
].join('')
|
1168
|
+
end
|
1169
|
+
|
1170
|
+
def format_statements_skip(node)
|
1171
|
+
[
|
1172
|
+
'SKIP',
|
1173
|
+
';'
|
1174
|
+
].join('')
|
1175
|
+
end
|
1176
|
+
|
1177
|
+
def format_types_aggregate(node)
|
1178
|
+
'AGGREGATE'
|
1179
|
+
end
|
1180
|
+
|
1181
|
+
def format_types_array(node)
|
1182
|
+
[
|
1183
|
+
'ARRAY',
|
1184
|
+
*if node.bound1 and node.bound2
|
1185
|
+
[
|
1186
|
+
' ',
|
1187
|
+
'[',
|
1188
|
+
format(node.bound1),
|
1189
|
+
':',
|
1190
|
+
format(node.bound2),
|
1191
|
+
']',
|
1192
|
+
].join('')
|
1193
|
+
end,
|
1194
|
+
' ',
|
1195
|
+
'OF',
|
1196
|
+
*if node.optional
|
1197
|
+
[
|
1198
|
+
' ',
|
1199
|
+
'OPTIONAL'
|
1200
|
+
].join('')
|
1201
|
+
end,
|
1202
|
+
*if node.unique
|
1203
|
+
[
|
1204
|
+
' ',
|
1205
|
+
'UNIQUE'
|
1206
|
+
].join('')
|
1207
|
+
end,
|
1208
|
+
' ',
|
1209
|
+
format(node.base_type)
|
1210
|
+
].join('')
|
1211
|
+
end
|
1212
|
+
|
1213
|
+
def format_types_bag(node)
|
1214
|
+
[
|
1215
|
+
'BAG',
|
1216
|
+
*if node.bound1 and node.bound2
|
1217
|
+
[
|
1218
|
+
' ',
|
1219
|
+
'[',
|
1220
|
+
format(node.bound1),
|
1221
|
+
':',
|
1222
|
+
format(node.bound2),
|
1223
|
+
']',
|
1224
|
+
].join('')
|
1225
|
+
end,
|
1226
|
+
' ',
|
1227
|
+
'OF',
|
1228
|
+
' ',
|
1229
|
+
format(node.base_type)
|
1230
|
+
].join('')
|
1231
|
+
end
|
1232
|
+
|
1233
|
+
def format_types_binary(node)
|
1234
|
+
[
|
1235
|
+
'BINARY',
|
1236
|
+
*if node.width
|
1237
|
+
[
|
1238
|
+
' ',
|
1239
|
+
'(',
|
1240
|
+
format(node.width),
|
1241
|
+
')'
|
1242
|
+
].join('')
|
1243
|
+
end,
|
1244
|
+
*if node.fixed
|
1245
|
+
[
|
1246
|
+
' ',
|
1247
|
+
'FIXED'
|
1248
|
+
].join('')
|
1249
|
+
end
|
1250
|
+
].join('')
|
1251
|
+
end
|
1252
|
+
|
1253
|
+
def format_types_boolean(node)
|
1254
|
+
'BOOLEAN'
|
1255
|
+
end
|
1256
|
+
|
1257
|
+
def format_types_enumeration(node)
|
1258
|
+
[
|
1259
|
+
*if node.extensible
|
1260
|
+
[
|
1261
|
+
'EXTENSIBLE',
|
1262
|
+
' '
|
1263
|
+
].join('')
|
1264
|
+
end,
|
1265
|
+
'ENUMERATION',
|
1266
|
+
*if node.items and node.items.length > 0
|
1267
|
+
[
|
1268
|
+
' ',
|
1269
|
+
'OF',
|
1270
|
+
' ',
|
1271
|
+
'(',
|
1272
|
+
node.items.map{|x| format(x)}.join(', '),
|
1273
|
+
')'
|
1274
|
+
].join('')
|
1275
|
+
end,
|
1276
|
+
*if node.extension_type
|
1277
|
+
[
|
1278
|
+
' ',
|
1279
|
+
'BASED_ON',
|
1280
|
+
' ',
|
1281
|
+
format(node.extension_type)
|
1282
|
+
].join('')
|
1283
|
+
end,
|
1284
|
+
*if node.extension_items and node.extension_items.length > 0
|
1285
|
+
[
|
1286
|
+
' ',
|
1287
|
+
'WITH',
|
1288
|
+
' ',
|
1289
|
+
'(',
|
1290
|
+
node.extension_items.map{|x| format(x)}.join(', '),
|
1291
|
+
')'
|
1292
|
+
].join('')
|
1293
|
+
end
|
1294
|
+
].join('')
|
1295
|
+
end
|
1296
|
+
|
1297
|
+
def format_types_generic_entity(node)
|
1298
|
+
'GENERIC_ENTITY'
|
1299
|
+
end
|
1300
|
+
|
1301
|
+
def format_types_generic(node)
|
1302
|
+
'GENERIC'
|
1303
|
+
end
|
1304
|
+
|
1305
|
+
def format_types_integer(node)
|
1306
|
+
'INTEGER'
|
1307
|
+
end
|
1308
|
+
|
1309
|
+
def format_types_list(node)
|
1310
|
+
[
|
1311
|
+
'LIST',
|
1312
|
+
*if node.bound1 and node.bound2
|
1313
|
+
[
|
1314
|
+
' ',
|
1315
|
+
'[',
|
1316
|
+
format(node.bound1),
|
1317
|
+
':',
|
1318
|
+
format(node.bound2),
|
1319
|
+
']',
|
1320
|
+
].join('')
|
1321
|
+
end,
|
1322
|
+
' ',
|
1323
|
+
'OF',
|
1324
|
+
*if node.unique
|
1325
|
+
[
|
1326
|
+
' ',
|
1327
|
+
'UNIQUE'
|
1328
|
+
].join('')
|
1329
|
+
end,
|
1330
|
+
' ',
|
1331
|
+
format(node.base_type)
|
1332
|
+
].join('')
|
1333
|
+
end
|
1334
|
+
|
1335
|
+
def format_types_logical(node)
|
1336
|
+
'LOGICAL'
|
1337
|
+
end
|
1338
|
+
|
1339
|
+
def format_types_number(node)
|
1340
|
+
'NUMBER'
|
1341
|
+
end
|
1342
|
+
|
1343
|
+
def format_types_real(node)
|
1344
|
+
[
|
1345
|
+
'REAL',
|
1346
|
+
*if node.precision
|
1347
|
+
[
|
1348
|
+
' ',
|
1349
|
+
'(',
|
1350
|
+
format(node.precision),
|
1351
|
+
')'
|
1352
|
+
].join('')
|
1353
|
+
end
|
1354
|
+
].join('')
|
1355
|
+
end
|
1356
|
+
|
1357
|
+
def format_types_select(node)
|
1358
|
+
[
|
1359
|
+
*if node.extensible
|
1360
|
+
[
|
1361
|
+
'EXTENSIBLE',
|
1362
|
+
' '
|
1363
|
+
].join('')
|
1364
|
+
end,
|
1365
|
+
*if node.generic_entity
|
1366
|
+
[
|
1367
|
+
'GENERIC_ENTITY',
|
1368
|
+
' '
|
1369
|
+
].join('')
|
1370
|
+
end,
|
1371
|
+
'SELECT',
|
1372
|
+
*if node.items and node.items.length > 0
|
1373
|
+
[
|
1374
|
+
' ',
|
1375
|
+
'(',
|
1376
|
+
node.items.map{|x| format(x)}.join(', '),
|
1377
|
+
')'
|
1378
|
+
].join('')
|
1379
|
+
end,
|
1380
|
+
*if node.extension_type
|
1381
|
+
[
|
1382
|
+
' ',
|
1383
|
+
'BASED_ON',
|
1384
|
+
' ',
|
1385
|
+
format(node.extension_type)
|
1386
|
+
].join('')
|
1387
|
+
end,
|
1388
|
+
*if node.extension_items and node.extension_items.length > 0
|
1389
|
+
[
|
1390
|
+
' ',
|
1391
|
+
'WITH',
|
1392
|
+
' ',
|
1393
|
+
'(',
|
1394
|
+
node.extension_items.map{|x| format(x)}.join(', '),
|
1395
|
+
')'
|
1396
|
+
].join('')
|
1397
|
+
end
|
1398
|
+
].join('')
|
1399
|
+
end
|
1400
|
+
|
1401
|
+
def format_types_set(node)
|
1402
|
+
[
|
1403
|
+
'SET',
|
1404
|
+
*if node.bound1 and node.bound2
|
1405
|
+
[
|
1406
|
+
' ',
|
1407
|
+
'[',
|
1408
|
+
format(node.bound1),
|
1409
|
+
':',
|
1410
|
+
format(node.bound2),
|
1411
|
+
']',
|
1412
|
+
].join('')
|
1413
|
+
end,
|
1414
|
+
' ',
|
1415
|
+
'OF',
|
1416
|
+
' ',
|
1417
|
+
format(node.base_type)
|
1418
|
+
].join('')
|
1419
|
+
end
|
1420
|
+
|
1421
|
+
def format_types_string(node)
|
1422
|
+
[
|
1423
|
+
'STRING',
|
1424
|
+
*if node.width
|
1425
|
+
[
|
1426
|
+
' ',
|
1427
|
+
'(',
|
1428
|
+
format(node.width),
|
1429
|
+
')'
|
1430
|
+
].join('')
|
1431
|
+
end,
|
1432
|
+
*if node.fixed
|
1433
|
+
[
|
1434
|
+
' ',
|
1435
|
+
'FIXED'
|
1436
|
+
].join('')
|
1437
|
+
end
|
1438
|
+
].join('')
|
1439
|
+
end
|
1440
|
+
|
1441
|
+
def indent(str)
|
1442
|
+
str.split("\n").map{|x| "#{INDENT}#{x}"}.join("\n")
|
1443
|
+
end
|
1444
|
+
|
1445
|
+
def format_remark_ref(node)
|
1446
|
+
[
|
1447
|
+
*if node.class.method_defined? :parent and node.parent.class.method_defined? :id and node.parent != node
|
1448
|
+
[
|
1449
|
+
format_remark_ref(node.parent),
|
1450
|
+
'.'
|
1451
|
+
].join('')
|
1452
|
+
end,
|
1453
|
+
node.id,
|
1454
|
+
].join('')
|
1455
|
+
end
|
1456
|
+
|
1457
|
+
def format_remark(node, remark)
|
1458
|
+
if remark.include?("\n")
|
1459
|
+
[
|
1460
|
+
[
|
1461
|
+
'(*',
|
1462
|
+
'"',
|
1463
|
+
format_remark_ref(node),
|
1464
|
+
'"',
|
1465
|
+
].join(''),
|
1466
|
+
remark,
|
1467
|
+
'*)'
|
1468
|
+
].join("\n")
|
1469
|
+
else
|
1470
|
+
[
|
1471
|
+
'--',
|
1472
|
+
'"',
|
1473
|
+
format_remark_ref(node),
|
1474
|
+
'"',
|
1475
|
+
' ',
|
1476
|
+
remark
|
1477
|
+
].join('')
|
1478
|
+
end
|
1479
|
+
end
|
1480
|
+
|
1481
|
+
def format_remarks(node)
|
1482
|
+
if node.class.method_defined? :remarks and node.remarks and node.remarks.length > 0
|
1483
|
+
node.remarks.map do |remark|
|
1484
|
+
format_remark(node, remark)
|
1485
|
+
end
|
1486
|
+
else
|
1487
|
+
[]
|
1488
|
+
end
|
1489
|
+
end
|
1490
|
+
|
1491
|
+
def format_scope_remarks(node)
|
1492
|
+
[
|
1493
|
+
*format_remarks(node),
|
1494
|
+
*if node.class.method_defined? :children
|
1495
|
+
node.children.select{|x| x.parent == node}.flat_map{|x| format_scope_remarks(x)}
|
1496
|
+
end
|
1497
|
+
]
|
1498
|
+
end
|
1499
|
+
end
|
1500
|
+
end
|
1450
1501
|
end
|