Class: ABNF::Parser::Compiler::RuleBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/abnf/parser/compiler/rule_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#compilerObject (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