Class NormalProduction

java.lang.Object
org.javacc.parser.Expansion
org.javacc.parser.NormalProduction
Direct Known Subclasses:
BNFProduction, CodeProduction

public class NormalProduction extends Expansion
Describes JavaCC productions.
  • Field Details

    • parents

      private final List<Expansion> parents
      The NonTerminal nodes which refer to this production.
    • accessMod

      private String accessMod
      The access modifier of this production.
    • lhs

      private String lhs
      The name of the non-terminal of this production.
    • return_type_tokens

      private final List<Token> return_type_tokens
      The tokens that make up the return type of this production.
    • parameter_list_tokens

      private final List<Token> parameter_list_tokens
      The tokens that make up the parameters of this production.
    • throws_list

      private List<List<Token>> throws_list
      Each entry in this list is a list of tokens that represents an exception in the throws list of this production. This list does not include ParseException which is always thrown.
    • expansion

      private Expansion expansion
      The RHS of this production. Not used for JavaCodeProduction.
    • emptyPossible

      private boolean emptyPossible
      This boolean flag is true if this production can expand to empty.
    • leftExpansions

      private NormalProduction[] leftExpansions
      A list of all non-terminals that this one can expand to without having to consume any tokens. Also an index that shows how many pointers exist.
    • leIndex

      int leIndex
    • walkStatus

      private int walkStatus
      The following variable is used to maintain state information for the left-recursion determination algorithm: It is initialized to 0, and set to -1 if this node has been visited in a pre-order walk, and then it is set to 1 if the pre-order walk of the whole graph from this node has been traversed. i.e., -1 indicates partially processed, and 1 indicates fully processed.
    • lastToken

      private Token lastToken
      The first and last tokens from the input stream that represent this production.
    • firstToken

      private Token firstToken
    • eol

      private final String eol
  • Constructor Details

    • NormalProduction

      public NormalProduction()
  • Method Details

    • dumpPrefix

      protected StringBuffer dumpPrefix(int indent)
      Overrides:
      dumpPrefix in class Expansion
    • getSimpleName

      protected String getSimpleName()
    • dump

      public StringBuffer dump(int indent, Set<Expansion> alreadyDumped)
      Overrides:
      dump in class Expansion
    • getParents

      List<Expansion> getParents()
      Returns:
      the parents
    • setAccessMod

      public void setAccessMod(String accessMod)
      Parameters:
      accessMod - the accessMod to set
    • getAccessMod

      public String getAccessMod()
      Returns:
      the accessMod
    • setLhs

      public void setLhs(String lhs)
      Parameters:
      lhs - the lhs to set
    • getLhs

      public String getLhs()
      Returns:
      the lhs
    • getReturnTypeTokens

      public List<Token> getReturnTypeTokens()
      Returns:
      the return_type_tokens
    • getParameterListTokens

      public List<Token> getParameterListTokens()
      Returns:
      the parameter_list_tokens
    • setThrowsList

      public void setThrowsList(List<List<Token>> throws_list)
      Parameters:
      throws_list - the throws_list to set
    • getThrowsList

      public List<List<Token>> getThrowsList()
      Returns:
      the throws_list
    • setExpansion

      public void setExpansion(Expansion expansion)
      Parameters:
      expansion - the expansion to set
    • getExpansion

      public Expansion getExpansion()
      Returns:
      the expansion
    • setEmptyPossible

      boolean setEmptyPossible(boolean emptyPossible)
      Parameters:
      emptyPossible - the emptyPossible to set
    • isEmptyPossible

      boolean isEmptyPossible()
      Returns:
      the emptyPossible
    • setLeftExpansions

      void setLeftExpansions(NormalProduction[] leftExpansions)
      Parameters:
      leftExpansions - the leftExpansions to set
    • getLeftExpansions

      NormalProduction[] getLeftExpansions()
      Returns:
      the leftExpansions
    • setWalkStatus

      void setWalkStatus(int walkStatus)
      Parameters:
      walkStatus - the walkStatus to set
    • getWalkStatus

      int getWalkStatus()
      Returns:
      the walkStatus
    • setFirstToken

      public Token setFirstToken(Token firstToken)
      Parameters:
      firstToken - the firstToken to set
    • getFirstToken

      public Token getFirstToken()
      Returns:
      the firstToken
    • setLastToken

      public void setLastToken(Token lastToken)
      Parameters:
      lastToken - the lastToken to set
    • getLastToken

      public Token getLastToken()
      Returns:
      the lastToken