Class: Dhaka::LexerSupport::AcceptAction
- Inherits:
-
Object
- Object
- Dhaka::LexerSupport::AcceptAction
- Defined in:
- lib/lexer/regex_grammar.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.
411 412 413 |
# File 'lib/lexer/regex_grammar.rb', line 411 def initialize(pattern) @pattern = pattern end |
Instance Attribute Details
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
410 411 412 |
# File 'lib/lexer/regex_grammar.rb', line 410 def pattern @pattern end |
Instance Method Details
#call(lexer_run) ⇒ Object
415 416 417 |
# File 'lib/lexer/regex_grammar.rb', line 415 def call(lexer_run) lexer_run.accept(pattern) end |
#compile_to_ruby_source ⇒ Object
419 420 421 |
# File 'lib/lexer/regex_grammar.rb', line 419 def compile_to_ruby_source "accept(#{pattern.inspect})" end |
#to_dot ⇒ Object
423 424 425 |
# File 'lib/lexer/regex_grammar.rb', line 423 def to_dot "Accept #{pattern.inspect}" end |