Exception: ANTLR3::Error::UnwantedToken

Inherits:
MismatchedToken show all
Defined in:
lib/antlr3/error.rb

Overview

TODO: this does not appear to be used by any code

Constant Summary

Constants included from Constants

Constants::BUILT_IN_TOKEN_NAMES, Constants::DEFAULT, Constants::DOWN, Constants::EOF, Constants::EOF_TOKEN, Constants::EOR_TOKEN_TYPE, Constants::HIDDEN, Constants::INVALID, Constants::INVALID_TOKEN, Constants::MEMO_RULE_FAILED, Constants::MEMO_RULE_UNKNOWN, Constants::MIN_TOKEN_TYPE, Constants::SKIP_TOKEN, Constants::UP

Instance Attribute Summary

Attributes inherited from MismatchedToken

#expecting

Attributes inherited from RecognitionError

#column, #index, #input, #line, #source_name, #symbol, #token

Instance Method Summary collapse

Methods inherited from MismatchedToken

#initialize

Methods inherited from RecognitionError

#approximate_line_info?, #initialize, #location, #unexpected_type

Constructor Details

This class inherits a constructor from ANTLR3::Error::MismatchedToken

Instance Method Details

#messageObject


241
242
243
244
245
# File 'lib/antlr3/error.rb', line 241

def message
  exp = @expecting == INVALID_TOKEN_TYPE ? '' : ", expected %p" % @expecting
  text = @symbol.text rescue nil
  "%s: found=%p%s" % [ self.class, text, exp ]
end

#unexpected_tokenObject


237
238
239
# File 'lib/antlr3/error.rb', line 237

def unexpected_token
  return @token
end