Exception: ANTLR3::Error::MismatchedRange

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

Overview

error

MismatchedRange

used by

all recognizers

occurs when

A recognizer expected to match an input symbol (either a character value or an integer token type value) that falls into a range of possible values, but instead it saw a symbol that falls outside the expected range.

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_NODE, 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(min, max, input) ⇒ MismatchedRange

Returns a new instance of MismatchedRange.



326
327
328
329
330
# File 'lib/antlr3/error.rb', line 326

def initialize( min, max, input )
  @min = min
  @max = max
  super( input )
end

Instance Attribute Details

#maxObject

Returns the value of attribute max.



325
326
327
# File 'lib/antlr3/error.rb', line 325

def max
  @max
end

#minObject

Returns the value of attribute min.



325
326
327
# File 'lib/antlr3/error.rb', line 325

def min
  @min
end

Instance Method Details

#messageObject



332
333
334
335
# File 'lib/antlr3/error.rb', line 332

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