Package twisted :: Package xish :: Module xpathparser :: Class Scanner
[frames | no frames]

Class Scanner

Known Subclasses:
XPathParserScanner

Method Summary
  __init__(self, patterns, ignore, input)
Patterns is [(terminal,regex)...] Ignore is [terminal,...]; Input is a string
  __repr__(self)
Print the last 10 tokens that have been scanned in
  scan(self, restrict)
Should scan another token and add it to the list, self.tokens, and add the restriction to self.restrictions
  token(self, i, restrict)
Get the i'th token, and if i is one past the end, then scan for another token; restrict is a list of tokens that are allowed, or 0 for any token.

Method Details

__init__(self, patterns, ignore, input)
(Constructor)

Patterns is [(terminal,regex)...] Ignore is [terminal,...]; Input is a string

__repr__(self)
(Representation operator)

Print the last 10 tokens that have been scanned in

scan(self, restrict)

Should scan another token and add it to the list, self.tokens, and add the restriction to self.restrictions

token(self, i, restrict=0)

Get the i'th token, and if i is one past the end, then scan for another token; restrict is a list of tokens that are allowed, or 0 for any token.

Generated by Epydoc 2.0 on Wed Feb 25 07:37:47 2004 http://epydoc.sf.net