Back to index

enigmail  1.4.3
Classes | Functions | Variables
pymake.parserdata Namespace Reference

Classes

class  Location
class  Statement
class  DummyRule
class  Rule
class  StaticPatternRule
class  Command
class  SetVariable
class  Condition
class  EqCondition
class  IfdefCondition
class  ElseCondition
class  ConditionBlock
class  Include
class  VPathDirective
class  ExportDirective
class  UnexportDirective
class  EmptyDirective
class  _EvalContext
class  StatementList

Functions

def _expandwildcards
def parsecommandlineargs
def iterstatements

Variables

tuple _log = logging.getLogger('pymake.data')
int _tabwidth = 4
tuple _flagescape = re.compile(r'([\s\\])')

Function Documentation

def pymake.parserdata._expandwildcards (   makefile,
  tlist 
) [private]

Definition at line 59 of file parserdata.py.

00059 
00060 def _expandwildcards(makefile, tlist):
00061     for t in tlist:
00062         if not hasglob(t):
00063             yield t
00064         else:
00065             l = glob(makefile.workdir, t)
00066             for r in l:
00067                 yield r

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 513 of file parserdata.py.

00513 
00514 def iterstatements(stmts):
00515     for s in stmts:
00516         yield s
00517         if isinstance(s, ConditionBlock):
00518             for c, sl in s:
00519                 for s2 in iterstatments(sl): yield s2
Given a set of arguments from a command-line invocation of make,
parse out the variable definitions and return (stmts, arglist, overridestr)

Definition at line 70 of file parserdata.py.

00070 
00071 def parsecommandlineargs(args):
00072     """
00073     Given a set of arguments from a command-line invocation of make,
00074     parse out the variable definitions and return (stmts, arglist, overridestr)
00075     """
00076 
00077     overrides = []
00078     stmts = StatementList()
00079     r = []
00080     for i in xrange(0, len(args)):
00081         a = args[i]
00082 
00083         vname, t, val = util.strpartition(a, ':=')
00084         if t == '':
00085             vname, t, val = util.strpartition(a, '=')
00086         if t != '':
00087             overrides.append(_flagescape.sub(r'\\\1', a))
00088 
00089             vname = vname.strip()
00090             vnameexp = data.Expansion.fromstring(vname, "Command-line argument")
00091 
00092             stmts.append(SetVariable(vnameexp, token=t,
00093                                      value=val, valueloc=Location('<command-line>', i, len(vname) + len(t)),
00094                                      targetexp=None, source=data.Variables.SOURCE_COMMANDLINE))
00095         else:
00096             r.append(a)
00097 
00098     return stmts, r, ' '.join(overrides)


Variable Documentation

tuple pymake.parserdata._flagescape = re.compile(r'([\s\\])')

Definition at line 68 of file parserdata.py.

tuple pymake.parserdata._log = logging.getLogger('pymake.data')

Definition at line 6 of file parserdata.py.

Definition at line 7 of file parserdata.py.