Class: Dhaka::LexerSupport::AcceptAction
- Inherits:
-
Object
- Object
- Dhaka::LexerSupport::AcceptAction
- Defined in:
- lib/dhaka/lexer/accept_actions.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
Instance Method Summary collapse
- #call(lexer_run) ⇒ Object
- #compile_to_ruby_source ⇒ Object
-
#initialize(pattern) ⇒ AcceptAction
constructor
A new instance of AcceptAction.
- #to_dot ⇒ Object
Constructor Details
#initialize(pattern) ⇒ AcceptAction
Returns a new instance of AcceptAction.
5 6 7 |
# File 'lib/dhaka/lexer/accept_actions.rb', line 5 def initialize(pattern) @pattern = pattern end |
Instance Attribute Details
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
4 5 6 |
# File 'lib/dhaka/lexer/accept_actions.rb', line 4 def pattern @pattern end |
Instance Method Details
#call(lexer_run) ⇒ Object
9 10 11 |
# File 'lib/dhaka/lexer/accept_actions.rb', line 9 def call(lexer_run) lexer_run.accept(pattern) end |
#compile_to_ruby_source ⇒ Object
13 14 15 |
# File 'lib/dhaka/lexer/accept_actions.rb', line 13 def compile_to_ruby_source "accept(#{pattern.inspect})" end |
#to_dot ⇒ Object
17 18 19 |
# File 'lib/dhaka/lexer/accept_actions.rb', line 17 def to_dot "Accept #{pattern.inspect}" end |