org.parboiled.errors
Class BasicParseError

java.lang.Object
  extended by org.parboiled.errors.BasicParseError
All Implemented Interfaces:
ParseError
Direct Known Subclasses:
ActionError, InvalidInputError

public class BasicParseError
extends java.lang.Object
implements ParseError

A basic ParseError implementation for a one-char parse error with an optional error message.


Constructor Summary
BasicParseError(InputBuffer inputBuffer, int errorIndex, java.lang.String errorMessage)
           
 
Method Summary
 int getEndIndex()
          Gets the end index of the parse error in the underlying input buffer.
 java.lang.String getErrorMessage()
          An optional error message.
 int getIndexDelta()
           
 InputBuffer getInputBuffer()
          Gets the inputbuffer this error occurred in.
 int getStartIndex()
          Gets the start index of the parse error in the underlying input buffer.
 void setEndIndex(int endIndex)
           
 void shiftIndexDeltaBy(int delta)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicParseError

public BasicParseError(InputBuffer inputBuffer,
                       int errorIndex,
                       java.lang.String errorMessage)
Method Detail

getInputBuffer

public InputBuffer getInputBuffer()
Description copied from interface: ParseError
Gets the inputbuffer this error occurred in.

Specified by:
getInputBuffer in interface ParseError
Returns:
the inputbuffer

getStartIndex

public int getStartIndex()
Description copied from interface: ParseError
Gets the start index of the parse error in the underlying input buffer.

Specified by:
getStartIndex in interface ParseError
Returns:
the input index of the first character covered by this error

getEndIndex

public int getEndIndex()
Description copied from interface: ParseError
Gets the end index of the parse error in the underlying input buffer.

Specified by:
getEndIndex in interface ParseError
Returns:
the end index of this error, i.e. the index of the character immediately following the last character covered by this error

setEndIndex

public void setEndIndex(int endIndex)

getErrorMessage

public java.lang.String getErrorMessage()
Description copied from interface: ParseError
An optional error message.

Specified by:
getErrorMessage in interface ParseError
Returns:
an optional error message.

getIndexDelta

public int getIndexDelta()

shiftIndexDeltaBy

public void shiftIndexDeltaBy(int delta)