Class: ABNF::Parser::Compiler::Frame

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rule_builder, block) ⇒ Frame

Returns a new instance of Frame.



78
79
80
81
# File 'lib/abnf/parser/compiler.rb', line 78

def initialize rule_builder, block
  @block = block
  @rule_builder = rule_builder
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



75
76
77
# File 'lib/abnf/parser/compiler.rb', line 75

def block
  @block
end

#rule_builderObject (readonly)

Returns the value of attribute rule_builder.



76
77
78
# File 'lib/abnf/parser/compiler.rb', line 76

def rule_builder
  @rule_builder
end

Instance Method Details

#call(token) ⇒ Object



83
84
85
# File 'lib/abnf/parser/compiler.rb', line 83

def call token
  rule_builder.(token)
end

#exited(rule) ⇒ Object



87
88
89
# File 'lib/abnf/parser/compiler.rb', line 87

def exited rule
  block.(rule) if block
end