Interface GearleyParser

  • All Known Implementing Classes:
    EarleyParser, GllParser

    public interface GearleyParser
    The parser interface for Earley and GLL parsers.
    • Method Detail

      • getParserType

        ParserType getParserType()
        The parser type.
        Returns:
        The parser type.
      • getGrammar

        ParserGrammar getGrammar()
        The grammar used by this parser.
        Returns:
        The grammar.
      • getSeed

        NonterminalSymbol getSeed()
        The seed used by this parser.
        Returns:
        The seed token for this parse.
      • parse

        GearleyResult parse​(Token[] input)
        Parse an array of tokens.

        Note that the GLL parser only parses character tokens.

        Parameters:
        input - The array of tokens.
        Returns:
        The parse result.
      • parse

        GearleyResult parse​(java.util.Iterator<Token> input)
        Parse a sequence of tokens provided by an iterator.

        Note that the GLL parser only parses character tokens.

        Parameters:
        input - The token iterator.
        Returns:
        The parse result.
      • parse

        GearleyResult parse​(java.lang.String input)
        Parse a string.
        Parameters:
        input - The input string.
        Returns:
        The parse result.
      • hasMoreInput

        boolean hasMoreInput()
        Returns true of the parse ended without consuming all input.
        Returns:
        true if there was more input.
      • getOffset

        int getOffset()
        Returns the last offset read by the parser.
        Returns:
        the offset.
      • getLineNumber

        int getLineNumber()
        Returns the line number of the last line read by the parser.
        Returns:
        the line number.
      • getColumnNumber

        int getColumnNumber()
        Returns the column number of the last character on the last line read by the parser.
        Returns:
        the column number.