class AdLint::TokenQueue

DESCRIPTION

Token queue to interface to the parser.

Public Class Methods

new(tok_ary = nil) click to toggle source

DESCRIPTION

Constructs an empty token queue or a solid token queue from specified token array.

PARAMETER

token_ary

TokenArray – Array of tokens.

Calls superclass method
# File lib/adlint/lexer.rb, line 48
def initialize(tok_ary = nil)
  if tok_ary
    super
  else
    super()
  end
end

Public Instance Methods

expect(tok_type) click to toggle source
# File lib/adlint/lexer.rb, line 56
def expect(tok_type)
  tok = self.first
  tok && tok.type == tok_type ? true : false
end