Namespace
Methods
C
D
I
M
N
P
S
Constants
DOUT = Notifier::def_notifier("SLex::")
 
D_WARN = DOUT::def_notifier(1, "Warn: ")
 
D_DEBUG = DOUT::def_notifier(2, "Debug: ")
 
D_DETAIL = DOUT::def_notifier(4, "Detail: ")
 
Class Public methods
new()
# File ../ruby/lib/irb/slex.rb, line 30
def initialize
  @head = Node.new("")
end
Instance Public methods
create(token, preproc = nil, postproc = nil)
# File ../ruby/lib/irb/slex.rb, line 65
def create(token, preproc = nil, postproc = nil)
  @head.create_subnode(token.split(//), preproc, postproc)
end
def_rule(token, preproc = nil, postproc = nil, &block)
# File ../ruby/lib/irb/slex.rb, line 34
def def_rule(token, preproc = nil, postproc = nil, &block)
  D_DETAIL.pp token

  postproc = block if block_given?
  create(token, preproc, postproc)
end
def_rules(*tokens, &block)
# File ../ruby/lib/irb/slex.rb, line 41
def def_rules(*tokens, &block)
  if block_given?
    p = block
  end
  for token in tokens
    def_rule(token, nil, p)
  end
end
inspect()
# File ../ruby/lib/irb/slex.rb, line 82
def inspect
  format("<SLex: @head = %s>", @head.inspect)
end
match(token)
# File ../ruby/lib/irb/slex.rb, line 69
def match(token)
  case token
  when Array
  when String
    return match(token.split(//))
  else
    return @head.match_io(token)
  end
  ret = @head.match(token)
  D_DETAIL.exec_if{D_DEATIL.printf "match end: %s:%s\n", ret, token.inspect}
  ret
end
postproc(token)

要チウ3校ック?

# File ../ruby/lib/irb/slex.rb, line 56
def postproc(token)
  node = search(token, proc)
  node.postproc=proc
end
preproc(token, proc)
# File ../ruby/lib/irb/slex.rb, line 50
def preproc(token, proc)
  node = search(token)
  node.preproc=proc
end
# File ../ruby/lib/irb/slex.rb, line 61
def search(token)
  @head.search(token.split(//))
end