Class: Depager::LexerExtension::PreRuleList0::Parser
- Inherits:
-
Depager::LALR::Basis
- Object
- Depager::LALR::Parser
- Depager::LALR::Basis
- Depager::LexerExtension::PreRuleList0::Parser
- Includes:
- Utils::ExtensionSlaveMethods
- Defined in:
- lib/depager/plugins/lex.rb
Overview
:nodoc:all
Constant Summary collapse
- REDUCE_TABLE =
Reduce Table
[ [ -1, 1 ], [ 0, 1 ], [ 1, 1 ], [ 1, 2 ], [ 2, 3 ], [ 4, 0 ], [ 4, 1 ], [ 3, 1 ], [ 3, 3 ], ]
- TERM_TO_INT =
Term to Int
{ nil => 0, false => 1, :ACTION => 2, "!" => 3, :LEX => 4, "," => 5, }
- INT_TO_TERM =
Int to Term
[ nil, false, :ACTION, "!", :LEX, ",", ]
- ACTION_TABLE =
Action Table
[ [ nil, nil, nil, nil, 5, nil, ], [ ACC, nil, nil, nil, nil, nil, ], [ nil, nil, nil, nil, 5, nil, ], [ nil, nil, nil, nil, nil, nil, ], [ nil, nil, nil, 8, nil, 9, ], [ nil, nil, nil, nil, nil, nil, ], [ nil, nil, nil, nil, nil, nil, ], [ nil, nil, 10, nil, nil, nil, ], [ nil, nil, nil, nil, nil, nil, ], [ nil, nil, nil, nil, 11, nil, ], [ nil, nil, nil, nil, nil, nil, ], [ nil, nil, nil, nil, nil, nil, ], ]
- DEFRED_TABLE =
Default Reduce Table
[ nil, nil, -1, -2, -5, -7, -3, nil, -6, nil, -4, -8, ]
- DEFRED_AFTER_SHIFT_TABLE =
[ nil, nil, nil, -2, nil, -7, -3, nil, -6, nil, -4, -8, ]
- NONTERM_TO_INT =
Nonterm to Int
{ :start => 0, :lexactlist => 1, :lexact => 2, :lexlist => 3, :opt_noskip => 4, }
- INT_TO_NONTERM =
Int to Nonterm
[ :start, :lexactlist, :lexact, :lexlist, :opt_noskip, ]
- GOTO_TABLE =
Goto Table
[ [ 1, 2, 3, 4, nil, ], [ nil, nil, nil, nil, nil, ], [ nil, nil, 6, 4, nil, ], [ nil, nil, nil, nil, nil, ], [ nil, nil, nil, nil, 7, ], [ nil, nil, nil, nil, nil, ], [ nil, nil, nil, nil, nil, ], [ nil, nil, nil, nil, nil, ], [ nil, nil, nil, nil, nil, ], [ nil, nil, nil, nil, nil, ], [ nil, nil, nil, nil, nil, ], [ nil, nil, nil, nil, nil, ], ]
Constants inherited from Depager::LALR::Parser
Instance Attribute Summary
Attributes included from Utils::ExtensionSlaveMethods
Attributes inherited from Depager::LALR::Basis
#action_value, #basis, #file, #line, #lookahead, #parser_size, #stack
Instance Method Summary collapse
- #action_table ⇒ Object
- #banner ⇒ Object
- #defred_after_shift_table ⇒ Object
- #defred_table ⇒ Object
- #do_parse? ⇒ Boolean
- #goto_table ⇒ Object
-
#initialize(g_parser, master) ⇒ Parser
constructor
A new instance of Parser.
- #int_to_nonterm ⇒ Object
- #int_to_term ⇒ Object
- #nonterm_to_int ⇒ Object
- #reduce_table ⇒ Object
- #term_to_int ⇒ Object
Methods included from Utils::ExtensionSlaveMethods
#abort_driver, #do_default, #do_parse
Methods included from Utils::CodeGeneratorMethods
#expand_inline_code, #generate_action_decorator_code, #generate_decorator_code, #parse_block
Methods included from Utils::CommonMethods
#error_exit, #error_message, #expanded_code_delimiter, #file, #full_target_name, #input_path, #inspect, #target_name, #target_namespace, #warning
Methods inherited from Depager::LALR::Basis
#abort_driver, #accept, #do_abort_driver, #error, #next_decorator_index, #reduce, #shift
Methods inherited from Depager::LALR::Parser
#accept, #error, #lex, #parse, #reduce, #shift
Constructor Details
Instance Method Details
#action_table ⇒ Object
86 |
# File 'lib/depager/plugins/lex.rb', line 86 def action_table; ACTION_TABLE; end |
#banner ⇒ Object
177 178 179 |
# File 'lib/depager/plugins/lex.rb', line 177 def "%LEX{ ... } / Depager::LexerExtension" end |
#defred_after_shift_table ⇒ Object
119 |
# File 'lib/depager/plugins/lex.rb', line 119 def defred_after_shift_table; DEFRED_AFTER_SHIFT_TABLE; end |
#defred_table ⇒ Object
103 |
# File 'lib/depager/plugins/lex.rb', line 103 def defred_table; DEFRED_TABLE; end |
#do_parse? ⇒ Boolean
167 168 169 170 171 172 173 174 |
# File 'lib/depager/plugins/lex.rb', line 167 def do_parse? if @line.match(/^\s*%LEX\{\s*\Z/) @line = $' true else false end end |
#goto_table ⇒ Object
156 |
# File 'lib/depager/plugins/lex.rb', line 156 def goto_table; GOTO_TABLE; end |
#int_to_nonterm ⇒ Object
139 |
# File 'lib/depager/plugins/lex.rb', line 139 def int_to_nonterm; INT_TO_NONTERM; end |
#int_to_term ⇒ Object
69 |
# File 'lib/depager/plugins/lex.rb', line 69 def int_to_term; INT_TO_TERM; end |
#nonterm_to_int ⇒ Object
129 |
# File 'lib/depager/plugins/lex.rb', line 129 def nonterm_to_int; NONTERM_TO_INT; end |
#reduce_table ⇒ Object
47 |
# File 'lib/depager/plugins/lex.rb', line 47 def reduce_table; REDUCE_TABLE; end |
#term_to_int ⇒ Object
58 |
# File 'lib/depager/plugins/lex.rb', line 58 def term_to_int; TERM_TO_INT; end |