Class GllResult

  • All Implemented Interfaces:
    GearleyResult

    public class GllResult
    extends java.lang.Object
    implements GearleyResult
    The results of a GLL parse.
    • Field Detail

      • success

        public final boolean success
    • Method Detail

      • continueParsing

        public GearleyResult continueParsing​(GearleyParser parser)
        Description copied from interface: GearleyResult
        After a successful prefix parse, this method continues parsing with a new parser.
        Specified by:
        continueParsing in interface GearleyResult
        Parameters:
        parser - The (next) parser.
        Returns:
        The (next) parse result.
      • getForest

        public ParseForest getForest()
        Description copied from interface: GearleyResult
        Return the parse forest created by the parser.

        This method returns null if the parse was unsuccessful.

        Specified by:
        getForest in interface GearleyResult
        Returns:
        The parse forest.
      • isAmbiguous

        public boolean isAmbiguous()
        Description copied from interface: GearleyResult
        Returns true if the parse was ambiguous.
        Specified by:
        isAmbiguous in interface GearleyResult
        Returns:
        true if the parse was ambiguous.
      • isInfinitelyAmbiguous

        public boolean isInfinitelyAmbiguous()
        Description copied from interface: GearleyResult
        Returns true if the parse was infinitely ambiguous.

        The parse will only be infinitely ambiguous if the grqmmar contained a loop.

        Specified by:
        isInfinitelyAmbiguous in interface GearleyResult
        Returns:
        true if the parse was infinitely ambiguous.
      • getTokenCount

        public int getTokenCount()
        Description copied from interface: GearleyResult
        Return the number of tokens parsed.
        Specified by:
        getTokenCount in interface GearleyResult
        Returns:
        the number of tokens.
      • getOffset

        public int getOffset()
        Description copied from interface: GearleyResult
        Returns the last offset read by the parser.
        Specified by:
        getOffset in interface GearleyResult
        Returns:
        The offset.
      • getLineNumber

        public int getLineNumber()
        Description copied from interface: GearleyResult
        Returns the line number of the last line read by the parser.
        Specified by:
        getLineNumber in interface GearleyResult
        Returns:
        The line number.
      • getColumnNumber

        public int getColumnNumber()
        Description copied from interface: GearleyResult
        Returns the column number of the last character on the last line read by the parser.
        Specified by:
        getColumnNumber in interface GearleyResult
        Returns:
        The column number.
      • getPredictedTerminals

        public java.util.Set<TerminalSymbol> getPredictedTerminals()
        Description copied from interface: GearleyResult
        Returns the symbols predicted as possibly next in the case where a parse fails.
        Specified by:
        getPredictedTerminals in interface GearleyResult
        Returns:
        The set of terminals.
      • prefixSucceeded

        public boolean prefixSucceeded()
        Description copied from interface: GearleyResult
        Returns true if the parser successfully processed a prefix of the input.

        Note that the GLL parser does not support prefix parsing.

        Specified by:
        prefixSucceeded in interface GearleyResult
        Returns:
        true if a prefix of the input was parsed successfully.
      • getParseTime

        public long getParseTime()
        Description copied from interface: GearleyResult
        Returns the number of milliseconds spent parsing.
        Specified by:
        getParseTime in interface GearleyResult
        Returns:
        the number of milliseconds
      • succeeded

        public boolean succeeded()
        Description copied from interface: GearleyResult
        Returns true of the parse was successful.
        Specified by:
        succeeded in interface GearleyResult
        Returns:
        true if the parse was successful.