Class ActionAnalysis

java.lang.Object
org.antlr.runtime.BaseRecognizer
org.antlr.runtime.Lexer
org.antlr.grammar.v3.ActionAnalysis
All Implemented Interfaces:
org.antlr.runtime.TokenSource

public class ActionAnalysis extends org.antlr.runtime.Lexer
We need to set Rule.referencedPredefinedRuleAttributes before code generation. This filter looks at an action in context of its rule and outer alternative number and figures out which rules have predefined prefs referenced. I need this so I can remove unusued labels. This also tracks, for labeled rules, which are referenced by actions.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) org.antlr.runtime.Token
     
    (package private) Rule
     
    static final int
     
    (package private) Grammar
     
    static final int
     
    (package private) int
     
    static final int
     
    static final int
     
    static final int
     

    Fields inherited from class org.antlr.runtime.Lexer

    input

    Fields inherited from class org.antlr.runtime.BaseRecognizer

    DEFAULT_TOKEN_CHANNEL, HIDDEN, INITIAL_FOLLOW_STACK_SIZE, MEMO_RULE_FAILED, MEMO_RULE_UNKNOWN, NEXT_TOKEN_RULE_NAME, state
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    ActionAnalysis(org.antlr.runtime.CharStream input)
     
    ActionAnalysis(org.antlr.runtime.CharStream input, org.antlr.runtime.RecognizerSharedState state)
     
    ActionAnalysis(Grammar grammar, String ruleName, GrammarAST actionAST)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    alreadyParsedRule(org.antlr.runtime.IntStream input, int ruleIndex)
     
    void
     
    org.antlr.runtime.Lexer[]
     
     
    void
    memoize(org.antlr.runtime.IntStream input, int ruleIndex, int ruleStartIndex)
     
    final void
    mID()
     
    void
     
    final void
    mX()
     
    final void
     
    final void
    mY()
     
    org.antlr.runtime.Token
     
    final boolean
     
    final void
     
    final boolean
     
    final void
     

    Methods inherited from class org.antlr.runtime.Lexer

    emit, emit, getCharErrorDisplay, getCharIndex, getCharPositionInLine, getCharStream, getEOFToken, getErrorMessage, getLine, getSourceName, getText, match, match, matchAny, matchRange, recover, reportError, reset, setCharStream, setText, skip, traceIn, traceOut

    Methods inherited from class org.antlr.runtime.BaseRecognizer

    beginResync, combineFollows, computeContextSensitiveRuleFOLLOW, computeErrorRecoverySet, consumeUntil, consumeUntil, displayRecognitionError, emitErrorMessage, endResync, failed, getBacktrackingLevel, getCurrentInputSymbol, getErrorHeader, getMissingSymbol, getNumberOfSyntaxErrors, getRuleInvocationStack, getRuleInvocationStack, getRuleMemoization, getRuleMemoizationCacheSize, getTokenErrorDisplay, getTokenNames, match, matchAny, mismatchIsMissingToken, mismatchIsUnwantedToken, pushFollow, recover, recoverFromMismatchedSet, recoverFromMismatchedToken, setBacktrackingLevel, toStrings, traceIn, traceOut

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ActionAnalysis

      public ActionAnalysis(Grammar grammar, String ruleName, GrammarAST actionAST)
    • ActionAnalysis

      public ActionAnalysis()
    • ActionAnalysis

      public ActionAnalysis(org.antlr.runtime.CharStream input)
    • ActionAnalysis

      public ActionAnalysis(org.antlr.runtime.CharStream input, org.antlr.runtime.RecognizerSharedState state)
  • Method Details

    • analyze

      public void analyze()
    • getDelegates

      public org.antlr.runtime.Lexer[] getDelegates()
    • getGrammarFileName

      public String getGrammarFileName()
      Overrides:
      getGrammarFileName in class org.antlr.runtime.BaseRecognizer
    • nextToken

      public org.antlr.runtime.Token nextToken()
      Specified by:
      nextToken in interface org.antlr.runtime.TokenSource
      Overrides:
      nextToken in class org.antlr.runtime.Lexer
    • memoize

      public void memoize(org.antlr.runtime.IntStream input, int ruleIndex, int ruleStartIndex)
      Overrides:
      memoize in class org.antlr.runtime.BaseRecognizer
    • alreadyParsedRule

      public boolean alreadyParsedRule(org.antlr.runtime.IntStream input, int ruleIndex)
      Overrides:
      alreadyParsedRule in class org.antlr.runtime.BaseRecognizer
    • mX_Y

      public final void mX_Y() throws org.antlr.runtime.RecognitionException
      Throws:
      org.antlr.runtime.RecognitionException
    • mX

      public final void mX() throws org.antlr.runtime.RecognitionException
      Throws:
      org.antlr.runtime.RecognitionException
    • mY

      public final void mY() throws org.antlr.runtime.RecognitionException
      Throws:
      org.antlr.runtime.RecognitionException
    • mID

      public final void mID() throws org.antlr.runtime.RecognitionException
      Throws:
      org.antlr.runtime.RecognitionException
    • mTokens

      public void mTokens() throws org.antlr.runtime.RecognitionException
      Specified by:
      mTokens in class org.antlr.runtime.Lexer
      Throws:
      org.antlr.runtime.RecognitionException
    • synpred1_ActionAnalysis_fragment

      public final void synpred1_ActionAnalysis_fragment() throws org.antlr.runtime.RecognitionException
      Throws:
      org.antlr.runtime.RecognitionException
    • synpred2_ActionAnalysis_fragment

      public final void synpred2_ActionAnalysis_fragment() throws org.antlr.runtime.RecognitionException
      Throws:
      org.antlr.runtime.RecognitionException
    • synpred2_ActionAnalysis

      public final boolean synpred2_ActionAnalysis()
    • synpred1_ActionAnalysis

      public final boolean synpred1_ActionAnalysis()