Exception: ANTLR3::Error::MismatchedSet

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

Overview

error

MismatchedSet

used by

all recognizers

occurs when

A recognizer expects the current input symbol to be a member of a set of possible symbol values, but the current symbol does not match.

Direct Known Subclasses

MismatchedNotSet

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 collapse

Attributes inherited from RecognitionError

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

Instance Method Summary collapse

Methods inherited from RecognitionError

#approximate_line_info?, #location, #unexpected_type

Constructor Details

#initialize(expecting, input) ⇒ MismatchedSet

Returns a new instance of MismatchedSet.


350
351
352
353
# File 'lib/antlr3/error.rb', line 350

def initialize( expecting, input )
  super( input )
  @expecting = expecting
end

Instance Attribute Details

#expectingObject

Returns the value of attribute expecting


349
350
351
# File 'lib/antlr3/error.rb', line 349

def expecting
  @expecting
end

Instance Method Details

#messageObject


355
356
357
358
# File 'lib/antlr3/error.rb', line 355

def message
  "%s: %p not in %p" %
    [ self.class, unexpected_type, @expecting ]
end