From ac9e0efc683d18c7a60cad4594e5e7dbf98e9c34 Mon Sep 17 00:00:00 2001 From: ydah <13041216+ydah@users.noreply.github.com> Date: Thu, 16 Nov 2023 20:39:52 +0900 Subject: [PATCH] Organize rbs for Lrama::Grammar::RuleBuilder --- sig/lrama/grammar/rule_builder.rbs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/sig/lrama/grammar/rule_builder.rbs b/sig/lrama/grammar/rule_builder.rbs index ac9bed92..48aa021e 100644 --- a/sig/lrama/grammar/rule_builder.rbs +++ b/sig/lrama/grammar/rule_builder.rbs @@ -7,7 +7,16 @@ module Lrama attr_reader user_code: Lexer::Token::UserCode? attr_reader precedence_sym: Lexer::Token? + @rule_counter: Counter + @midrule_action_counter: Counter + @position_in_original_rule_rhs: Integer? + @skip_preprocess_references: bool? @user_code: Lexer::Token::UserCode? + @rule_builders_for_derived_rules: Array[RuleBuilder] + @rules: Array[Rule] + @replaced_rhs: Array[Lexer::Token] + @parameterizing_rules: Array[Rule] + @midrule_action_rules: Array[Rule] def initialize: (Counter rule_counter, Counter midrule_action_counter, ?Integer position_in_original_rule_rhs, ?skip_preprocess_references: bool) -> void def add_rhs: (Lexer::Token rhs) -> void @@ -15,18 +24,18 @@ module Lrama def precedence_sym=: (Lexer::Token user_code) -> void def complete_input: () -> void def setup_rules: () -> void - def preprocess_references: () -> void + def parameterizing_rules: () -> Array[Rule] def midrule_action_rules: () -> Array[Rule] - def rhs_with_new_tokens: () -> Array[Lexer::Token] + def rules: () -> Array[Rule] private def freeze_rhs: () -> void + def preprocess_references: () -> void + def build_rules: () -> void def process_rhs: () -> void def numberize_references: () -> void - def setup_references: () -> void def flush_user_code: () -> void - def build_rules: () -> void end end end