Parent

Methods

Class/Module Index [+]

Quicksearch

RKelly::Lexeme

Attributes

name[R]
pattern[R]

Public Class Methods

new(name, pattern, &block) click to toggle source
# File lib/rkelly/lexeme.rb, line 6
def initialize(name, pattern, &block)
  @name       = name
  @pattern    = pattern
  @block      = block
end

Public Instance Methods

match(scanner) click to toggle source
# File lib/rkelly/lexeme.rb, line 12
def match(scanner)
  match = scanner.check(pattern)
  return Token.new(name, match.to_s, &@block) if match
  match
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.