Interface Parser<Node>

  • Type Parameters:
    Node - - type of node in the ParseTree produced
    All Known Implementing Classes:
    SqlParser

    public interface Parser<Node>
    A Parser produces a parse tree of nodes.

    Parsing never throws an exception but instead sets a success indicator and error message.

    • Method Detail

      • parse

        ParseTree<Node> parse()
        This method returns the parse tree. It is idempotent.
        Returns:
        a ParseTree<Node> capturing the result of a complete parse attempt.
      • parseOk

        boolean parseOk()
        This call is idempotent.
        Returns:
        true if the parse completed successfully, otherwise false, in which case the termination message is set.
      • getErrorMessage

        java.lang.String getErrorMessage()
        This call is idempotent.
        Returns:
        a string with a reason for termination. Only valid if parseOk() returns false.