Methods
E
F
M
N
P
S
T
U
Constants
Token = Struct.new :type, :value, :column, :line
 
EOF = Token.new :EOF
 
Class Public methods
from_file(file)
# File lib/rubygems/request_set/lockfile/tokenizer.rb, line 9
def self.from_file file
  new File.read(file), file
end
new(input, filename = nil, line = 0, pos = 0)
# File lib/rubygems/request_set/lockfile/tokenizer.rb, line 13
def initialize input, filename = nil, line = 0, pos = 0
  @line     = line
  @line_pos = pos
  @tokens   = []
  @filename = filename
  tokenize input
end
Instance Public methods
empty?()
# File lib/rubygems/request_set/lockfile/tokenizer.rb, line 41
def empty?
  @tokens.empty?
end
make_parser(set, platforms)
# File lib/rubygems/request_set/lockfile/tokenizer.rb, line 21
def make_parser set, platforms
  Gem::RequestSet::Lockfile::Parser.new self, set, platforms, @filename
end
next_token()
Also aliased as: shift
# File lib/rubygems/request_set/lockfile/tokenizer.rb, line 49
def next_token
  @tokens.shift
end
peek()
# File lib/rubygems/request_set/lockfile/tokenizer.rb, line 54
def peek
  @tokens.first || EOF
end
shift()
Alias for: next_token
skip(type)
# File lib/rubygems/request_set/lockfile/tokenizer.rb, line 29
def skip type
  @tokens.shift while not @tokens.empty? and peek.type == type
end
to_a()
# File lib/rubygems/request_set/lockfile/tokenizer.rb, line 25
def to_a
  @tokens.map { |token| [token.type, token.value, token.column, token.line] }
end
unshift(token)
# File lib/rubygems/request_set/lockfile/tokenizer.rb, line 45
def unshift token
  @tokens.unshift token
end