Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Private Attributes
lib2to3.pgen2.pgen.DFAState Class Reference
Inheritance diagram for lib2to3.pgen2.pgen.DFAState:
Inheritance graph
[legend]
Collaboration diagram for lib2to3.pgen2.pgen.DFAState:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def addarc
def unifystate
def __eq__

Public Attributes

 nfaset
 isfinal
 arcs
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Static Private Attributes

 __hash__ = None

Detailed Description

Definition at line 347 of file pgen.py.


Constructor & Destructor Documentation

def lib2to3.pgen2.pgen.DFAState.__init__ (   self,
  nfaset,
  final 
)

Definition at line 349 of file pgen.py.

00349 
00350     def __init__(self, nfaset, final):
00351         assert isinstance(nfaset, dict)
00352         assert isinstance(next(iter(nfaset)), NFAState)
00353         assert isinstance(final, NFAState)
00354         self.nfaset = nfaset
00355         self.isfinal = final in nfaset
00356         self.arcs = {} # map from label to DFAState

Here is the caller graph for this function:


Member Function Documentation

def lib2to3.pgen2.pgen.DFAState.__eq__ (   self,
  other 
)

Definition at line 368 of file pgen.py.

00368 
00369     def __eq__(self, other):
00370         # Equality test -- ignore the nfaset instance variable
00371         assert isinstance(other, DFAState)
00372         if self.isfinal != other.isfinal:
00373             return False
00374         # Can't just return self.arcs == other.arcs, because that
00375         # would invoke this method recursively, with cycles...
00376         if len(self.arcs) != len(other.arcs):
00377             return False
00378         for label, next in self.arcs.items():
00379             if next is not other.arcs.get(label):
00380                 return False
00381         return True

def lib2to3.pgen2.pgen.DFAState.addarc (   self,
  next,
  label 
)

Definition at line 357 of file pgen.py.

00357 
00358     def addarc(self, next, label):
00359         assert isinstance(label, str)
00360         assert label not in self.arcs
00361         assert isinstance(next, DFAState)
00362         self.arcs[label] = next

def lib2to3.pgen2.pgen.DFAState.unifystate (   self,
  old,
  new 
)

Definition at line 363 of file pgen.py.

00363 
00364     def unifystate(self, old, new):
00365         for label, next in self.arcs.items():
00366             if next is old:
00367                 self.arcs[label] = new


Member Data Documentation

lib2to3.pgen2.pgen.DFAState.__hash__ = None [static, private]

Definition at line 382 of file pgen.py.

Definition at line 355 of file pgen.py.

Definition at line 354 of file pgen.py.

Definition at line 353 of file pgen.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.


The documentation for this class was generated from the following file: