Package schrodinger :: Package application :: Package desmond :: Package antlr3 :: Module debug :: Class DebugParser
[hide private]
[frames] | no frames]

Class DebugParser

                object --+        
                         |        
recognizers.BaseRecognizer --+    
                             |    
            recognizers.Parser --+
                                 |
                                DebugParser

Instance Methods [hide private]
 
__init__(self, stream, state=None, dbg=None, *args, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
 
setDebugListener(self, dbg)
Provide a new debug event listener for this parser.
 
getDebugListener(self)
 
beginResync(self)
A hook to listen in on the token consumption during error recovery.
 
endResync(self)
A hook to listen in on the token consumption during error recovery.
 
beginBacktrack(self, level)
 
endBacktrack(self, level, successful)
 
reportError(self, exc)
Report a recognition problem.

Inherited from recognizers.Parser: getCurrentInputSymbol, getMissingSymbol, getSourceName, getTokenStream, reset, setTokenStream, traceIn, traceOut

Inherited from recognizers.BaseRecognizer: alreadyParsedRule, combineFollows, computeContextSensitiveRuleFOLLOW, computeErrorRecoverySet, consumeUntil, displayRecognitionError, emitErrorMessage, failed, getBacktrackingLevel, getErrorHeader, getErrorMessage, getGrammarFileName, getNumberOfSyntaxErrors, getRuleInvocationStack, getRuleMemoization, getTokenErrorDisplay, match, matchAny, memoize, mismatchIsMissingToken, mismatchIsUnwantedToken, recover, recoverFromMismatchedSet, recoverFromMismatchedToken, setBacktrackingLevel, setInput, toStrings

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
Class Variables [hide private]

Inherited from recognizers.BaseRecognizer: DEFAULT_TOKEN_CHANNEL, HIDDEN, MEMO_RULE_FAILED, MEMO_RULE_UNKNOWN, antlr_version, antlr_version_str, tokenNames

Properties [hide private]
  dbg

Inherited from object: __class__

Method Details [hide private]

__init__(self, stream, state=None, dbg=None, *args, **kwargs)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

setDebugListener(self, dbg)

 

Provide a new debug event listener for this parser. Notify the input stream too that it should send events to this listener.

beginResync(self)

 

A hook to listen in on the token consumption during error recovery. The DebugParser subclasses this to fire events to the listenter.

Overrides: recognizers.BaseRecognizer.beginResync
(inherited documentation)

endResync(self)

 

A hook to listen in on the token consumption during error recovery. The DebugParser subclasses this to fire events to the listenter.

Overrides: recognizers.BaseRecognizer.endResync
(inherited documentation)

reportError(self, exc)

 
Report a recognition problem.
    
This method sets errorRecovery to indicate the parser is recovering
not parsing.  Once in recovery mode, no errors are generated.
To get out of recovery mode, the parser must successfully match
a token (after a resync).  So it will go:

1. error occurs
2. enter recovery mode, report error
3. consume until token found in resynch set
4. try to resume parsing
5. next match() will reset errorRecovery mode

If you override, make sure to update syntaxErrors if you care about
that.

Overrides: recognizers.BaseRecognizer.reportError
(inherited documentation)

Property Details [hide private]

dbg

Get Method:
getDebugListener(self)
Set Method:
setDebugListener(self, dbg) - Provide a new debug event listener for this parser.