Struct parol::parser::parol_grammar::ParolGrammar [−][src]
pub struct ParolGrammar {
pub item_stack: Vec<ParolGrammarItem>,
pub title: Option<String>,
pub comment: Option<String>,
pub start_symbol: String,
pub scanner_configurations: Vec<ScannerConfig>,
// some fields omitted
}
Expand description
Data structure used to build up a parol::GrammarConfig during parsing.
Fields
item_stack: Vec<ParolGrammarItem>
title: Option<String>
comment: Option<String>
start_symbol: String
scanner_configurations: Vec<ScannerConfig>
Implementations
Trait Implementations
fn start_declaration_2(
&mut self,
_end_of_input_0: &ParseTreeStackEntry,
_identifier_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn start_declaration_2(
&mut self,
_end_of_input_0: &ParseTreeStackEntry,
_identifier_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 2:
StartDeclaration: “%start” Identifier;
Semantic action for production 4:
Declarations: ;
fn declaration_5(
&mut self,
_percent_title_0: &ParseTreeStackEntry,
_string_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn declaration_5(
&mut self,
_percent_title_0: &ParseTreeStackEntry,
_string_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 5:
Declaration: “%title” String;
fn declaration_6(
&mut self,
_percent_comment_0: &ParseTreeStackEntry,
_string_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn declaration_6(
&mut self,
_percent_comment_0: &ParseTreeStackEntry,
_string_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 6:
Declaration: “%comment” String;
fn scanner_directives_8(
&mut self,
_percent_line_underscore_comment_0: &ParseTreeStackEntry,
_string_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn scanner_directives_8(
&mut self,
_percent_line_underscore_comment_0: &ParseTreeStackEntry,
_string_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 8:
Declaration: “%line_comment” String;
fn scanner_directives_9(
&mut self,
_percent_block_underscore_comment_0: &ParseTreeStackEntry,
_string_1: &ParseTreeStackEntry,
_string_2: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn scanner_directives_9(
&mut self,
_percent_block_underscore_comment_0: &ParseTreeStackEntry,
_string_1: &ParseTreeStackEntry,
_string_2: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 9:
ScannerDirectives: “%block_comment” String String;
fn scanner_directives_10(
&mut self,
_percent_auto_underscore_newline_underscore_off_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn scanner_directives_10(
&mut self,
_percent_auto_underscore_newline_underscore_off_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 10:
ScannerDirectives: “%auto_newline_off”;
fn scanner_directives_11(
&mut self,
_percent_auto_underscore_ws_underscore_off_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn scanner_directives_11(
&mut self,
_percent_auto_underscore_ws_underscore_off_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 11:
ScannerDirectives: “%auto_ws_off”;
fn production_17(
&mut self,
_identifier_0: &ParseTreeStackEntry,
_colon_1: &ParseTreeStackEntry,
_alternations_2: &ParseTreeStackEntry,
_semicolon_3: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn production_17(
&mut self,
_identifier_0: &ParseTreeStackEntry,
_colon_1: &ParseTreeStackEntry,
_alternations_2: &ParseTreeStackEntry,
_semicolon_3: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 17:
Production: Identifier “:” Alternations “;”;
fn alternations_18(
&mut self,
_alternation_0: &ParseTreeStackEntry,
_alternations_list_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn alternations_18(
&mut self,
_alternation_0: &ParseTreeStackEntry,
_alternations_list_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 18:
Alternations: Alternation AlternationsList;
fn alternations_list_19(
&mut self,
_or_0: &ParseTreeStackEntry,
_alternation_1: &ParseTreeStackEntry,
_alternations_list_2: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn alternations_list_19(
&mut self,
_or_0: &ParseTreeStackEntry,
_alternation_1: &ParseTreeStackEntry,
_alternations_list_2: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 19:
AlternationsList: “|” Alternation AlternationsList;
Semantic action for production 20:
AlternationsList: ;
fn alternation_list_22(
&mut self,
_factor_0: &ParseTreeStackEntry,
_alternation_list_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn alternation_list_22(
&mut self,
_factor_0: &ParseTreeStackEntry,
_alternation_list_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 22:
AlternationList: Factor AlternationList;
Semantic action for production 23:
AlternationList: ;
fn token_with_states_33(
&mut self,
_l_t_0: &ParseTreeStackEntry,
_state_list_1: &ParseTreeStackEntry,
_g_t_2: &ParseTreeStackEntry,
_string_3: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn token_with_states_33(
&mut self,
_l_t_0: &ParseTreeStackEntry,
_state_list_1: &ParseTreeStackEntry,
_g_t_2: &ParseTreeStackEntry,
_string_3: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 33:
TokenWithStates: “<” StateList “>” String;
fn group_34(
&mut self,
_l_paren_0: &ParseTreeStackEntry,
_factor_1: &ParseTreeStackEntry,
_alternations_2: &ParseTreeStackEntry,
_r_paren_3: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn group_34(
&mut self,
_l_paren_0: &ParseTreeStackEntry,
_factor_1: &ParseTreeStackEntry,
_alternations_2: &ParseTreeStackEntry,
_r_paren_3: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 34:
Group: “(” Factor Alternations “)”;
fn optional_35(
&mut self,
_l_bracket_0: &ParseTreeStackEntry,
_factor_1: &ParseTreeStackEntry,
_alternations_2: &ParseTreeStackEntry,
_r_bracket_3: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn optional_35(
&mut self,
_l_bracket_0: &ParseTreeStackEntry,
_factor_1: &ParseTreeStackEntry,
_alternations_2: &ParseTreeStackEntry,
_r_bracket_3: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 35:
Optional: “[” Factor Alternations “]”;
fn repeat_36(
&mut self,
_l_brace_0: &ParseTreeStackEntry,
_factor_1: &ParseTreeStackEntry,
_alternations_2: &ParseTreeStackEntry,
_r_brace_3: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn repeat_36(
&mut self,
_l_brace_0: &ParseTreeStackEntry,
_factor_1: &ParseTreeStackEntry,
_alternations_2: &ParseTreeStackEntry,
_r_brace_3: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 36:
Repeat: “{” Factor Alternations “}”;
fn identifier_37(
&mut self,
identifier_0: &ParseTreeStackEntry,
parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn identifier_37(
&mut self,
identifier_0: &ParseTreeStackEntry,
parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 37:
Identifier: “[a-zA-Z_]\w*”;
fn string_38(
&mut self,
string_0: &ParseTreeStackEntry,
parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn string_38(
&mut self,
string_0: &ParseTreeStackEntry,
parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn scanner_state_39(
&mut self,
_percent_scanner_0: &ParseTreeStackEntry,
_identifier_1: &ParseTreeStackEntry,
_l_brace_2: &ParseTreeStackEntry,
_scanner_state_list_3: &ParseTreeStackEntry,
_r_brace_4: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn scanner_state_39(
&mut self,
_percent_scanner_0: &ParseTreeStackEntry,
_identifier_1: &ParseTreeStackEntry,
_l_brace_2: &ParseTreeStackEntry,
_scanner_state_list_3: &ParseTreeStackEntry,
_r_brace_4: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 39:
ScannerState: “%scanner” Identifier “{” ScannerStateList “}”;
fn state_list_42(
&mut self,
_identifier_0: &ParseTreeStackEntry,
_state_list_list_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn state_list_42(
&mut self,
_identifier_0: &ParseTreeStackEntry,
_state_list_list_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 42:
StateList: Identifier StateListList;
fn state_list_rest_43(
&mut self,
_comma_0: &ParseTreeStackEntry,
_identifier_1: &ParseTreeStackEntry,
_state_list_rest_2: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn state_list_rest_43(
&mut self,
_comma_0: &ParseTreeStackEntry,
_identifier_1: &ParseTreeStackEntry,
_state_list_rest_2: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 43:
StateListRest: “,” Identifier StateListRest;
Semantic action for production 44:
StateListRest: ;
fn scanner_switch_45(
&mut self,
_percent_sc_0: &ParseTreeStackEntry,
_l_paren_1: &ParseTreeStackEntry,
_scanner_name_opt_2: &ParseTreeStackEntry,
_r_paren_3: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn scanner_switch_45(
&mut self,
_percent_sc_0: &ParseTreeStackEntry,
_l_paren_1: &ParseTreeStackEntry,
_scanner_name_opt_2: &ParseTreeStackEntry,
_r_paren_3: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 45:
ScannerSwitch: “%sc” “(” ScannerNameOpt “)”;
fn scanner_switch_46(
&mut self,
_percent_push_0: &ParseTreeStackEntry,
_l_paren_1: &ParseTreeStackEntry,
_identifier_2: &ParseTreeStackEntry,
_r_paren_3: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn scanner_switch_46(
&mut self,
_percent_push_0: &ParseTreeStackEntry,
_l_paren_1: &ParseTreeStackEntry,
_identifier_2: &ParseTreeStackEntry,
_r_paren_3: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 46:
ScannerSwitch: “%push” “(” Identifier “)”;
fn scanner_switch_47(
&mut self,
_percent_pop_0: &ParseTreeStackEntry,
_l_paren_1: &ParseTreeStackEntry,
_r_paren_2: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn scanner_switch_47(
&mut self,
_percent_pop_0: &ParseTreeStackEntry,
_l_paren_1: &ParseTreeStackEntry,
_r_paren_2: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 47:
ScannerSwitch: “%pop” “(” “)”;
Semantic action for production 49:
ScannerNameOpt: ;
fn parol_0(
&mut self,
_prolog_0: &ParseTreeStackEntry,
_grammar_definition_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn parol_0(
&mut self,
_prolog_0: &ParseTreeStackEntry,
_grammar_definition_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 0: Read more
fn prolog_1(
&mut self,
_start_declaration_0: &ParseTreeStackEntry,
_declarations_1: &ParseTreeStackEntry,
_scanner_states_2: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn prolog_1(
&mut self,
_start_declaration_0: &ParseTreeStackEntry,
_declarations_1: &ParseTreeStackEntry,
_scanner_states_2: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 1: Read more
fn declarations_3(
&mut self,
_declaration_0: &ParseTreeStackEntry,
_declarations_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn declarations_3(
&mut self,
_declaration_0: &ParseTreeStackEntry,
_declarations_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 3: Read more
fn declaration_7(
&mut self,
_scanner_directives_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn declaration_7(
&mut self,
_scanner_directives_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 7: Read more
fn scanner_states_12(
&mut self,
_scanner_state_0: &ParseTreeStackEntry,
_scanner_states_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn scanner_states_12(
&mut self,
_scanner_state_0: &ParseTreeStackEntry,
_scanner_states_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 12: Read more
Semantic action for production 13: Read more
fn grammar_definition_14(
&mut self,
_percent_percent_0: &ParseTreeStackEntry,
_production_1: &ParseTreeStackEntry,
_grammar_definition_list_2: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn grammar_definition_14(
&mut self,
_percent_percent_0: &ParseTreeStackEntry,
_production_1: &ParseTreeStackEntry,
_grammar_definition_list_2: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 14: Read more
fn grammar_definition_list_15(
&mut self,
_production_0: &ParseTreeStackEntry,
_grammar_definition_list_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn grammar_definition_list_15(
&mut self,
_production_0: &ParseTreeStackEntry,
_grammar_definition_list_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 15: Read more
Semantic action for production 16: Read more
fn alternation_21(
&mut self,
_alternation_list_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn alternation_21(
&mut self,
_alternation_list_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 21: Read more
fn factor_24(
&mut self,
_group_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn factor_24(
&mut self,
_group_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 24: Read more
fn factor_25(
&mut self,
_repeat_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn factor_25(
&mut self,
_repeat_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 25: Read more
fn factor_26(
&mut self,
_optional_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn factor_26(
&mut self,
_optional_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 26: Read more
fn factor_27(
&mut self,
_symbol_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn factor_27(
&mut self,
_symbol_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 27: Read more
fn symbol_28(
&mut self,
_identifier_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn symbol_28(
&mut self,
_identifier_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 28: Read more
fn symbol_29(
&mut self,
_simple_token_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn symbol_29(
&mut self,
_simple_token_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 29: Read more
fn symbol_30(
&mut self,
_token_with_states_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn symbol_30(
&mut self,
_token_with_states_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 30: Read more
fn symbol_31(
&mut self,
_scanner_switch_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn symbol_31(
&mut self,
_scanner_switch_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 31: Read more
fn simple_token_32(
&mut self,
_string_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn simple_token_32(
&mut self,
_string_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 32: Read more
fn scanner_state_list_40(
&mut self,
_scanner_directives_0: &ParseTreeStackEntry,
_scanner_state_list_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn scanner_state_list_40(
&mut self,
_scanner_directives_0: &ParseTreeStackEntry,
_scanner_state_list_1: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 40: Read more
Semantic action for production 41: Read more
fn scanner_name_opt_48(
&mut self,
_identifier_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn scanner_name_opt_48(
&mut self,
_identifier_0: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeType>
) -> Result<()>
Semantic action for production 48: Read more
fn call_semantic_action_for_production_number(
&mut self,
prod_num: usize,
children: &[ParseTreeStackEntry],
parse_tree: &Tree<ParseTreeType>
) -> Result<()>
fn call_semantic_action_for_production_number(
&mut self,
prod_num: usize,
children: &[ParseTreeStackEntry],
parse_tree: &Tree<ParseTreeType>
) -> Result<()>
This function is implemented automatically for the user’s item. Read more
Auto Trait Implementations
impl RefUnwindSafe for ParolGrammar
impl Send for ParolGrammar
impl Sync for ParolGrammar
impl Unpin for ParolGrammar
impl UnwindSafe for ParolGrammar
Blanket Implementations
Mutably borrows from an owned value. Read more