Exception: LexerNoViableAltException

Inherits:
RecognitionException show all
Defined in:
lib/antlr4/error.rb

Instance Attribute Summary collapse

Attributes inherited from RecognitionException

#ctx, #deadEndConfigs, #input, #offendingState, #offendingToken, #recognizer, #startToken

Instance Method Summary collapse

Methods inherited from RecognitionException

#getExpectedTokens

Constructor Details

#initialize(lexer, input, startIndex, deadEndConfigs) ⇒ LexerNoViableAltException

Returns a new instance of LexerNoViableAltException.



68
69
70
71
72
# File 'lib/antlr4/error.rb', line 68

def initialize(lexer, input, startIndex, deadEndConfigs)
    super(nil, lexer, input, nil)
    @startIndex = startIndex
    @deadEndConfigs = deadEndConfigs
end

Instance Attribute Details

#startIndexObject

Returns the value of attribute startIndex.



67
68
69
# File 'lib/antlr4/error.rb', line 67

def startIndex
  @startIndex
end

Instance Method Details

#to_sObject



74
75
76
77
78
79
80
81
# File 'lib/antlr4/error.rb', line 74

def to_s
    symbol = nil
    if self.startIndex >= 0 and self.startIndex < self.input.size() then
        symbol = self.input.getText(self.startIndex, self.startIndex)
        # TODO symbol = Utils.escapeWhitespace(symbol, false);
    end
    return "LexerNoViableAltException #{symbol}" 
end