Class: Dhaka::LexerSupport::CheckpointAction
- Inherits:
-
Object
- Object
- Dhaka::LexerSupport::CheckpointAction
- Defined in:
- lib/dhaka/lexer/dfa.rb
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) ⇒ CheckpointAction
constructor
A new instance of CheckpointAction.
Constructor Details
#initialize(pattern) ⇒ CheckpointAction
Returns a new instance of CheckpointAction.
11 12 13 |
# File 'lib/dhaka/lexer/dfa.rb', line 11 def initialize(pattern) @pattern = pattern end |
Instance Attribute Details
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
10 11 12 |
# File 'lib/dhaka/lexer/dfa.rb', line 10 def pattern @pattern end |
Instance Method Details
#call(lexer_run) ⇒ Object
15 16 17 |
# File 'lib/dhaka/lexer/dfa.rb', line 15 def call(lexer_run) lexer_run.save_checkpoint(pattern) end |
#compile_to_ruby_source ⇒ Object
19 20 21 |
# File 'lib/dhaka/lexer/dfa.rb', line 19 def compile_to_ruby_source "add_checkpoint(#{pattern.inspect})" end |