c

org.parboiled2

ErrorFormatter

class ErrorFormatter extends AnyRef

Abstraction for error formatting logic. Instantiate with a custom configuration or override with custom logic.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ErrorFormatter
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ErrorFormatter(showExpected: Boolean = true, showPosition: Boolean = true, showLine: Boolean = true, showTraces: Boolean = false, showFrameStartOffset: Boolean = true, expandTabs: Int = -1, traceCutOff: Int = 120)

    showExpected

    whether a description of the expected input is to be shown

    showPosition

    whether the error position is to be shown

    showLine

    whether the input line with a error position indicator is to be shown

    showTraces

    whether the error's rule trace are to be shown

    showFrameStartOffset

    whether formatted traces should include the frame start offset

    expandTabs

    whether and how tabs in the error input line are to be expanded. The value indicates the column multiples that a tab represents (equals the number of spaces that a leading tab is expanded into). Set to a value < 0 to disable tab expansion.

    traceCutOff

    the maximum number of (trailing) characters shown for a rule trace

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def expandErrorLineTabs(line: String, errorColumn: Int): (Int, String)

    Performs tab expansion as configured by the expandTabs member.

    Performs tab expansion as configured by the expandTabs member. The errorColumn as well as the returned Int value are both 1-based.

  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def format(sb: StringBuilder, error: ParseError, input: ParserInput): StringBuilder

    Formats the given ParseError into the given StringBuilder using the settings configured for this formatter instance.

  11. def format(error: ParseError, input: ParserInput): String

    Formats the given ParseError into a String using the settings configured for this formatter instance.

  12. def formatAsExpected(trace: RuleTrace): String

    Formats the given trace into an "expected" string.

  13. def formatErrorLine(sb: StringBuilder, error: ParseError, input: ParserInput): StringBuilder

    Formats the input line in which the error occurred and underlines the given error's position in the line with a caret.

  14. def formatErrorLine(error: ParseError, input: ParserInput): String

    Formats the input line in which the error occurred and underlines the given error's position in the line with a caret.

  15. def formatExpected(sb: StringBuilder, error: ParseError): StringBuilder

    Formats what is expected at the error location into the given StringBuilder including text padding.

  16. def formatExpected(error: ParseError): String

    Formats what is expected at the error location into a single line String including text padding.

  17. def formatExpectedAsList(error: ParseError): List[String]

    Formats what is expected at the error location as a List of Strings.

  18. def formatExpectedAsString(sb: StringBuilder, error: ParseError): StringBuilder

    Formats what is expected at the error location into the given StringBuilder.

  19. def formatExpectedAsString(error: ParseError): String

    Formats what is expected at the error location into a single line String.

  20. def formatNonTerminal(nonTerminal: NonTerminal, showFrameStartOffset: Boolean = showFrameStartOffset): String

    Formats the head element of a RuleTrace into a String.

  21. def formatProblem(sb: StringBuilder, error: ParseError, input: ParserInput): StringBuilder

    Formats a description of the error's cause into the given StringBuilder.

  22. def formatProblem(error: ParseError, input: ParserInput): String

    Formats a description of the error's cause into a single line String.

  23. def formatTerminal(terminal: Terminal): String
  24. def formatTrace(trace: RuleTrace, errorIndex: Int): String

    Formats a RuleTrace into a String.

  25. def formatTraces(error: ParseError): String

    Formats a Vector of RuleTrace instances into a String.

  26. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  27. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  28. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  29. def mismatchLength(error: ParseError): Int

    Determines the number of characters to be shown as "mismatched" for the given ParseError.

  30. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  31. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  32. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  33. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  34. def toString(): String
    Definition Classes
    AnyRef → Any
  35. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped