Package ZestyParser :: Module DebuggingParser :: Class DebuggingParser
[show private | hide private]
[frames | no frames]

Class DebuggingParser

ZestyParser --+
              |
             DebuggingParser


A Parser.ZestyParser subclass which is useful for debugging parsers. It parses as usual, but it also prints a comprehensive trace to stderr.
Method Summary
  iter(self, token, *args, **kwargs)
object scan(self, token)
Scan for one token.
bool skip(self, token)
A convenience method that skips one token and returns whether it matched.
    Inherited from ZestyParser
  __init__(self, data)
Initializes the parser, optionally calling useData
tuple coord(self, loc)
Returns row/column coordinates for a given point in the input stream, or cursor by default.
  useData(self, data)
Begin parsing a stream of data

Instance Variable Summary
    Inherited from ZestyParser
dict context: A dictionary which can be used for storing any necessary state information.
int cursor: The current position of the parser in data.
sequence data: The sequence being parsed (probably a string).
token last: The last matched token.

Class Variable Summary
int depth = -1                                                                    
    Inherited from ZestyParser
int len = 0                                                                     

Method Details

scan(self, token)

Scan for one token.
Parameters:
token - The token to scan for.
Returns:
The return value of the matching token, or None if the token raised NotMatched.
           (type=object)
Raises:
ParseError - If a token fails to match and it has a failMessage parameter.
Overrides:
ZestyParser.Parser.ZestyParser.scan (inherited documentation)

skip(self, token)

A convenience method that skips one token and returns whether it matched.
Parameters:
token - The token to scan for.
           (type=token)
Returns:
Whether or not the token matched.
           (type=bool)
Overrides:
ZestyParser.Parser.ZestyParser.skip (inherited documentation)

Class Variable Details

depth

Type:
int
Value:
-1                                                                    

Generated by Epydoc 2.1 on Thu Mar 22 02:13:39 2007 http://epydoc.sf.net