Package SCons :: Module cpp
[hide private]
[frames] | no frames]

Module cpp

source code

SCons C Pre-Processor module
Classes [hide private]
  FunctionEvaluator
Handles delayed evaluation of a #define function call.
  PreProcessor
The main workhorse class for handling C pre-processing.
  DumbPreProcessor
A preprocessor that ignores all #if/#elif/#else/#endif directives and just reports back all of the #include files (like the classic SCons scanner did).
Functions [hide private]
 
CPP_to_Python_Ops_Sub(m) source code
 
CPP_to_Python(s)
Converts a C pre-processor expression into an equivalent Python expression that can be evaluated.
source code
Variables [hide private]
  __doc__ = ...
  cpp_lines_dict = {('define'): '\\s+([_A-Za-z][_A-Za-z0-9_]*)(\...
  Table = {'define': re.compile(r'\s+([_A-Za-z][_A-Za-z0-9_]*)(\...
  e = '^\\s*#\\s*(elif|undef|ifdef|else|ifndef|if(?!n?def)|endif...
  CPP_Expression = re.compile(r'(?m)^\s*#\s*(elif|undef|ifdef|el...
  CPP_to_Python_Ops_Dict = {'\r': '', '!': ' not ', '!=': ' != '...
  CPP_to_Python_Ops_Expression = re.compile(r'\|\||&&|!=|!|\r|:|...
  CPP_to_Python_Eval_List = [[re.compile(r'defined\s+(\w+)'), '"...
  line_continuations = re.compile(r'\\\r?\n')
  function_name = re.compile(r'(\S+)\(([^\)]*)\)')
  function_arg_separator = re.compile(r',\s*')
  __package__ = 'SCons'
  x = 'define'
Variables Details [hide private]

__doc__

Value:
"""
SCons C Pre-Processor module
"""

cpp_lines_dict

Value:
{('define'): '\\s+([_A-Za-z][_A-Za-z0-9_]*)(\\([^)]*\\))?\\s*(.*)',
 ('else', 'endif'): '',
 ('if', 'elif'): '\\s*(.+)',
 ('ifdef', 'ifndef'): '\\s+(.+)',
 ('import', 'include', 'include_next'): '\\s*(.+)',
 ('undef'): '\\s+([_A-Za-z][A-Za-z0-9_]*)'}

Table

Value:
{'define': re.compile(r'\s+([_A-Za-z][_A-Za-z0-9_]*)(\([^\)]*\))?\s*(.\
*)'),
 'elif': re.compile(r'\s*(.+)'),
 'else': re.compile(r''),
 'endif': re.compile(r''),
 'if': re.compile(r'\s*(.+)'),
 'ifdef': re.compile(r'\s+(.+)'),
 'ifndef': re.compile(r'\s+(.+)'),
...

e

Value:
'^\\s*#\\s*(elif|undef|ifdef|else|ifndef|if(?!n?def)|endif|include_nex\
t|import|include|define)(.*)$'

CPP_Expression

Value:
re.compile(r'(?m)^\s*#\s*(elif|undef|ifdef|else|ifndef|if(?!n?def)|end\
if|include_next|import|include|define)(.*)$')

CPP_to_Python_Ops_Dict

Value:
{'\r': '',
 '!': ' not ',
 '!=': ' != ',
 '&&': ' and ',
 ':': ' or ',
 '?': ' and ',
 '||': ' or '}

CPP_to_Python_Ops_Expression

Value:
re.compile(r'\|\||&&|!=|!|\r|:|\?')

CPP_to_Python_Eval_List

Value:
[[re.compile(r'defined\s+(\w+)'), '"\\1" in __dict__'],
 [re.compile(r'defined\s*\((\w+)\)'), '"\\1" in __dict__'],
 [re.compile(r'/\*.*\*/'), ''],
 [re.compile(r'/\*.*'), ''],
 [re.compile(r'//.*'), ''],
 [re.compile(r'(0x[0-9A-Fa-f]*)[UL]+'), '\\1']]