簡単な例。any

#!/usr/bin/env ruby

require 'tdp'

include TDParser

parser = TDParser.define {|g|
  g.input = any() - token("b") - token("c") >> proc {|x| [x[0], x[1], x[2]] }

  def parse(str)
    tokens = str.split(/\s+/)
    input.parse(tokens)
  end
}

p parser.parse("a b c")
p parser.parse("A b c")
p parser.parse("Z b c")
p parser.parse("b c")
p parser.parse("abc")

で、

["a", "b", "c"]
["A", "b", "c"]
["Z", "b", "c"]
nil
nil