Back to index

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

List of all members.

Public Member Functions

def __init__
def execute
def dump

Public Attributes

 targetexp
 patternexp
 depexp
 doublecolon

Static Private Attributes

tuple __slots__ = ('targetexp', 'patternexp', 'depexp', 'doublecolon')

Detailed Description

Definition at line 156 of file parserdata.py.


Constructor & Destructor Documentation

def pymake.parserdata.StaticPatternRule.__init__ (   self,
  targetexp,
  patternexp,
  depexp,
  doublecolon 
)

Definition at line 159 of file parserdata.py.

00159 
00160     def __init__(self, targetexp, patternexp, depexp, doublecolon):
00161         assert isinstance(targetexp, (data.Expansion, data.StringExpansion))
00162         assert isinstance(patternexp, (data.Expansion, data.StringExpansion))
00163         assert isinstance(depexp, (data.Expansion, data.StringExpansion))
00164 
00165         self.targetexp = targetexp
00166         self.patternexp = patternexp
00167         self.depexp = depexp
00168         self.doublecolon = doublecolon


Member Function Documentation

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

Definition at line 199 of file parserdata.py.

00199 
00200     def dump(self, fd, indent):
00201         print >>fd, "%sStaticPatternRule %s: %s: %s" % (indent, self.targetexp, self.patternexp, self.depexp)

Here is the caller graph for this function:

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

Definition at line 169 of file parserdata.py.

00169 
00170     def execute(self, makefile, context):
00171         if context.weak:
00172             raise data.DataError("Static pattern rules not allowed in includedeps", self.targetexp.loc)
00173 
00174         targets = list(_expandwildcards(makefile, data.stripdotslashes(self.targetexp.resolvesplit(makefile, makefile.variables))))
00175 
00176         if not len(targets):
00177             context.currule = DummyRule()
00178             return
00179 
00180         patterns = list(data.stripdotslashes(self.patternexp.resolvesplit(makefile, makefile.variables)))
00181         if len(patterns) != 1:
00182             raise data.DataError("Static pattern rules must have a single pattern", self.patternexp.loc)
00183         pattern = data.Pattern(patterns[0])
00184 
00185         deps = [data.Pattern(p) for p in _expandwildcards(makefile, data.stripdotslashes(self.depexp.resolvesplit(makefile, makefile.variables)))]
00186 
00187         rule = data.PatternRule([pattern], deps, self.doublecolon, loc=self.targetexp.loc)
00188 
00189         for t in targets:
00190             if data.Pattern(t).ispattern():
00191                 raise data.DataError("Target '%s' of a static pattern rule must not be a pattern" % (t,), self.targetexp.loc)
00192             stem = pattern.match(t)
00193             if stem is None:
00194                 raise data.DataError("Target '%s' does not match the static pattern '%s'" % (t, pattern), self.targetexp.loc)
00195             makefile.gettarget(t).addrule(data.PatternRuleInstance(rule, '', stem, pattern.ismatchany()))
00196 
00197         makefile.foundtarget(targets[0])
00198         context.currule = rule

Here is the call graph for this function:


Member Data Documentation

Definition at line 157 of file parserdata.py.

Definition at line 166 of file parserdata.py.

Definition at line 167 of file parserdata.py.

Definition at line 165 of file parserdata.py.

Definition at line 164 of file parserdata.py.


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