| Home | Trees | Index | Help |
|
|---|
| Package SCons :: Module cpp :: Class PreProcessor |
|
DumbPreProcessorThe main workhorse class for handling C pre-processing.
| Method Summary | |
|---|---|
__init__(self,
current,
cpppath,
dict,
all)
| |
Pre-processes a file contents. | |
all_include(self,
t)
| |
Default handling of a #define line. | |
Default handling of a #elif line. | |
Default handling of a #else line. | |
Default handling of a #endif line. | |
Default handling of a #if line. | |
Default handling of a #ifdef line. | |
Default handling of a #ifndef line. | |
Default handling of a #import line. | |
Default handling of a #include line. | |
Default handling of a #include line. | |
Null method for when we explicitly want the action for a specific preprocessor directive to do nothing. | |
Default handling of a #undef line. | |
Evaluates a C preprocessor expression. | |
Finds the #include file for a given preprocessor tuple. | |
Resolve a tuple-ized #include line. | |
Pops the previous dispatch table off the stack and makes it the current one. | |
Pushes the current dispatch table on the stack and re-initializes the current dispatch table to the default. | |
Causes the PreProcessor object to start processing #import, #include and #include_next lines. | |
Causes the PreProcessor object to stop processing #import, #include and #include_next lines. | |
Turns the contents of a file into a list of easily-processed tuples describing the CPP lines in the file. | |
Common logic for evaluating the conditions on #if, #ifdef and #ifndef lines. | |
| Method Details |
|---|
__call__(self,
contents)
|
do_define(self, t)Default handling of a #define line. |
do_elif(self, t)Default handling of a #elif line. |
do_else(self, t)Default handling of a #else line. |
do_endif(self, t)Default handling of a #endif line. |
do_if(self, t)Default handling of a #if line. |
do_ifdef(self, t)Default handling of a #ifdef line. |
do_ifndef(self, t)Default handling of a #ifndef line. |
do_import(self, t)Default handling of a #import line. |
do_include(self, t)Default handling of a #include line. |
do_include_next(self, t)Default handling of a #include line. |
do_nothing(self, t)Null method for when we explicitly want the action for a specific preprocessor directive to do nothing. |
do_undef(self, t)Default handling of a #undef line. |
eval_expression(self, t)Evaluates a C preprocessor expression. This is done by converting it to a Python equivalent and eval()ing it in the C preprocessor namespace we use to track #define values. |
find_include_file(self, t)Finds the #include file for a given preprocessor tuple. |
resolve_include(self, t)
Resolve a tuple-ized #include line.
This handles recursive expansion of values without "" or <>
surrounding the name until an initial " or < is found, to handle
#include FILE
where FILE is a #define somewhere else.
|
restore(self)Pops the previous dispatch table off the stack and makes it the current one. |
save(self)Pushes the current dispatch table on the stack and re-initializes the current dispatch table to the default. |
start_handling_includes(self, t=None)Causes the PreProcessor object to start processing #import, #include and #include_next lines. This method will be called when a #if, #ifdef, #ifndef or #elif evaluates True, or when we reach the #else in a #if, #ifdef, #ifndef or #elif block where a condition already evaluated False. |
stop_handling_includes(self, t=None)Causes the PreProcessor object to stop processing #import, #include and #include_next lines. This method will be called when a #if, #ifdef, #ifndef or #elif evaluates False, or when we reach the #else in a #if, #ifdef, #ifndef or #elif block where a condition already evaluated True. |
tupleize(self, contents)Turns the contents of a file into a list of easily-processed tuples describing the CPP lines in the file. The first element of each tuple is the line's preprocessor directive (#if, #include, #define, etc., minus the initial '#'). The remaining elements are specific to the type of directive, as pulled apart by the regular expression. |
_do_if_else_condition(self, condition)Common logic for evaluating the conditions on #if, #ifdef and #ifndef lines. |
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.1 on Wed Dec 12 09:39:31 2007 | http://epydoc.sf.net |