ibex 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +247 -104
- data/docs/architecture.md +322 -28
- data/docs/cst-migration.md +107 -0
- data/docs/cst.md +213 -0
- data/docs/development.md +129 -0
- data/docs/editor-setup.md +25 -0
- data/docs/error-ux.md +60 -0
- data/docs/grammar-reference.md +458 -18
- data/docs/lexer-migration.md +51 -0
- data/docs/racc-migration.md +34 -6
- data/docs/release-readiness.md +163 -0
- data/docs/stability.md +124 -0
- data/examples/README.md +60 -0
- data/examples/calculator.y +44 -0
- data/examples/csv.y +32 -0
- data/examples/ini.y +70 -0
- data/examples/json.y +48 -0
- data/examples/tiny_language.y +75 -0
- data/lib/ibex/analysis/sets.rb +5 -4
- data/lib/ibex/artifact_set.rb +63 -0
- data/lib/ibex/cli/ambiguity.rb +66 -0
- data/lib/ibex/cli/counterexample_options.rb +6 -2
- data/lib/ibex/cli/coverage.rb +173 -0
- data/lib/ibex/cli/debug.rb +106 -0
- data/lib/ibex/cli/diagnostics.rb +116 -0
- data/lib/ibex/cli/documentation.rb +67 -0
- data/lib/ibex/cli/error_messages.rb +177 -0
- data/lib/ibex/cli/explain.rb +76 -0
- data/lib/ibex/cli/formatting.rb +386 -0
- data/lib/ibex/cli/generation_artifacts.rb +138 -0
- data/lib/ibex/cli/generation_error_messages.rb +39 -0
- data/lib/ibex/cli/grammar_tests.rb +122 -0
- data/lib/ibex/cli/ir_tools.rb +184 -0
- data/lib/ibex/cli/lsp.rb +33 -0
- data/lib/ibex/cli/outputs.rb +91 -8
- data/lib/ibex/cli/racc_migration.rb +87 -0
- data/lib/ibex/cli/samples.rb +92 -0
- data/lib/ibex/cli/watch.rb +103 -0
- data/lib/ibex/cli.rb +506 -37
- data/lib/ibex/codegen/action_locations.rb +103 -0
- data/lib/ibex/codegen/action_method_source.rb +210 -0
- data/lib/ibex/codegen/action_source.rb +118 -0
- data/lib/ibex/codegen/ambiguity.rb +173 -0
- data/lib/ibex/codegen/cst_metadata.rb +171 -0
- data/lib/ibex/codegen/documentation.rb +170 -0
- data/lib/ibex/codegen/explain.rb +312 -0
- data/lib/ibex/codegen/generated_action_abi.rb +288 -0
- data/lib/ibex/codegen/html.rb +94 -10
- data/lib/ibex/codegen/mermaid.rb +43 -0
- data/lib/ibex/codegen/railroad.rb +197 -0
- data/lib/ibex/codegen/railroad_documentation.rb +59 -0
- data/lib/ibex/codegen/rbs.rb +323 -2
- data/lib/ibex/codegen/report.rb +46 -6
- data/lib/ibex/codegen/ruby.rb +334 -59
- data/lib/ibex/codegen/ruby_actions.rb +143 -0
- data/lib/ibex/codegen/ruby_ast.rb +121 -0
- data/lib/ibex/codegen/ruby_error_messages.rb +28 -0
- data/lib/ibex/codegen/ruby_lexer.rb +83 -0
- data/lib/ibex/codegen/ruby_syntax.rb +90 -0
- data/lib/ibex/codegen/ruby_table_metadata.rb +57 -0
- data/lib/ibex/codegen/ruby_value_printers.rb +56 -0
- data/lib/ibex/codegen/symbol_labels.rb +1 -1
- data/lib/ibex/coverage/collector.rb +188 -0
- data/lib/ibex/coverage/event_stream.rb +97 -0
- data/lib/ibex/coverage/report.rb +259 -0
- data/lib/ibex/coverage/runtime_event_validator.rb +160 -0
- data/lib/ibex/coverage.rb +13 -0
- data/lib/ibex/error_messages/parser.rb +159 -0
- data/lib/ibex/error_messages/parser_v2.rb +198 -0
- data/lib/ibex/error_messages/renderer.rb +65 -0
- data/lib/ibex/error_messages/sentence_search.rb +196 -0
- data/lib/ibex/error_messages/update.rb +169 -0
- data/lib/ibex/error_messages.rb +165 -0
- data/lib/ibex/frontend/ast.rb +145 -6
- data/lib/ibex/frontend/bootstrap_parser.rb +47 -4
- data/lib/ibex/frontend/diagnostic.rb +81 -0
- data/lib/ibex/frontend/diagnostic_recovery.rb +268 -0
- data/lib/ibex/frontend/dsl.rb +66 -7
- data/lib/ibex/frontend/formatter.rb +407 -0
- data/lib/ibex/frontend/generated_parser.rb +614 -190
- data/lib/ibex/frontend/generated_parser_base.rb +164 -30
- data/lib/ibex/frontend/generated_parser_includes.rb +61 -0
- data/lib/ibex/frontend/generated_parser_metadata.rb +61 -0
- data/lib/ibex/frontend/generated_parser_parameters.rb +60 -0
- data/lib/ibex/frontend/generation.rb +33 -0
- data/lib/ibex/frontend/lexer.rb +162 -10
- data/lib/ibex/frontend/lexer_recovery.rb +84 -0
- data/lib/ibex/frontend/parser/declarations.rb +247 -11
- data/lib/ibex/frontend/parser/parameters.rb +82 -0
- data/lib/ibex/frontend/parser/rules.rb +43 -6
- data/lib/ibex/frontend/parser.rb +182 -4
- data/lib/ibex/frontend/regenerator.rb +26 -1
- data/lib/ibex/frontend/resolution.rb +69 -0
- data/lib/ibex/frontend/resolver.rb +217 -0
- data/lib/ibex/frontend/rule_documentation.rb +103 -0
- data/lib/ibex/frontend/source_cursor.rb +132 -8
- data/lib/ibex/frontend/source_document.rb +229 -0
- data/lib/ibex/frontend/source_loader.rb +150 -0
- data/lib/ibex/frontend/source_span.rb +81 -0
- data/lib/ibex/frontend/token_adapter/declaration_document_state.rb +47 -0
- data/lib/ibex/frontend/token_adapter/declaration_lexer_state.rb +83 -0
- data/lib/ibex/frontend/token_adapter/declaration_state.rb +216 -26
- data/lib/ibex/frontend/token_adapter/delimiter_tracker.rb +8 -2
- data/lib/ibex/frontend/token_adapter/rule_state.rb +60 -2
- data/lib/ibex/frontend/token_adapter.rb +8 -3
- data/lib/ibex/frontend.rb +13 -2
- data/lib/ibex/generation_input.rb +57 -0
- data/lib/ibex/generation_manifest.rb +200 -0
- data/lib/ibex/generation_transaction.rb +261 -0
- data/lib/ibex/generation_transaction_recovery.rb +109 -0
- data/lib/ibex/generation_transaction_validation.rb +196 -0
- data/lib/ibex/grammar_tests.rb +206 -0
- data/lib/ibex/ir/automaton_ir.rb +38 -5
- data/lib/ibex/ir/grammar_ir.rb +137 -24
- data/lib/ibex/ir/lexer_ir.rb +76 -0
- data/lib/ibex/ir/migration.rb +120 -0
- data/lib/ibex/ir/serialize.rb +110 -19
- data/lib/ibex/ir/validator/automaton.rb +345 -0
- data/lib/ibex/ir/validator/base.rb +129 -0
- data/lib/ibex/ir/validator/grammar.rb +604 -0
- data/lib/ibex/ir/validator/lexer.rb +113 -0
- data/lib/ibex/ir/validator.rb +62 -0
- data/lib/ibex/ir.rb +57 -4
- data/lib/ibex/lalr/build_metrics.rb +23 -0
- data/lib/ibex/lalr/builder.rb +379 -52
- data/lib/ibex/lalr/conflict.rb +1 -0
- data/lib/ibex/lalr/conflict_search.rb +11 -5
- data/lib/ibex/lalr/counterexample.rb +20 -5
- data/lib/ibex/lalr/direct_lookaheads.rb +236 -0
- data/lib/ibex/lalr/ielr_partition.rb +152 -0
- data/lib/ibex/lalr/on_error_reductions.rb +74 -0
- data/lib/ibex/lalr.rb +7 -0
- data/lib/ibex/location.rb +129 -0
- data/lib/ibex/lsp/document_handlers.rb +66 -0
- data/lib/ibex/lsp/document_store.rb +264 -0
- data/lib/ibex/lsp/document_store_diagnostics.rb +44 -0
- data/lib/ibex/lsp/document_store_validation.rb +61 -0
- data/lib/ibex/lsp/initialization_handlers.rb +78 -0
- data/lib/ibex/lsp/navigation_handlers.rb +56 -0
- data/lib/ibex/lsp/position_codec.rb +109 -0
- data/lib/ibex/lsp/protocol_error.rb +33 -0
- data/lib/ibex/lsp/request_handlers.rb +45 -0
- data/lib/ibex/lsp/request_support.rb +87 -0
- data/lib/ibex/lsp/server.rb +146 -0
- data/lib/ibex/lsp/symbol_index.rb +241 -0
- data/lib/ibex/lsp/symbol_index_builder.rb +267 -0
- data/lib/ibex/lsp/symbol_index_precedence_references.rb +44 -0
- data/lib/ibex/lsp/symbol_index_source_queries.rb +61 -0
- data/lib/ibex/lsp/symbol_occurrence.rb +17 -0
- data/lib/ibex/lsp/transport.rb +118 -0
- data/lib/ibex/lsp/workspace.rb +127 -0
- data/lib/ibex/lsp/workspace_analyzer.rb +199 -0
- data/lib/ibex/lsp.rb +32 -0
- data/lib/ibex/normalize/declarations.rb +140 -7
- data/lib/ibex/normalize/diagnostics.rb +50 -5
- data/lib/ibex/normalize/expander.rb +59 -55
- data/lib/ibex/normalize/expression.rb +60 -39
- data/lib/ibex/normalize/inline_expansion.rb +414 -0
- data/lib/ibex/normalize/inline_validation.rb +174 -0
- data/lib/ibex/normalize/lexer.rb +131 -0
- data/lib/ibex/normalize/named_references.rb +60 -0
- data/lib/ibex/normalize/nodes.rb +46 -0
- data/lib/ibex/normalize/parameter_ebnf_lowering.rb +69 -0
- data/lib/ibex/normalize/parameter_lowering.rb +126 -0
- data/lib/ibex/normalize/parameter_substitution.rb +125 -0
- data/lib/ibex/normalize/parameter_validation.rb +140 -0
- data/lib/ibex/normalize/parameters.rb +199 -0
- data/lib/ibex/normalize/recovery_declarations.rb +84 -0
- data/lib/ibex/normalize.rb +179 -14
- data/lib/ibex/racc_migration/checker.rb +122 -0
- data/lib/ibex/racc_migration/harness.rb +177 -0
- data/lib/ibex/racc_migration/report.rb +94 -0
- data/lib/ibex/racc_migration.rb +12 -0
- data/lib/ibex/rake_task.rb +116 -0
- data/lib/ibex/samples.rb +186 -0
- data/lib/ibex/table_simulation/result.rb +51 -0
- data/lib/ibex/table_simulation/simulator.rb +253 -0
- data/lib/ibex/table_simulation/step.rb +60 -0
- data/lib/ibex/table_simulation/text.rb +31 -0
- data/lib/ibex/table_simulation.rb +13 -0
- data/lib/ibex/tables.rb +9 -70
- data/lib/ibex/version.rb +1 -1
- data/lib/ibex/watch/runner.rb +172 -0
- data/lib/ibex/watch/source_snapshot.rb +93 -0
- data/lib/ibex/watch.rb +11 -0
- data/lib/ibex.rb +25 -1
- data/schema/automaton-ir-v1.schema.json +401 -0
- data/schema/automaton-ir-v2.schema.json +58 -0
- data/schema/benchmark-v1.schema.json +212 -0
- data/schema/benchmark-v2.schema.json +61 -0
- data/schema/cst-v1.json +170 -0
- data/schema/error-ux-v1.schema.json +258 -0
- data/schema/explain-v1.schema.json +433 -0
- data/schema/frontend-diagnostics-v1.schema.json +154 -0
- data/schema/generation-manifest-v1.schema.json +115 -0
- data/schema/grammar-ir-v1.schema.json +426 -0
- data/schema/grammar-ir-v2.schema.json +779 -0
- data/schema/lexer-ir-v1.schema.json +215 -0
- data/schema/migration-check-v1.schema.json +60 -0
- data/schema/performance-comparison-v1.schema.json +395 -0
- data/schema/public-performance-comparison-v1.schema.json +506 -0
- data/schema/public-performance-profile-v1.schema.json +360 -0
- data/schema/runtime-coverage-v1.schema.json +86 -0
- data/schema/runtime-event-v1.schema.json +308 -0
- data/schema/table-simulation-v1.schema.json +70 -0
- data/sig/ibex/artifact_set.rbs +37 -0
- data/sig/ibex/cli/ambiguity.rbs +22 -0
- data/sig/ibex/cli/counterexample_options.rbs +2 -0
- data/sig/ibex/cli/coverage.rbs +53 -0
- data/sig/ibex/cli/debug.rbs +28 -0
- data/sig/ibex/cli/diagnostics.rbs +38 -0
- data/sig/ibex/cli/documentation.rbs +25 -0
- data/sig/ibex/cli/error_messages.rbs +57 -0
- data/sig/ibex/cli/explain.rbs +25 -0
- data/sig/ibex/cli/formatting.rbs +103 -0
- data/sig/ibex/cli/generation_artifacts.rbs +50 -0
- data/sig/ibex/cli/generation_error_messages.rbs +19 -0
- data/sig/ibex/cli/grammar_tests.rbs +36 -0
- data/sig/ibex/cli/ir_tools.rbs +51 -0
- data/sig/ibex/cli/lsp.rbs +14 -0
- data/sig/ibex/cli/outputs.rbs +17 -0
- data/sig/ibex/cli/racc_migration.rbs +30 -0
- data/sig/ibex/cli/samples.rbs +30 -0
- data/sig/ibex/cli/watch.rbs +43 -0
- data/sig/ibex/cli.rbs +104 -5
- data/sig/ibex/codegen/action_locations.rbs +45 -0
- data/sig/ibex/codegen/action_method_source.rbs +65 -0
- data/sig/ibex/codegen/action_source.rbs +50 -0
- data/sig/ibex/codegen/ambiguity.rbs +60 -0
- data/sig/ibex/codegen/cst_metadata.rbs +59 -0
- data/sig/ibex/codegen/documentation.rbs +50 -0
- data/sig/ibex/codegen/explain.rbs +85 -0
- data/sig/ibex/codegen/generated_action_abi.rbs +101 -0
- data/sig/ibex/codegen/html.rbs +18 -2
- data/sig/ibex/codegen/mermaid.rbs +16 -0
- data/sig/ibex/codegen/railroad.rbs +82 -0
- data/sig/ibex/codegen/railroad_documentation.rbs +31 -0
- data/sig/ibex/codegen/rbs.rbs +84 -4
- data/sig/ibex/codegen/report.rbs +8 -0
- data/sig/ibex/codegen/ruby.rbs +97 -23
- data/sig/ibex/codegen/ruby_actions.rbs +54 -0
- data/sig/ibex/codegen/ruby_ast.rbs +34 -0
- data/sig/ibex/codegen/ruby_error_messages.rbs +16 -0
- data/sig/ibex/codegen/ruby_lexer.rbs +25 -0
- data/sig/ibex/codegen/ruby_syntax.rbs +25 -0
- data/sig/ibex/codegen/ruby_table_metadata.rbs +26 -0
- data/sig/ibex/codegen/ruby_value_printers.rbs +28 -0
- data/sig/ibex/coverage/collector.rbs +76 -0
- data/sig/ibex/coverage/event_stream.rbs +42 -0
- data/sig/ibex/coverage/report.rbs +100 -0
- data/sig/ibex/coverage/runtime_event_validator.rbs +68 -0
- data/sig/ibex/coverage.rbs +7 -0
- data/sig/ibex/error_messages/parser.rbs +58 -0
- data/sig/ibex/error_messages/parser_v2.rbs +67 -0
- data/sig/ibex/error_messages/renderer.rbs +23 -0
- data/sig/ibex/error_messages/sentence_search.rbs +80 -0
- data/sig/ibex/error_messages/update.rbs +43 -0
- data/sig/ibex/error_messages.rbs +85 -0
- data/sig/ibex/frontend/ast.rbs +208 -19
- data/sig/ibex/frontend/bootstrap_parser.rbs +11 -0
- data/sig/ibex/frontend/diagnostic.rbs +53 -0
- data/sig/ibex/frontend/diagnostic_recovery.rbs +98 -0
- data/sig/ibex/frontend/dsl.rbs +33 -4
- data/sig/ibex/frontend/formatter.rbs +135 -0
- data/sig/ibex/frontend/generated_parser.rbs +218 -68
- data/sig/ibex/frontend/generated_parser_base.rbs +61 -10
- data/sig/ibex/frontend/generated_parser_includes.rbs +23 -0
- data/sig/ibex/frontend/generated_parser_metadata.rbs +23 -0
- data/sig/ibex/frontend/generated_parser_parameters.rbs +24 -0
- data/sig/ibex/frontend/generation.rbs +6 -0
- data/sig/ibex/frontend/lexer.rbs +49 -2
- data/sig/ibex/frontend/lexer_recovery.rbs +25 -0
- data/sig/ibex/frontend/parser/declarations.rbs +54 -0
- data/sig/ibex/frontend/parser/parameters.rbs +28 -0
- data/sig/ibex/frontend/parser/rules.rbs +3 -0
- data/sig/ibex/frontend/parser.rbs +66 -0
- data/sig/ibex/frontend/regenerator.rbs +11 -0
- data/sig/ibex/frontend/resolution.rbs +33 -0
- data/sig/ibex/frontend/resolver.rbs +91 -0
- data/sig/ibex/frontend/rule_documentation.rbs +42 -0
- data/sig/ibex/frontend/source_cursor.rbs +36 -3
- data/sig/ibex/frontend/source_document.rbs +119 -0
- data/sig/ibex/frontend/source_loader.rbs +66 -0
- data/sig/ibex/frontend/source_span.rbs +53 -0
- data/sig/ibex/frontend/token_adapter/declaration_document_state.rbs +21 -0
- data/sig/ibex/frontend/token_adapter/declaration_lexer_state.rbs +27 -0
- data/sig/ibex/frontend/token_adapter/declaration_state.rbs +73 -5
- data/sig/ibex/frontend/token_adapter/rule_state.rbs +20 -0
- data/sig/ibex/frontend/token_adapter.rbs +5 -2
- data/sig/ibex/frontend.rbs +1 -1
- data/sig/ibex/generation_input.rbs +37 -0
- data/sig/ibex/generation_manifest.rbs +67 -0
- data/sig/ibex/generation_transaction.rbs +82 -0
- data/sig/ibex/generation_transaction_recovery.rbs +36 -0
- data/sig/ibex/generation_transaction_validation.rbs +65 -0
- data/sig/ibex/grammar_tests.rbs +93 -0
- data/sig/ibex/ir/automaton_ir.rbs +8 -2
- data/sig/ibex/ir/grammar_ir.rbs +75 -15
- data/sig/ibex/ir/lexer_ir.rbs +57 -0
- data/sig/ibex/ir/migration.rbs +34 -0
- data/sig/ibex/ir/serialize.rbs +23 -6
- data/sig/ibex/ir/validator/automaton.rbs +109 -0
- data/sig/ibex/ir/validator/base.rbs +65 -0
- data/sig/ibex/ir/validator/grammar.rbs +184 -0
- data/sig/ibex/ir/validator/lexer.rbs +37 -0
- data/sig/ibex/ir/validator.rbs +16 -0
- data/sig/ibex/ir.rbs +38 -4
- data/sig/ibex/lalr/build_metrics.rbs +20 -0
- data/sig/ibex/lalr/builder.rbs +95 -15
- data/sig/ibex/lalr/conflict_search.rbs +7 -3
- data/sig/ibex/lalr/counterexample.rbs +5 -2
- data/sig/ibex/lalr/direct_lookaheads.rbs +86 -0
- data/sig/ibex/lalr/ielr_partition.rbs +59 -0
- data/sig/ibex/lalr/on_error_reductions.rbs +22 -0
- data/sig/ibex/lalr.rbs +6 -0
- data/sig/ibex/location.rbs +67 -0
- data/sig/ibex/lsp/document_handlers.rbs +24 -0
- data/sig/ibex/lsp/document_store.rbs +94 -0
- data/sig/ibex/lsp/document_store_diagnostics.rbs +20 -0
- data/sig/ibex/lsp/document_store_validation.rbs +26 -0
- data/sig/ibex/lsp/initialization_handlers.rbs +30 -0
- data/sig/ibex/lsp/navigation_handlers.rbs +30 -0
- data/sig/ibex/lsp/position_codec.rbs +40 -0
- data/sig/ibex/lsp/protocol_error.rbs +32 -0
- data/sig/ibex/lsp/request_handlers.rbs +26 -0
- data/sig/ibex/lsp/request_support.rbs +40 -0
- data/sig/ibex/lsp/server.rbs +55 -0
- data/sig/ibex/lsp/symbol_index.rbs +78 -0
- data/sig/ibex/lsp/symbol_index_builder.rbs +87 -0
- data/sig/ibex/lsp/symbol_index_precedence_references.rbs +18 -0
- data/sig/ibex/lsp/symbol_index_source_queries.rbs +26 -0
- data/sig/ibex/lsp/symbol_occurrence.rbs +25 -0
- data/sig/ibex/lsp/transport.rbs +35 -0
- data/sig/ibex/lsp/workspace.rbs +41 -0
- data/sig/ibex/lsp/workspace_analyzer.rbs +69 -0
- data/sig/ibex/lsp.rbs +7 -0
- data/sig/ibex/normalize/declarations.rbs +31 -0
- data/sig/ibex/normalize/diagnostics.rbs +9 -0
- data/sig/ibex/normalize/expander.rbs +20 -14
- data/sig/ibex/normalize/expression.rbs +10 -10
- data/sig/ibex/normalize/inline_expansion.rbs +120 -0
- data/sig/ibex/normalize/inline_validation.rbs +40 -0
- data/sig/ibex/normalize/lexer.rbs +37 -0
- data/sig/ibex/normalize/named_references.rbs +20 -0
- data/sig/ibex/normalize/nodes.rbs +14 -0
- data/sig/ibex/normalize/parameter_ebnf_lowering.rbs +32 -0
- data/sig/ibex/normalize/parameter_lowering.rbs +35 -0
- data/sig/ibex/normalize/parameter_substitution.rbs +42 -0
- data/sig/ibex/normalize/parameter_validation.rbs +44 -0
- data/sig/ibex/normalize/parameters.rbs +46 -0
- data/sig/ibex/normalize/recovery_declarations.rbs +24 -0
- data/sig/ibex/normalize.rbs +123 -18
- data/sig/ibex/racc_migration/checker.rbs +36 -0
- data/sig/ibex/racc_migration/harness.rbs +16 -0
- data/sig/ibex/racc_migration/report.rbs +53 -0
- data/sig/ibex/racc_migration.rbs +8 -0
- data/sig/ibex/rake_task.rbs +51 -0
- data/sig/ibex/samples.rbs +51 -0
- data/sig/ibex/table_simulation/result.rbs +32 -0
- data/sig/ibex/table_simulation/simulator.rbs +98 -0
- data/sig/ibex/table_simulation/step.rbs +40 -0
- data/sig/ibex/table_simulation/text.rbs +14 -0
- data/sig/ibex/table_simulation.rbs +7 -0
- data/sig/ibex/tables.rbs +0 -26
- data/sig/ibex/watch/runner.rbs +48 -0
- data/sig/ibex/watch/source_snapshot.rbs +42 -0
- data/sig/ibex/watch.rbs +7 -0
- data/sig/ibex.rbs +2 -0
- metadata +301 -16
- data/.rubocop.yml +0 -43
- data/CHANGELOG.md +0 -30
- data/Rakefile +0 -25
- data/Steepfile +0 -10
- data/docs/compat-notes.md +0 -37
- data/docs/lexer-coverage.md +0 -14
- data/docs/phase10-extensions.md +0 -27
- data/gemfiles/Gemfile +0 -7
- data/gemfiles/Gemfile.lock +0 -98
- data/lib/ibex/frontend/grammar.y +0 -156
- data/lib/ibex/runtime/parser.rb +0 -360
- data/lib/ibex/runtime.rb +0 -8
- data/sig/ibex/runtime/parser.rbs +0 -167
- data/sig/ibex/runtime.rbs +0 -6
|
@@ -5,6 +5,12 @@ module Ibex
|
|
|
5
5
|
class GeneratedParser < Ibex::Frontend::GeneratedParserBase
|
|
6
6
|
PARSER_TABLE_FORMAT_VERSION: ::Integer
|
|
7
7
|
|
|
8
|
+
GRAMMAR_DIGEST: untyped
|
|
9
|
+
|
|
10
|
+
STATE_COUNT: ::Integer
|
|
11
|
+
|
|
12
|
+
PRODUCTION_COUNT: ::Integer
|
|
13
|
+
|
|
8
14
|
TOKEN_IDS: untyped
|
|
9
15
|
|
|
10
16
|
TOKEN_NAMES: untyped
|
|
@@ -15,149 +21,293 @@ module Ibex
|
|
|
15
21
|
|
|
16
22
|
DEFAULT_ACTIONS: untyped
|
|
17
23
|
|
|
24
|
+
# @type var eager_reductions: Hash[Integer, [:reduce, Integer]]
|
|
25
|
+
EAGER_REDUCTIONS: Hash[Integer, [ :reduce, Integer ]]
|
|
26
|
+
|
|
18
27
|
PRODUCTIONS: untyped
|
|
19
28
|
|
|
29
|
+
# @type var error_messages: Hash[Integer, String | { id: String, message: String }]
|
|
30
|
+
ERROR_MESSAGES: Hash[Integer, String | { id: String, message: String }]
|
|
31
|
+
|
|
20
32
|
PARSER_TABLES: untyped
|
|
21
33
|
|
|
22
34
|
def self.parser_tables: () -> untyped
|
|
23
35
|
|
|
24
36
|
DEBUG_ENABLED: bool
|
|
25
37
|
|
|
26
|
-
private def _ibex_action_0: (untyped
|
|
38
|
+
private def _ibex_action_0: (untyped v0) -> untyped
|
|
39
|
+
|
|
40
|
+
private def _ibex_action_1: (untyped v0) -> untyped
|
|
41
|
+
|
|
42
|
+
private def _ibex_action_2: (untyped val) -> untyped
|
|
43
|
+
|
|
44
|
+
private def _ibex_action_3: (untyped val) -> untyped
|
|
45
|
+
|
|
46
|
+
private def _ibex_action_4: (untyped v0, untyped v1) -> untyped
|
|
47
|
+
|
|
48
|
+
private def _ibex_action_5: (untyped val) -> untyped
|
|
49
|
+
|
|
50
|
+
private def _ibex_action_6: () -> untyped
|
|
51
|
+
|
|
52
|
+
private def _ibex_action_7: (untyped v0) -> untyped
|
|
53
|
+
|
|
54
|
+
private def _ibex_action_8: (untyped v0) -> untyped
|
|
55
|
+
|
|
56
|
+
private def _ibex_action_9: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
57
|
+
|
|
58
|
+
private def _ibex_action_10: () -> untyped
|
|
59
|
+
|
|
60
|
+
private def _ibex_action_11: (untyped v0, untyped v1) -> untyped
|
|
61
|
+
|
|
62
|
+
private def _ibex_action_14: () -> untyped
|
|
63
|
+
|
|
64
|
+
private def _ibex_action_15: (untyped v0, untyped v1) -> untyped
|
|
65
|
+
|
|
66
|
+
private def _ibex_action_16: (untyped v0) -> untyped
|
|
67
|
+
|
|
68
|
+
private def _ibex_action_17: (untyped v0) -> untyped
|
|
69
|
+
|
|
70
|
+
private def _ibex_action_18: (untyped v0) -> untyped
|
|
71
|
+
|
|
72
|
+
private def _ibex_action_19: (untyped v0) -> untyped
|
|
73
|
+
|
|
74
|
+
private def _ibex_action_20: (untyped v0) -> untyped
|
|
75
|
+
|
|
76
|
+
private def _ibex_action_21: (untyped v0) -> untyped
|
|
77
|
+
|
|
78
|
+
private def _ibex_action_22: (untyped v0) -> untyped
|
|
79
|
+
|
|
80
|
+
private def _ibex_action_23: (untyped v0) -> untyped
|
|
81
|
+
|
|
82
|
+
private def _ibex_action_24: (untyped v0) -> untyped
|
|
83
|
+
|
|
84
|
+
private def _ibex_action_25: (untyped v0) -> untyped
|
|
85
|
+
|
|
86
|
+
private def _ibex_action_26: (untyped v0) -> untyped
|
|
87
|
+
|
|
88
|
+
private def _ibex_action_27: (untyped v0) -> untyped
|
|
89
|
+
|
|
90
|
+
private def _ibex_action_28: (untyped v0) -> untyped
|
|
91
|
+
|
|
92
|
+
private def _ibex_action_29: (untyped v0) -> untyped
|
|
93
|
+
|
|
94
|
+
private def _ibex_action_30: (untyped v0) -> untyped
|
|
95
|
+
|
|
96
|
+
private def _ibex_action_31: (untyped v0) -> untyped
|
|
97
|
+
|
|
98
|
+
private def _ibex_action_32: (untyped v0, untyped v1) -> untyped
|
|
99
|
+
|
|
100
|
+
private def _ibex_action_33: (untyped v0, untyped v1) -> untyped
|
|
101
|
+
|
|
102
|
+
private def _ibex_action_34: (untyped v0, untyped v1) -> untyped
|
|
103
|
+
|
|
104
|
+
private def _ibex_action_35: () -> untyped
|
|
105
|
+
|
|
106
|
+
private def _ibex_action_36: (untyped v0, untyped v1) -> untyped
|
|
107
|
+
|
|
108
|
+
private def _ibex_action_37: (untyped v0) -> untyped
|
|
109
|
+
|
|
110
|
+
private def _ibex_action_38: (untyped v0, untyped v1) -> untyped
|
|
111
|
+
|
|
112
|
+
private def _ibex_action_39: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
113
|
+
|
|
114
|
+
private def _ibex_action_40: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
115
|
+
|
|
116
|
+
private def _ibex_action_41: () -> untyped
|
|
117
|
+
|
|
118
|
+
private def _ibex_action_42: (untyped v0, untyped v1) -> untyped
|
|
119
|
+
|
|
120
|
+
private def _ibex_action_43: (untyped v0, untyped v1) -> untyped
|
|
121
|
+
|
|
122
|
+
private def _ibex_action_44: (untyped v0) -> untyped
|
|
123
|
+
|
|
124
|
+
private def _ibex_action_45: (untyped v0) -> untyped
|
|
125
|
+
|
|
126
|
+
private def _ibex_action_46: (untyped v0) -> untyped
|
|
127
|
+
|
|
128
|
+
private def _ibex_action_47: (untyped v0) -> untyped
|
|
129
|
+
|
|
130
|
+
private def _ibex_action_48: (untyped v0, untyped v1) -> untyped
|
|
131
|
+
|
|
132
|
+
private def _ibex_action_49: (untyped v0, untyped v1) -> untyped
|
|
133
|
+
|
|
134
|
+
private def _ibex_action_50: (untyped v0, untyped v1) -> untyped
|
|
135
|
+
|
|
136
|
+
private def _ibex_action_51: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
137
|
+
|
|
138
|
+
private def _ibex_action_52: (untyped val) -> untyped
|
|
139
|
+
|
|
140
|
+
private def _ibex_action_53: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
141
|
+
|
|
142
|
+
private def _ibex_action_54: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
143
|
+
|
|
144
|
+
private def _ibex_action_55: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
145
|
+
|
|
146
|
+
private def _ibex_action_56: () -> untyped
|
|
147
|
+
|
|
148
|
+
private def _ibex_action_57: (untyped v0, untyped v1) -> untyped
|
|
149
|
+
|
|
150
|
+
private def _ibex_action_58: (untyped v0) -> untyped
|
|
151
|
+
|
|
152
|
+
private def _ibex_action_59: (untyped v0) -> untyped
|
|
153
|
+
|
|
154
|
+
private def _ibex_action_60: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
155
|
+
|
|
156
|
+
private def _ibex_action_61: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
157
|
+
|
|
158
|
+
private def _ibex_action_62: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
159
|
+
|
|
160
|
+
private def _ibex_action_63: (untyped v0) -> untyped
|
|
161
|
+
|
|
162
|
+
private def _ibex_action_64: (untyped v0) -> untyped
|
|
163
|
+
|
|
164
|
+
private def _ibex_action_65: () -> untyped
|
|
165
|
+
|
|
166
|
+
private def _ibex_action_66: (untyped v0) -> untyped
|
|
167
|
+
|
|
168
|
+
private def _ibex_action_67: (untyped val) -> untyped
|
|
169
|
+
|
|
170
|
+
private def _ibex_action_68: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
171
|
+
|
|
172
|
+
private def _ibex_action_69: () -> untyped
|
|
173
|
+
|
|
174
|
+
private def _ibex_action_70: (untyped v0, untyped v1) -> untyped
|
|
175
|
+
|
|
176
|
+
private def _ibex_action_71: (untyped v0, untyped v1) -> untyped
|
|
27
177
|
|
|
28
|
-
private def
|
|
178
|
+
private def _ibex_action_72: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
29
179
|
|
|
30
|
-
private def
|
|
180
|
+
private def _ibex_action_73: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
31
181
|
|
|
32
|
-
private def
|
|
182
|
+
private def _ibex_action_74: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
33
183
|
|
|
34
|
-
private def
|
|
184
|
+
private def _ibex_action_75: () -> untyped
|
|
35
185
|
|
|
36
|
-
private def
|
|
186
|
+
private def _ibex_action_76: (untyped v0) -> untyped
|
|
37
187
|
|
|
38
|
-
private def
|
|
188
|
+
private def _ibex_action_77: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
39
189
|
|
|
40
|
-
private def
|
|
190
|
+
private def _ibex_action_78: () -> untyped
|
|
41
191
|
|
|
42
|
-
private def
|
|
192
|
+
private def _ibex_action_79: (untyped v0, untyped v1) -> untyped
|
|
43
193
|
|
|
44
|
-
private def
|
|
194
|
+
private def _ibex_action_80: () -> untyped
|
|
45
195
|
|
|
46
|
-
private def
|
|
196
|
+
private def _ibex_action_81: (untyped v0, untyped v1) -> untyped
|
|
47
197
|
|
|
48
|
-
private def
|
|
198
|
+
private def _ibex_action_82: (untyped v0) -> untyped
|
|
49
199
|
|
|
50
|
-
private def
|
|
200
|
+
private def _ibex_action_83: (untyped v0) -> untyped
|
|
51
201
|
|
|
52
|
-
private def
|
|
202
|
+
private def _ibex_action_84: (untyped v0) -> untyped
|
|
53
203
|
|
|
54
|
-
private def
|
|
204
|
+
private def _ibex_action_85: (untyped v0, untyped v1) -> untyped
|
|
55
205
|
|
|
56
|
-
private def
|
|
206
|
+
private def _ibex_action_86: (untyped val) -> untyped
|
|
57
207
|
|
|
58
|
-
private def
|
|
208
|
+
private def _ibex_action_87: () -> untyped
|
|
59
209
|
|
|
60
|
-
private def
|
|
210
|
+
private def _ibex_action_88: (untyped v0) -> untyped
|
|
61
211
|
|
|
62
|
-
private def
|
|
212
|
+
private def _ibex_action_89: () -> untyped
|
|
63
213
|
|
|
64
|
-
private def
|
|
214
|
+
private def _ibex_action_90: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
65
215
|
|
|
66
|
-
private def
|
|
216
|
+
private def _ibex_action_91: (untyped v0) -> untyped
|
|
67
217
|
|
|
68
|
-
private def
|
|
218
|
+
private def _ibex_action_92: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
69
219
|
|
|
70
|
-
private def
|
|
220
|
+
private def _ibex_action_95: (untyped v0) -> untyped
|
|
71
221
|
|
|
72
|
-
private def
|
|
222
|
+
private def _ibex_action_96: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
73
223
|
|
|
74
|
-
private def
|
|
224
|
+
private def _ibex_action_97: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
75
225
|
|
|
76
|
-
private def
|
|
226
|
+
private def _ibex_action_98: () -> untyped
|
|
77
227
|
|
|
78
|
-
private def
|
|
228
|
+
private def _ibex_action_99: (untyped val) -> untyped
|
|
79
229
|
|
|
80
|
-
private def
|
|
230
|
+
private def _ibex_action_100: () -> untyped
|
|
81
231
|
|
|
82
|
-
private def
|
|
232
|
+
private def _ibex_action_101: (untyped v0) -> untyped
|
|
83
233
|
|
|
84
|
-
private def
|
|
234
|
+
private def _ibex_action_102: () -> untyped
|
|
85
235
|
|
|
86
|
-
private def
|
|
236
|
+
private def _ibex_action_103: (untyped v0, untyped v1) -> untyped
|
|
87
237
|
|
|
88
|
-
private def
|
|
238
|
+
private def _ibex_action_104: () -> untyped
|
|
89
239
|
|
|
90
|
-
private def
|
|
240
|
+
private def _ibex_action_105: (untyped v0, untyped v1) -> untyped
|
|
91
241
|
|
|
92
|
-
private def
|
|
242
|
+
private def _ibex_action_106: (untyped v0) -> untyped
|
|
93
243
|
|
|
94
|
-
private def
|
|
244
|
+
private def _ibex_action_107: (untyped v0) -> untyped
|
|
95
245
|
|
|
96
|
-
private def
|
|
246
|
+
private def _ibex_action_108: (untyped v0) -> untyped
|
|
97
247
|
|
|
98
|
-
private def
|
|
248
|
+
private def _ibex_action_109: (untyped v0) -> untyped
|
|
99
249
|
|
|
100
|
-
private def
|
|
250
|
+
private def _ibex_action_110: (untyped v0) -> untyped
|
|
101
251
|
|
|
102
|
-
private def
|
|
252
|
+
private def _ibex_action_111: (untyped v0) -> untyped
|
|
103
253
|
|
|
104
|
-
private def
|
|
254
|
+
private def _ibex_action_112: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
105
255
|
|
|
106
|
-
private def
|
|
256
|
+
private def _ibex_action_113: (untyped val) -> untyped
|
|
107
257
|
|
|
108
|
-
private def
|
|
258
|
+
private def _ibex_action_114: () -> untyped
|
|
109
259
|
|
|
110
|
-
private def
|
|
260
|
+
private def _ibex_action_115: (untyped v0) -> untyped
|
|
111
261
|
|
|
112
|
-
private def
|
|
262
|
+
private def _ibex_action_116: (untyped v0) -> untyped
|
|
113
263
|
|
|
114
|
-
private def
|
|
264
|
+
private def _ibex_action_117: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
115
265
|
|
|
116
|
-
private def
|
|
266
|
+
private def _ibex_action_118: (untyped v0) -> untyped
|
|
117
267
|
|
|
118
|
-
private def
|
|
268
|
+
private def _ibex_action_119: (untyped v0) -> untyped
|
|
119
269
|
|
|
120
|
-
private def
|
|
270
|
+
private def _ibex_action_120: (untyped v0) -> untyped
|
|
121
271
|
|
|
122
|
-
private def
|
|
272
|
+
private def _ibex_action_121: (untyped v0) -> untyped
|
|
123
273
|
|
|
124
|
-
private def
|
|
274
|
+
private def _ibex_action_122: () -> untyped
|
|
125
275
|
|
|
126
|
-
private def
|
|
276
|
+
private def _ibex_action_123: (untyped v0, untyped v1) -> untyped
|
|
127
277
|
|
|
128
|
-
private def
|
|
278
|
+
private def _ibex_action_124: () -> untyped
|
|
129
279
|
|
|
130
|
-
private def
|
|
280
|
+
private def _ibex_action_125: (untyped v0, untyped v1) -> untyped
|
|
131
281
|
|
|
132
|
-
private def
|
|
282
|
+
private def _ibex_action_126: (untyped v0, untyped v1) -> untyped
|
|
133
283
|
|
|
134
|
-
private def
|
|
284
|
+
private def _ibex_action_127: (untyped v0, untyped v1) -> untyped
|
|
135
285
|
|
|
136
|
-
private def
|
|
286
|
+
private def _ibex_action_128: (untyped v0, untyped v1, untyped v2, untyped v3) -> untyped
|
|
137
287
|
|
|
138
|
-
private def
|
|
288
|
+
private def _ibex_action_129: (untyped v0) -> untyped
|
|
139
289
|
|
|
140
|
-
private def
|
|
290
|
+
private def _ibex_action_130: (untyped v0, untyped v1, untyped v2) -> untyped
|
|
141
291
|
|
|
142
|
-
private def
|
|
292
|
+
private def _ibex_action_131: () -> untyped
|
|
143
293
|
|
|
144
|
-
private def
|
|
294
|
+
private def _ibex_action_132: (untyped v0, untyped v1) -> untyped
|
|
145
295
|
|
|
146
|
-
private def
|
|
296
|
+
private def _ibex_action_133: (untyped v0) -> untyped
|
|
147
297
|
|
|
148
|
-
private def
|
|
298
|
+
private def _ibex_action_134: (untyped v0) -> untyped
|
|
149
299
|
|
|
150
|
-
private def
|
|
300
|
+
private def _ibex_action_135: (untyped v0) -> untyped
|
|
151
301
|
|
|
152
|
-
private def
|
|
302
|
+
private def _ibex_action_136: (untyped v0) -> untyped
|
|
153
303
|
|
|
154
|
-
private def
|
|
304
|
+
private def _ibex_action_137: (untyped val) -> untyped
|
|
155
305
|
|
|
156
|
-
private def
|
|
306
|
+
private def _ibex_action_138: (untyped val) -> untyped
|
|
157
307
|
|
|
158
|
-
private def
|
|
308
|
+
private def _ibex_action_139: () -> untyped
|
|
159
309
|
|
|
160
|
-
private def
|
|
310
|
+
private def _ibex_action_140: (untyped v0, untyped v1) -> untyped
|
|
161
311
|
end
|
|
162
312
|
end
|
|
163
313
|
end
|
|
@@ -3,7 +3,16 @@
|
|
|
3
3
|
module Ibex
|
|
4
4
|
module Frontend
|
|
5
5
|
# Semantic support and token delivery for the generated grammar parser.
|
|
6
|
+
# rubocop:disable Metrics/ClassLength -- generated grammar semantics share one parser support surface.
|
|
6
7
|
class GeneratedParserBase < Runtime::Parser
|
|
8
|
+
include GeneratedParserMetadata
|
|
9
|
+
|
|
10
|
+
include GeneratedParserIncludes
|
|
11
|
+
|
|
12
|
+
include GeneratedParserParameters
|
|
13
|
+
|
|
14
|
+
attr_reader diagnostic_token: Token?
|
|
15
|
+
|
|
7
16
|
@mode: Symbol
|
|
8
17
|
|
|
9
18
|
@adapter: TokenAdapter
|
|
@@ -11,8 +20,8 @@ module Ibex
|
|
|
11
20
|
# @rbs (Array[Token] tokens, ?mode: Symbol) -> void
|
|
12
21
|
def initialize: (Array[Token] tokens, ?mode: Symbol) -> void
|
|
13
22
|
|
|
14
|
-
# @rbs () -> AST::Root
|
|
15
|
-
def parse: () -> AST::Root
|
|
23
|
+
# @rbs () -> (AST::Root | AST::Fragment)
|
|
24
|
+
def parse: () -> (AST::Root | AST::Fragment)
|
|
16
25
|
|
|
17
26
|
# @rbs () -> ([external_token, Token] | false)
|
|
18
27
|
def next_token: () -> ([ external_token, Token ] | false)
|
|
@@ -41,8 +50,14 @@ module Ibex
|
|
|
41
50
|
# Array[AST::declaration] declarations, Array[AST::Rule] rules, AST::user_code user_code) -> AST::Root
|
|
42
51
|
def build_root: (Token class_token, Array[String] class_parts, Array[String]? superclass, Array[AST::declaration] declarations, Array[AST::Rule] rules, AST::user_code user_code) -> AST::Root
|
|
43
52
|
|
|
44
|
-
# @rbs (Token keyword, Array[String]
|
|
45
|
-
def build_tokens: (Token keyword, Array[String]
|
|
53
|
+
# @rbs (Token keyword, Array[[String, String?]] entries) -> AST::Tokens
|
|
54
|
+
def build_tokens: (Token keyword, Array[[ String, String? ]] entries) -> AST::Tokens
|
|
55
|
+
|
|
56
|
+
# @rbs (Token token) -> [String, nil]
|
|
57
|
+
def build_token_entry: (Token token) -> [ String, nil ]
|
|
58
|
+
|
|
59
|
+
# @rbs (Token name, Token value) -> [String, String]
|
|
60
|
+
def build_token_alias: (Token name, Token value) -> [ String, String ]
|
|
46
61
|
|
|
47
62
|
# @rbs (Token keyword, Symbol direction, Array[AST::PrecedenceLevel] levels) -> AST::Precedence
|
|
48
63
|
def build_precedence: (Token keyword, Symbol direction, Array[AST::PrecedenceLevel] levels) -> AST::Precedence
|
|
@@ -56,8 +71,35 @@ module Ibex
|
|
|
56
71
|
# @rbs (Token keyword, Token integer) -> AST::Expect
|
|
57
72
|
def build_expect: (Token keyword, Token integer) -> AST::Expect
|
|
58
73
|
|
|
59
|
-
# @rbs (Token keyword,
|
|
60
|
-
def
|
|
74
|
+
# @rbs (Token keyword, Token integer) -> AST::ExpectRR
|
|
75
|
+
def build_expect_rr: (Token keyword, Token integer) -> AST::ExpectRR
|
|
76
|
+
|
|
77
|
+
# @rbs (Token keyword, Token name, Token? type) -> AST::Parameter
|
|
78
|
+
def build_parameter: (Token keyword, Token name, Token? type) -> AST::Parameter
|
|
79
|
+
|
|
80
|
+
# @rbs (Token keyword, Token symbol, Token action) -> AST::Printer
|
|
81
|
+
def build_printer: (Token keyword, Token symbol, Token action) -> AST::Printer
|
|
82
|
+
|
|
83
|
+
# @rbs (Token keyword, Array[String] names) -> AST::Start
|
|
84
|
+
def build_start: (Token keyword, Array[String] names) -> AST::Start
|
|
85
|
+
|
|
86
|
+
# @rbs (Token keyword, Token kind, Array[String] sync_tokens) -> AST::Recovery
|
|
87
|
+
def build_recovery: (Token keyword, Token kind, Array[String] sync_tokens) -> AST::Recovery
|
|
88
|
+
|
|
89
|
+
# @rbs (Token keyword, Array[String] names) -> AST::OnErrorReduce
|
|
90
|
+
def build_on_error_reduce: (Token keyword, Array[String] names) -> AST::OnErrorReduce
|
|
91
|
+
|
|
92
|
+
# @rbs (Token keyword, Token expectation, Token source) -> AST::GrammarTest
|
|
93
|
+
def build_grammar_test: (Token keyword, Token expectation, Token source) -> AST::GrammarTest
|
|
94
|
+
|
|
95
|
+
# @rbs (Token keyword, Array[AST::lexer_entry] entries) -> AST::Lexer
|
|
96
|
+
def build_lexer: (Token keyword, Array[AST::lexer_entry] entries) -> AST::Lexer
|
|
97
|
+
|
|
98
|
+
# @rbs (Symbol kind, Token? name, Token pattern, Token? action, Token marker) -> AST::LexerRule
|
|
99
|
+
def build_lexer_rule: (Symbol kind, Token? name, Token pattern, Token? action, Token marker) -> AST::LexerRule
|
|
100
|
+
|
|
101
|
+
# @rbs (Token marker, Token name, Array[AST::lexer_entry] entries) -> AST::LexerState
|
|
102
|
+
def build_lexer_state: (Token marker, Token name, Array[AST::lexer_entry] entries) -> AST::LexerState
|
|
61
103
|
|
|
62
104
|
# @rbs (Token keyword, Array[AST::Conversion] pairs) -> AST::Convert
|
|
63
105
|
def build_convert: (Token keyword, Array[AST::Conversion] pairs) -> AST::Convert
|
|
@@ -65,11 +107,14 @@ module Ibex
|
|
|
65
107
|
# @rbs (Token name_token, Token literal_token) -> AST::Conversion
|
|
66
108
|
def build_conversion: (Token name_token, Token literal_token) -> AST::Conversion
|
|
67
109
|
|
|
68
|
-
# @rbs (Token
|
|
69
|
-
def
|
|
110
|
+
# @rbs (Array[AST::item] items, Token? precedence, AST::NodeAnnotation? node_annotation) -> AST::Alternative
|
|
111
|
+
def build_alternative: (Array[AST::item] items, Token? precedence, AST::NodeAnnotation? node_annotation) -> AST::Alternative
|
|
112
|
+
|
|
113
|
+
# @rbs (Token marker, Token name, Array[Token] fields) -> AST::NodeAnnotation
|
|
114
|
+
def build_node_annotation: (Token marker, Token name, Array[Token] fields) -> AST::NodeAnnotation
|
|
70
115
|
|
|
71
|
-
# @rbs (
|
|
72
|
-
def
|
|
116
|
+
# @rbs (Token token) -> AST::Empty
|
|
117
|
+
def build_empty: (Token token) -> AST::Empty
|
|
73
118
|
|
|
74
119
|
# @rbs (AST::item? item) -> Location?
|
|
75
120
|
def item_start_location: (AST::item? item) -> Location?
|
|
@@ -77,6 +122,9 @@ module Ibex
|
|
|
77
122
|
# @rbs (Token token, [Token, Token]? named_reference, Array[Token] suffixes) -> AST::item
|
|
78
123
|
def build_symbol_reference: (Token token, [ Token, Token ]? named_reference, Array[Token] suffixes) -> AST::item
|
|
79
124
|
|
|
125
|
+
# @rbs ([Token, Token]? named_reference) -> String?
|
|
126
|
+
def named_reference_value: ([ Token, Token ]? named_reference) -> String?
|
|
127
|
+
|
|
80
128
|
# @rbs (Token token) -> AST::InlineAction
|
|
81
129
|
def build_action: (Token token) -> AST::InlineAction
|
|
82
130
|
|
|
@@ -92,6 +140,9 @@ module Ibex
|
|
|
92
140
|
# @rbs (AST::user_code blocks, Token token) -> AST::user_code
|
|
93
141
|
def append_user_code: (AST::user_code blocks, Token token) -> AST::user_code
|
|
94
142
|
|
|
143
|
+
# @rbs (Token token, AST::user_code blocks) -> AST::user_code
|
|
144
|
+
def prepend_user_code: (Token token, AST::user_code blocks) -> AST::user_code
|
|
145
|
+
|
|
95
146
|
# @rbs () -> AST::user_code
|
|
96
147
|
def empty_user_code: () -> AST::user_code
|
|
97
148
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Generated from lib/ibex/frontend/generated_parser_includes.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Ibex
|
|
4
|
+
module Frontend
|
|
5
|
+
# Semantic builders for fragment and include frontend nodes.
|
|
6
|
+
module GeneratedParserIncludes
|
|
7
|
+
private
|
|
8
|
+
|
|
9
|
+
# @rbs (Token keyword, Array[AST::declaration] declarations, Array[AST::Rule] rules,
|
|
10
|
+
# AST::user_code user_code) -> AST::Fragment
|
|
11
|
+
def build_fragment: (Token keyword, Array[AST::declaration] declarations, Array[AST::Rule] rules, AST::user_code user_code) -> AST::Fragment
|
|
12
|
+
|
|
13
|
+
# @rbs (Token keyword, Token path) -> AST::Include
|
|
14
|
+
def build_include: (Token keyword, Token path) -> AST::Include
|
|
15
|
+
|
|
16
|
+
# @rbs (Array[AST::declaration] declarations) -> void
|
|
17
|
+
def reject_fragment_root_declarations: (Array[AST::declaration] declarations) -> void
|
|
18
|
+
|
|
19
|
+
# @rbs (AST::declaration declaration) -> String?
|
|
20
|
+
def fragment_root_declaration_name: (AST::declaration declaration) -> String?
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Generated from lib/ibex/frontend/generated_parser_metadata.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Ibex
|
|
4
|
+
module Frontend
|
|
5
|
+
# Builds extended symbol metadata declarations for the generated grammar parser.
|
|
6
|
+
module GeneratedParserMetadata
|
|
7
|
+
private
|
|
8
|
+
|
|
9
|
+
# @rbs (Token keyword, Token name, Token value) -> AST::DisplayName
|
|
10
|
+
def build_display_name: (Token keyword, Token name, Token value) -> AST::DisplayName
|
|
11
|
+
|
|
12
|
+
# @rbs (Token keyword, Token name, Token value) -> AST::SemanticType
|
|
13
|
+
def build_semantic_type: (Token keyword, Token name, Token value) -> AST::SemanticType
|
|
14
|
+
|
|
15
|
+
# @rbs (singleton(AST::DisplayName) | singleton(AST::SemanticType) node_class,
|
|
16
|
+
# Token keyword, Token name, Token value, String feature) -> (AST::DisplayName | AST::SemanticType)
|
|
17
|
+
def build_symbol_metadata: (singleton(AST::DisplayName) | singleton(AST::SemanticType) node_class, Token keyword, Token name, Token value, String feature) -> (AST::DisplayName | AST::SemanticType)
|
|
18
|
+
|
|
19
|
+
# @rbs (Token token, String feature) -> String
|
|
20
|
+
def decode_metadata_value: (Token token, String feature) -> String
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Generated from lib/ibex/frontend/generated_parser_parameters.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Ibex
|
|
4
|
+
module Frontend
|
|
5
|
+
# Parameter-list and parameterized-reference builders for the generated frontend.
|
|
6
|
+
module GeneratedParserParameters
|
|
7
|
+
private
|
|
8
|
+
|
|
9
|
+
# @rbs (Token opening, Array[Token] parameters) -> [Token, Array[String]]
|
|
10
|
+
def build_rule_parameters: (Token opening, Array[Token] parameters) -> [ Token, Array[String] ]
|
|
11
|
+
|
|
12
|
+
# @rbs (Token? inline_marker, Token lhs, [Token, Array[String]]? parameter_clause,
|
|
13
|
+
# Array[AST::Alternative] alternatives) -> AST::Rule
|
|
14
|
+
def build_rule: (Token? inline_marker, Token lhs, [ Token, Array[String] ]? parameter_clause, Array[AST::Alternative] alternatives) -> AST::Rule
|
|
15
|
+
|
|
16
|
+
# @rbs (Token callee, Token opening, Array[AST::item] arguments,
|
|
17
|
+
# [Token, Token]? named_reference, Array[Token] suffixes) -> AST::item
|
|
18
|
+
def build_parameterized_reference: (Token callee, Token opening, Array[AST::item] arguments, [ Token, Token ]? named_reference, Array[Token] suffixes) -> AST::item
|
|
19
|
+
|
|
20
|
+
# @rbs (Token left, Token right, String message) -> void
|
|
21
|
+
def require_adjacency!: (Token left, Token right, String message) -> void
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|