Class: Dhaka::LexerSupport::LookaheadAcceptAction

Inherits:
AcceptAction
  • Object
show all
Defined in:
lib/dhaka/lexer/accept_actions.rb

Instance Attribute Summary

Attributes inherited from AcceptAction

#pattern

Instance Method Summary collapse

Methods inherited from AcceptAction

#initialize

Constructor Details

This class inherits a constructor from Dhaka::LexerSupport::AcceptAction

Instance Method Details

#call(lexer_run) ⇒ Object



23
24
25
# File 'lib/dhaka/lexer/accept_actions.rb', line 23

def call(lexer_run)
    lexer_run.accept_last_saved_checkpoint(pattern)
end

#compile_to_ruby_sourceObject



27
28
29
# File 'lib/dhaka/lexer/accept_actions.rb', line 27

def compile_to_ruby_source
  "accept_with_lookahead(#{pattern.inspect})"
end

#to_dotObject



31
32
33
# File 'lib/dhaka/lexer/accept_actions.rb', line 31

def to_dot
  "Accept With Lookahead #{pattern.inspect}"
end