Class ParsingResult<V>


  • public class ParsingResult<V>
    extends Object
    A simple container encapsulating the result of a parsing run.
    • Field Detail

      • matched

        public final boolean matched
        Indicates whether the input was successfully parsed.
      • parseTreeRoot

        public final Node<V> parseTreeRoot
        The root node of the parse tree created by the parsing run. This field will only be non-null when parse-tree-building has been enabled.
      • resultValue

        public final V resultValue
        The top value of the value stack at the end of the parsing run or null, if the value stack is empty.
      • valueStack

        public final ValueStack<V> valueStack
        The ValueStack used during the parsing run containing all values not popped of the stack by the parser.
      • parseErrors

        public final List<ParseError> parseErrors
        The list of parse errors created during the parsing run.
      • inputBuffer

        public final InputBuffer inputBuffer
        The underlying input buffer.
    • Constructor Detail

      • ParsingResult

        public ParsingResult​(boolean matched,
                             Node<V> parseTreeRoot,
                             ValueStack<V> valueStack,
                             List<ParseError> parseErrors,
                             InputBuffer inputBuffer)
        Creates a new ParsingResult.
        Parameters:
        matched - true if the rule matched the input
        parseTreeRoot - the parse tree root node
        valueStack - the value stack of the parsing run
        parseErrors - the list of parse errors
        inputBuffer - the input buffer
    • Method Detail

      • hasErrors

        public boolean hasErrors()
        Returns:
        true if this parsing result contains parsing errors.