Interface TreeBuilder

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void endAmbiguity​(int id, int leftExtent, int rightExtent)
      Called at the end of an ambiguity that is not marked by a single nonterminal.
      void endNonterminal​(NonterminalSymbol symbol, java.util.Map<java.lang.String,​java.lang.String> attributes, int leftExtent, int rightExtent)
      Called when a nonterminal ends.
      void endTree​(boolean ambiguous, boolean absolutelyAmbiguous, boolean infinitelyAmbiguous)
      Called last, when construction finishes.
      void startAmbiguity​(int id, int leftExtent, int rightExtent)
      Called at the start of an ambiguity that is not marked by a single nonterminal.
      void startNonterminal​(NonterminalSymbol symbol, java.util.Map<java.lang.String,​java.lang.String> attributes, int leftExtent, int rightExtent)
      Called when a new nonterminal begins.
      void startTree()
      Called first, when construction begins.
      void token​(Token token, java.util.Map<java.lang.String,​java.lang.String> attributes, int leftExtent, int rightExtent)
      Called when a terminal occurs.
    • Method Detail

      • startTree

        void startTree()
        Called first, when construction begins.
      • endTree

        void endTree​(boolean ambiguous,
                     boolean absolutelyAmbiguous,
                     boolean infinitelyAmbiguous)
        Called last, when construction finishes.
        Parameters:
        ambiguous - was the parse ambiguous?
        absolutelyAmbiguous - is the graph ambiguous?
        infinitelyAmbiguous - is the graph infinitely ambiguous?
      • startNonterminal

        void startNonterminal​(NonterminalSymbol symbol,
                              java.util.Map<java.lang.String,​java.lang.String> attributes,
                              int leftExtent,
                              int rightExtent)
        Called when a new nonterminal begins.
        Parameters:
        symbol - The symbol.
        attributes - Its attributes.
        leftExtent - The starting position in the input.
        rightExtent - The ending position in the input.
      • endNonterminal

        void endNonterminal​(NonterminalSymbol symbol,
                            java.util.Map<java.lang.String,​java.lang.String> attributes,
                            int leftExtent,
                            int rightExtent)
        Called when a nonterminal ends.
        Parameters:
        symbol - The symbol.
        attributes - Its attributes.
        leftExtent - The starting position in the input.
        rightExtent - The ending position in the input.
      • token

        void token​(Token token,
                   java.util.Map<java.lang.String,​java.lang.String> attributes,
                   int leftExtent,
                   int rightExtent)
        Called when a terminal occurs.
        Parameters:
        token - The terminal token.
        attributes - Its attributes.
        leftExtent - The starting position in the input.
        rightExtent - The ending position in the input.
      • startAmbiguity

        void startAmbiguity​(int id,
                            int leftExtent,
                            int rightExtent)
        Called at the start of an ambiguity that is not marked by a single nonterminal.

        The ambiguity id will distinguish this ambiguity from any other ambiguity. The numbers are not sequential or guaranteed stable across parses.

        Parameters:
        id - The ambiguity id.
        leftExtent - The starting position in the input.
        rightExtent - The ending position in the input.
      • endAmbiguity

        void endAmbiguity​(int id,
                          int leftExtent,
                          int rightExtent)
        Called at the end of an ambiguity that is not marked by a single nonterminal.
        Parameters:
        id - The ambiguity id.
        leftExtent - The starting position in the input.
        rightExtent - The ending position in the input.