Class CompilerEnvironment()->CPP
- Description
The state for an instance of the preprocessor.
The default set of supported directives and macros, etc is documented in the cpp:: scope.
Custom directives may be added by inheriting this class and adding non-private functions
string directive_XXX(CppFlags flags, string rest_of_line), or by adding the same to the directives mapping.- See also
- Variable
handler
Variable compat_handler
CompilationHandlerCompilerEnvironment.CPP.handler
CompilationHandlerCompilerEnvironment.CPP.compat_handler
- Variable
directives
mapping(string:function(int(16bit),string:string|zero))|zeroCompilerEnvironment.CPP.directives- Description
Mapping containing the set of active dynamic custom preprocessor directives.
- Note
This mapping is only consulted if a corresponding
directive_XXXsymbol is not present (or is private) inthis.
- Method
create
CompilerEnvironment.CPP CompilerEnvironment.CPP(string|voidcurrent_file,int|string|voidcharset,CompilationHandler|voidhandler,void|intcompat_major,void|intcompat_minor,void|intpicky_cpp)
CompilerEnvironment.CPP CompilerEnvironment.CPP(mapping(string:mixed)options)- Description
Initialize the preprocessor.
- Parameter
options If the first argument is a mapping, no other arguments may follow. Instead, they have to be given as members of the mapping (if wanted). The following members are then recognized:
"current_file":stringName of the current file. It is used for generating #line directives and for locating include files.
"charset":int|stringCharset to use when processing
data."handler":CompilationHandlerCompilation handler.
"compat_major":intSets the major pike version used for compat handling.
"compat_minor":intSets the minor pike version used for compat handling.
"picky_cpp":intGenerate more warnings.
"keep_comments":intThis option keeps cpp() from removing comments. Useful in combination with the prefix feature below.
"prefix":stringIf a prefix is given, only prefixed directives will be processed. For example, if the prefix is
"foo", then#foo_ifdef CONDandfoo___LINE__would be processed,#ifdef CONDand__LINE__would not.- Parameter
current_file If the current_file argument has not been specified, it will default to
"-".- Parameter
charset Turn on automatic character set detection if
1, otherwise specifies the character set used by the input. Defaults to"ISO-10646".- See also