Package td_parser :: Module td_parser :: Class ParserState
[hide private]
[frames] | no frames]

Class ParserState

source code

A parser state is basically a pair of a goallist (derivation) and a wordlist, with a Pythonic class instance wrapper.

Instance Methods [hide private]
  __init__(self, GoalList, WordList)
string __str__(self)
Return nice string rep.
  __getitem__(self, i)
This is a little silly! Purely for illustration! Allows ParserState instances to be accessed using the usual Python sequence syntax

Method Details [hide private]

__init__(self, GoalList, WordList)
(Constructor)

source code 
None

__str__(self)
(Informal representation operator)

source code 

Return nice string rep.

Look like a pair! Because that's what you are!
Returns: string

__getitem__(self, i)
(Indexing operator)

source code 
This is a little silly! Purely for illustration! Allows ParserState instances to be accessed using the usual Python sequence syntax
>>> ps = ParserState(['S'],['a', 'dog', 'walks'])
>>> ps[0]
['S]
>>> ps[1]
['a', 'dog', 'walks']