| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public static class | |
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| protected int | |
| protected Stack | |
| protected Stack | |
| protected Stack | |
| protected Stack | |
| public static final String | |
| protected List | |
| protected DoubleKeyMap | |
| protected Stack | |
| pack-priv static boolean | |
| protected Token | |
| public static final String | |
| public DebugParser | parser
Ack, should not store parser; can't do remote stuff. |
| protected int | |
| public static final String | |
| pack-priv Profiler. | |
| protected Set | |
| public static final String | Version
Because I may change the stats, I need to track that for later computations to be consistent. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | beginBacktrack(int level)
Overrides org. Implements org. |
| public void | consumeHiddenToken(Token token)
Overrides org. Implements org. |
| public void | consumeToken(Token token)
Overrides org. Implements org. |
| protected Profiler. | |
| public void | endBacktrack(int level, boolean successful)
Overrides org. Implements org. |
| public void | enterDecision(int decisionNumber, boolean couldBacktrack)
Overrides org. Implements org. |
| public void | enterRule(String grammarFileName, String ruleName)
Overrides org. Implements org. |
| public void | examineRuleMemoization(IntStream input, int ruleIndex, int stopIndex, String ruleName)
Track memoization; this is not part of standard debug interface but is triggered by profiling. |
| public void | exitDecision(int decisionNumber)
Overrides org. Implements org. |
| public void | exitRule(String grammarFileName, String ruleName)
Overrides org. Implements org. |
| public List | |
| public DoubleKeyMap | |
| public String | |
| public int | |
| public Profiler. | |
| public boolean | |
| public void | location(int line, int pos)
Overrides org. Implements org. |
| protected String | |
| protected String | |
| public void | LT(int i, Token t)
Overrides org. Implements org. |
| public void | mark(int i)
Overrides org. Implements org. |
| public void | |
| public void | recognitionException(RecognitionException e)
Overrides org. Implements org. |
| public void | rewind(int i)
Overrides org. Implements org. |
| public void | rewind()
Overrides org. Implements org. |
| public void | semanticPredicate(boolean result, String predicate)
Overrides org. Implements org. |
| public void | |
| public void | terminate()
Overrides org. Implements org. |
| protected int[] | |
| public String | |
| public String | |
| public static String | |
| protected int[] |
| backtrackDepth | back to summary |
|---|---|
| protected int backtrackDepth | |
| currentGrammarFileName | back to summary |
|---|---|
| protected Stack<String> currentGrammarFileName | |
| currentLine | back to summary |
|---|---|
| protected Stack<Integer> currentLine | |
| currentPos | back to summary |
|---|---|
| protected Stack<Integer> currentPos | |
| currentRuleName | back to summary |
|---|---|
| protected Stack<String> currentRuleName | |
| DATA_SEP | back to summary |
|---|---|
| public static final String DATA_SEP | |
| decisionEvents | back to summary |
|---|---|
| protected List<Profiler. | |
| decisions | back to summary |
|---|---|
| protected DoubleKeyMap<String, Integer, Profiler. | |
| decisionStack | back to summary |
|---|---|
| protected Stack<Profiler. | |
| dump | back to summary |
|---|---|
| pack-priv static boolean dump | |
| lastRealTokenTouchedInDecision | back to summary |
|---|---|
| protected Token lastRealTokenTouchedInDecision | |
| newline | back to summary |
|---|---|
| public static final String newline | |
| parser | back to summary |
|---|---|
| public DebugParser parser Ack, should not store parser; can't do remote stuff. Well, we pass input stream around too so I guess it's ok. | |
| ruleLevel | back to summary |
|---|---|
| protected int ruleLevel | |
| RUNTIME_STATS_FILENAME | back to summary |
|---|---|
| public static final String RUNTIME_STATS_FILENAME | |
| stats | back to summary |
|---|---|
| pack-priv Profiler. | |
| uniqueRules | back to summary |
|---|---|
| protected Set<String> uniqueRules | |
| Version | back to summary |
|---|---|
| public static final String Version Because I may change the stats, I need to track that for later computations to be consistent. | |
| Profiler | back to summary |
|---|---|
| public Profiler() | |
| Profiler | back to summary |
|---|---|
| public Profiler(DebugParser parser) | |
| beginBacktrack | back to summary |
|---|---|
| public void beginBacktrack(int level) Overrides org. Implements org. Track backtracking decisions. You'll see a fixed or cyclic decision and then a backtrack. enter rule ... enter decision LA and possibly consumes (for cyclic DFAs) begin backtrack level mark m rewind m end backtrack level, success exit decision ... exit rule
| |
| consumeHiddenToken | back to summary |
|---|---|
| public void consumeHiddenToken(Token token) Overrides org. Implements org. Doc from org. An off-channel input token was consumed. Trigger after the token was matched by things like match(), matchAny(). (unless of course the hidden token is first stuff in the input stream).
| |
| consumeToken | back to summary |
|---|---|
| public void consumeToken(Token token) Overrides org. Implements org. Doc from org. An input token was consumed; matched by any kind of element. Trigger after the token was matched by things like match(), matchAny().
| |
| currentDecision | back to summary |
|---|---|
| protected Profiler. | |
| endBacktrack | back to summary |
|---|---|
| public void endBacktrack(int level, boolean successful) Overrides org. Implements org. Successful or not, track how much lookahead synpreds use
| |
| enterDecision | back to summary |
|---|---|
| public void enterDecision(int decisionNumber, boolean couldBacktrack) Overrides org. Implements org. Doc from org. Every decision, fixed k or arbitrary, has an enter/exit event so that a GUI can easily track what LT/consume events are associated with prediction. You will see a single enter/exit subrule but multiple enter/exit decision events, one for each loop iteration.
| |
| enterRule | back to summary |
|---|---|
| public void enterRule(String grammarFileName, String ruleName) Overrides org. Implements org. Doc from org. The parser has just entered a rule. No decision has been made about which alt is predicted. This is fired AFTER init actions have been executed. Attributes are defined and available etc... The grammarFileName allows composite grammars to jump around among multiple grammar files.
| |
| examineRuleMemoization | back to summary |
|---|---|
| public void examineRuleMemoization(IntStream input, int ruleIndex, int stopIndex, String ruleName) Track memoization; this is not part of standard debug interface but is triggered by profiling. Code gen inserts an override for this method in the recognizer, which triggers this method. Called from alreadyParsedRule(). | |
| exitDecision | back to summary |
|---|---|
| public void exitDecision(int decisionNumber) Overrides org. Implements org.
| |
| exitRule | back to summary |
|---|---|
| public void exitRule(String grammarFileName, String ruleName) Overrides org. Implements org. Doc from org. This is the last thing executed before leaving a rule. It is executed even if an exception is thrown. This is triggered after error reporting and recovery have occurred (unless the exception is not caught in this rule). This implies an "exitAlt" event. The grammarFileName allows composite grammars to jump around among multiple grammar files.
| |
| getDecisionEvents | back to summary |
|---|---|
| public List | |
| getDecisionStats | back to summary |
|---|---|
| public DoubleKeyMap | |
| getDecisionStatsDump | back to summary |
|---|---|
| public String getDecisionStatsDump() | |
| getNumberOfHiddenTokens | back to summary |
|---|---|
| public int getNumberOfHiddenTokens(int i, int j) Get num hidden tokens between i..j inclusive | |
| getReport | back to summary |
|---|---|
| public Profiler. | |
| inDecision | back to summary |
|---|---|
| public boolean inDecision() The parser is in a decision if the decision depth > 0. This works for backtracking also, which can have nested decisions. | |
| location | back to summary |
|---|---|
| public void location(int line, int pos) Overrides org. Implements org. Doc from org. To watch a parser move through the grammar, the parser needs to inform the debugger what line/charPos it is passing in the grammar. For now, this does not know how to switch from one grammar to the other and back for island grammars etc... This should also allow breakpoints because the debugger can stop the parser whenever it hits this line/pos.
| |
| locationDescription | back to summary |
|---|---|
| protected String locationDescription() | |
| locationDescription | back to summary |
|---|---|
| protected String locationDescription(String file, String rule, int line, int pos) | |
| LT | back to summary |
|---|---|
| public void LT(int i, Token t) Overrides org. Implements org. Track refs to lookahead if in a fixed/nonfixed decision.
| |
| mark | back to summary |
|---|---|
| public void mark(int i) Overrides org. Implements org. Doc from org. The parser is going to look arbitrarily ahead; mark this location, the token stream's marker is sent in case you need it.
| |
| memoize | back to summary |
|---|---|
| public void memoize(IntStream input, int ruleIndex, int ruleStartIndex, String ruleName) Warning doesn't track success/failure, just unique recording event | |
| recognitionException | back to summary |
|---|---|
| public void recognitionException(RecognitionException e) Overrides org. Implements org. Doc from org. A recognition exception occurred such as NoViableAltException. I made this a generic event so that I can alter the exception hierachy later without having to alter all the debug objects. Upon error, the stack of enter rule/subrule must be properly unwound. If no viable alt occurs it is within an enter/exit decision, which also must be rewound. Even the rewind for each mark must be unwount. In the Java target this is pretty easy using try/finally, if a bit ugly in the generated code. The rewind is generated in DFA.predict() actually so no code needs to be generated for that. For languages w/o this "finally" feature (C++?), the target implementor will have to build an event stack or something. Across a socket for remote debugging, only the RecognitionException data fields are transmitted. The token object or whatever that caused the problem was the last object referenced by LT. The immediately preceding LT event should hold the unexpected Token or char. Here is a sample event trace for grammar: b : C ({;}A|B) // {;} is there to prevent A|B becoming a set | D ; The sequence for this rule (with no viable alt in the subrule) for input 'c c' (there are 3 tokens) is: commence LT(1) enterRule b location 7 1 enter decision 3 LT(1) exit decision 3 enterAlt1 location 7 5 LT(1) consumeToken [c/<4>,1:0] location 7 7 enterSubRule 2 enter decision 2 LT(1) LT(1) recognitionException NoViableAltException 2 1 2 exit decision 2 exitSubRule 2 beginResync LT(1) consumeToken [c/<4>,1:1] LT(1) endResync LT(-1) exitRule b terminate
| |
| rewind | back to summary |
|---|---|
| public void rewind(int i) Overrides org. Implements org. Doc from org. After an arbitrairly long lookahead as with a cyclic DFA (or with any backtrack), this informs the debugger that stream should be rewound to the position associated with marker.
| |
| rewind | back to summary |
|---|---|
| public void rewind() Overrides org. Implements org. Doc from org. Rewind to the input position of the last marker. Used currently only after a cyclic DFA and just before starting a sem/syn predicate to get the input position back to the start of the decision. Do not "pop" the marker off the state. mark(i) and rewind(i) should balance still.
| |
| semanticPredicate | back to summary |
|---|---|
| public void semanticPredicate(boolean result, String predicate) Overrides org. Implements org. Doc from org. A semantic predicate was evaluate with this result and action text
| |
| setParser | back to summary |
|---|---|
| public void setParser(DebugParser parser) | |
| terminate | back to summary |
|---|---|
| public void terminate() Overrides org. Implements org. Doc from org. Parsing is over; successfully or not. Mostly useful for telling remote debugging listeners that it's time to quit. When the rule invocation level goes to zero at the end of a rule, we are done parsing.
| |
| toArray | back to summary |
|---|---|
| protected int[] toArray(List<Integer> a) | |
| toNotifyString | back to summary |
|---|---|
| public String toNotifyString() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| toString | back to summary |
|---|---|
| public static String toString(Profiler. | |
| trim | back to summary |
|---|---|
| protected int[] trim(int[] X, int n) | |
| Modifier and Type | Field and Description |
|---|---|
| public float | |
| public boolean | |
| public int | |
| public String | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public String |
| Access | Constructor and Description |
|---|---|
| public |
| avgk | back to summary |
|---|---|
| public float avgk | |
| couldBacktrack | back to summary |
|---|---|
| public boolean couldBacktrack | |
| decision | back to summary |
|---|---|
| public int decision | |
| fileName | back to summary |
|---|---|
| public String fileName | |
| line | back to summary |
|---|---|
| public int line | |
| maxk | back to summary |
|---|---|
| public int maxk | |
| n | back to summary |
|---|---|
| public int n | |
| numBacktrackOccurrences | back to summary |
|---|---|
| public int numBacktrackOccurrences | |
| numSemPredEvals | back to summary |
|---|---|
| public int numSemPredEvals | |
| pos | back to summary |
|---|---|
| public int pos | |
| ruleName | back to summary |
|---|---|
| public String ruleName | |
| DecisionDescriptor | back to summary |
|---|---|
| public DecisionDescriptor() | |
| Modifier and Type | Field and Description |
|---|---|
| public boolean | |
| public Profiler. | |
| public boolean | |
| public int | |
| public int | |
| public int | |
| public int | |
| public long | |
| public long |
| Access | Constructor and Description |
|---|---|
| public |
| backtracks | back to summary |
|---|---|
| public boolean backtracks | |
| decision | back to summary |
|---|---|
| public Profiler. | |
| evalSemPred | back to summary |
|---|---|
| public boolean evalSemPred | |
| k | back to summary |
|---|---|
| public int k | |
| numMemoizationCacheHits | back to summary |
|---|---|
| public int numMemoizationCacheHits | |
| numMemoizationCacheMisses | back to summary |
|---|---|
| public int numMemoizationCacheMisses | |
| startIndex | back to summary |
|---|---|
| public int startIndex | |
| startTime | back to summary |
|---|---|
| public long startTime | |
| stopTime | back to summary |
|---|---|
| public long stopTime | |
| DecisionEvent | back to summary |
|---|---|
| public DecisionEvent() | |
| Modifier and Type | Field and Description |
|---|---|
| public float | |
| public int | |
| public int | |
| public float | |
| public float | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public String | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public String |
| Access | Constructor and Description |
|---|---|
| public |
| averageDecisionPercentBacktracks | back to summary |
|---|---|
| public float averageDecisionPercentBacktracks | |
| avgDecisionMaxCyclicLookaheads | back to summary |
|---|---|
| public int avgDecisionMaxCyclicLookaheads | |
| avgDecisionMaxFixedLookaheads | back to summary |
|---|---|
| public int avgDecisionMaxFixedLookaheads | |
| avgkPerBacktrackingDecisionEvent | back to summary |
|---|---|
| public float avgkPerBacktrackingDecisionEvent | |
| avgkPerDecisionEvent | back to summary |
|---|---|
| public float avgkPerDecisionEvent | |
| maxDecisionMaxCyclicLookaheads | back to summary |
|---|---|
| public int maxDecisionMaxCyclicLookaheads | |
| maxDecisionMaxFixedLookaheads | back to summary |
|---|---|
| public int maxDecisionMaxFixedLookaheads | |
| maxRuleInvocationDepth | back to summary |
|---|---|
| public int maxRuleInvocationDepth | |
| minDecisionMaxCyclicLookaheads | back to summary |
|---|---|
| public int minDecisionMaxCyclicLookaheads | |
| minDecisionMaxFixedLookaheads | back to summary |
|---|---|
| public int minDecisionMaxFixedLookaheads | |
| name | back to summary |
|---|---|
| public String name | |
| numBacktrackOccurrences | back to summary |
|---|---|
| public int numBacktrackOccurrences | |
| numCharsMatched | back to summary |
|---|---|
| public int numCharsMatched | |
| numCyclicDecisions | back to summary |
|---|---|
| public int numCyclicDecisions | |
| numDecisionEvents | back to summary |
|---|---|
| public int numDecisionEvents | |
| numDecisionsCovered | back to summary |
|---|---|
| public int numDecisionsCovered | |
| numDecisionsThatDoBacktrack | back to summary |
|---|---|
| public int numDecisionsThatDoBacktrack | |
| numDecisionsThatPotentiallyBacktrack | back to summary |
|---|---|
| public int numDecisionsThatPotentiallyBacktrack | |
| numFixedDecisions | back to summary |
|---|---|
| public int numFixedDecisions | |
| numGuessingRuleInvocations | back to summary |
|---|---|
| public int numGuessingRuleInvocations | |
| numHiddenCharsMatched | back to summary |
|---|---|
| public int numHiddenCharsMatched | |
| numHiddenTokens | back to summary |
|---|---|
| public int numHiddenTokens | |
| numMemoizationCacheEntries | back to summary |
|---|---|
| public int numMemoizationCacheEntries | |
| numMemoizationCacheHits | back to summary |
|---|---|
| public int numMemoizationCacheHits | |
| numMemoizationCacheMisses | back to summary |
|---|---|
| public int numMemoizationCacheMisses | |
| numReportedErrors | back to summary |
|---|---|
| public int numReportedErrors | |
| numRuleInvocations | back to summary |
|---|---|
| public int numRuleInvocations | |
| numSemanticPredicates | back to summary |
|---|---|
| public int numSemanticPredicates | |
| numTokens | back to summary |
|---|---|
| public int numTokens | |
| numUniqueRulesInvoked | back to summary |
|---|---|
| public int numUniqueRulesInvoked | |
| stddevDecisionMaxCyclicLookaheads | back to summary |
|---|---|
| public int stddevDecisionMaxCyclicLookaheads | |
| stddevDecisionMaxFixedLookaheads | back to summary |
|---|---|
| public int stddevDecisionMaxFixedLookaheads | |
| Version | back to summary |
|---|---|
| public String Version | |
| ProfileStats | back to summary |
|---|---|
| public ProfileStats() | |