class ErrorFormatter extends AnyRef
Abstraction for error formatting logic. Instantiate with a custom configuration or override with custom logic.
- Source
- ErrorFormatter.scala
- Alphabetic
- By Inheritance
- ErrorFormatter
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
-
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
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from ErrorFormatter to any2stringadd[ErrorFormatter] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (ErrorFormatter, B)
- Implicit
- This member is added by an implicit conversion from ErrorFormatter to ArrowAssoc[ErrorFormatter] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
ensuring(cond: (ErrorFormatter) ⇒ Boolean, msg: ⇒ Any): ErrorFormatter
- Implicit
- This member is added by an implicit conversion from ErrorFormatter to Ensuring[ErrorFormatter] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (ErrorFormatter) ⇒ Boolean): ErrorFormatter
- Implicit
- This member is added by an implicit conversion from ErrorFormatter to Ensuring[ErrorFormatter] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): ErrorFormatter
- Implicit
- This member is added by an implicit conversion from ErrorFormatter to Ensuring[ErrorFormatter] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): ErrorFormatter
- Implicit
- This member is added by an implicit conversion from ErrorFormatter to Ensuring[ErrorFormatter] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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. TheerrorColumn
as well as the returned Int value are both 1-based. -
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
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.
-
def
format(error: ParseError, input: ParserInput): String
Formats the given ParseError into a String using the settings configured for this formatter instance.
-
def
formatAsExpected(trace: RuleTrace): String
Formats the given trace into an "expected" string.
-
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.
-
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.
-
def
formatExpected(sb: StringBuilder, error: ParseError): StringBuilder
Formats what is expected at the error location into the given StringBuilder including text padding.
-
def
formatExpected(error: ParseError): String
Formats what is expected at the error location into a single line String including text padding.
-
def
formatExpectedAsList(error: ParseError): List[String]
Formats what is expected at the error location as a List of Strings.
-
def
formatExpectedAsString(sb: StringBuilder, error: ParseError): StringBuilder
Formats what is expected at the error location into the given StringBuilder.
-
def
formatExpectedAsString(error: ParseError): String
Formats what is expected at the error location into a single line String.
-
def
formatNonTerminal(nonTerminal: NonTerminal, showFrameStartOffset: Boolean = showFrameStartOffset): String
Formats the head element of a RuleTrace into a String.
-
def
formatProblem(sb: StringBuilder, error: ParseError, input: ParserInput): StringBuilder
Formats a description of the error's cause into the given StringBuilder.
-
def
formatProblem(error: ParseError, input: ParserInput): String
Formats a description of the error's cause into a single line String.
- def formatTerminal(terminal: Terminal): String
-
def
formatTrace(trace: RuleTrace, errorIndex: Int): String
Formats a RuleTrace into a String.
-
def
formatTraces(error: ParseError): String
Formats a Vector of RuleTrace instances into a String.
-
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from ErrorFormatter to StringFormat[ErrorFormatter] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
mismatchLength(error: ParseError): Int
Determines the number of characters to be shown as "mismatched" for the given ParseError.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
→[B](y: B): (ErrorFormatter, B)
- Implicit
- This member is added by an implicit conversion from ErrorFormatter to ArrowAssoc[ErrorFormatter] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc