Class: ABNF::Parser::Compiler::RuleBuilder
- Inherits:
-
Object
- Object
- ABNF::Parser::Compiler::RuleBuilder
- Defined in:
- lib/abnf/parser/compiler/rule_builder.rb
Direct Known Subclasses
Alternation, Concatenation, Element, Group, Option, Repetition, RuleList, ABNF::Parser::Compiler::RuleList::Rule
Instance Attribute Summary collapse
-
#compiler ⇒ Object
readonly
Returns the value of attribute compiler.
Instance Method Summary collapse
- #call(token) ⇒ Object
-
#initialize(compiler) ⇒ RuleBuilder
constructor
A new instance of RuleBuilder.
- #start_rule(token) ⇒ Object
Constructor Details
#initialize(compiler) ⇒ RuleBuilder
Returns a new instance of RuleBuilder.
7 8 9 |
# File 'lib/abnf/parser/compiler/rule_builder.rb', line 7 def initialize compiler @compiler = compiler end |
Instance Attribute Details
#compiler ⇒ Object (readonly)
Returns the value of attribute compiler.
5 6 7 |
# File 'lib/abnf/parser/compiler/rule_builder.rb', line 5 def compiler @compiler end |
Instance Method Details
#call(token) ⇒ Object
11 12 13 |
# File 'lib/abnf/parser/compiler/rule_builder.rb', line 11 def call token send token.underscore_type, token end |
#start_rule(token) ⇒ Object
15 16 17 |
# File 'lib/abnf/parser/compiler/rule_builder.rb', line 15 def start_rule token fail end |