Back to index

enigmail  1.4.3
Public Member Functions | Public Attributes | Private Attributes | Static Private Attributes
pymake.parserdata.ConditionBlock Class Reference
Inheritance diagram for pymake.parserdata.ConditionBlock:
Inheritance graph
[legend]
Collaboration diagram for pymake.parserdata.ConditionBlock:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def getloc
def addcondition
def append
def execute
def dump
def __iter__
def __len__
def __getitem__

Public Attributes

 loc

Private Attributes

 _groups

Static Private Attributes

tuple __slots__ = ('loc', '_groups')

Detailed Description

A list of conditions: each condition has an associated list of statements.

Definition at line 336 of file parserdata.py.


Constructor & Destructor Documentation

def pymake.parserdata.ConditionBlock.__init__ (   self,
  loc,
  condition 
)

Definition at line 342 of file parserdata.py.

00342 
00343     def __init__(self, loc, condition):
00344         self.loc = loc
00345         self._groups = []
00346         self.addcondition(loc, condition)


Member Function Documentation

Definition at line 388 of file parserdata.py.

00388 
00389     def __getitem__(self, i):
00390         return self._groups[i]

Definition at line 382 of file parserdata.py.

00382 
00383     def __iter__(self):
00384         return iter(self._groups)

Definition at line 385 of file parserdata.py.

00385 
00386     def __len__(self):
00387         return len(self._groups)

def pymake.parserdata.ConditionBlock.addcondition (   self,
  loc,
  condition 
)

Definition at line 350 of file parserdata.py.

00350 
00351     def addcondition(self, loc, condition):
00352         assert isinstance(condition, Condition)
00353         condition.loc = loc
00354 
00355         if len(self._groups) and isinstance(self._groups[-1][0], ElseCondition):
00356             raise parser.SyntaxError("Multiple else conditions for block starting at %s" % self.loc, loc)
00357 
00358         self._groups.append((condition, StatementList()))

def pymake.parserdata.ConditionBlock.append (   self,
  statement 
)

Definition at line 359 of file parserdata.py.

00359 
00360     def append(self, statement):
00361         self._groups[-1][1].append(statement)

Here is the caller graph for this function:

def pymake.parserdata.ConditionBlock.dump (   self,
  fd,
  indent 
)

Definition at line 372 of file parserdata.py.

00372 
00373     def dump(self, fd, indent):
00374         print >>fd, "%sConditionBlock" % (indent,)
00375 
00376         indent2 = indent + '  '
00377         for c, statements in self._groups:
00378             print >>fd, "%s Condition %s" % (indent, c)
00379             statements.dump(fd, indent2)
00380             print >>fd, "%s ~Condition" % (indent,)
00381         print >>fd, "%s~ConditionBlock" % (indent,)

Here is the caller graph for this function:

def pymake.parserdata.ConditionBlock.execute (   self,
  makefile,
  context 
)

Definition at line 362 of file parserdata.py.

00362 
00363     def execute(self, makefile, context):
00364         i = 0
00365         for c, statements in self._groups:
00366             if c.evaluate(makefile):
00367                 _log.debug("Condition at %s met by clause #%i", self.loc, i)
00368                 statements.execute(makefile, context)
00369                 return
00370 
00371             i += 1

Definition at line 347 of file parserdata.py.

00347 
00348     def getloc(self):
00349         return self.loc


Member Data Documentation

tuple pymake.parserdata.ConditionBlock.__slots__ = ('loc', '_groups') [static, private]

Definition at line 340 of file parserdata.py.

Definition at line 344 of file parserdata.py.

Definition at line 343 of file parserdata.py.


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