Method CompilerEnvironment()->PikeCompiler()->create()
- Method create
CompilerEnvironment.PikeCompiler CompilerEnvironment.PikeCompiler(string|voidsource,CompilationHandler|voidhandler,int|voidmajor,int|voidminor,program|voidtarget,object|voidplaceholder)- Description
Create a PikeCompiler object for a source string.
This function takes a piece of Pike code as a string and initializes a compiler object accordingly.
- Parameter
source Source code to compile.
- Parameter
handler The optional argument
handleris used to specify an alternative error handler. If it is not specified the current master object at compile time will be used.- Parameter
major - Parameter
minor The optional arguments
majorandminorare used to tell the compiler to attempt to be compatible with Pikemajor.minor.- Parameter
target __empty_program() program to fill in. The virgin program returned by __empty_program() will be modified and returned by compile() on success.
- Parameter
placeholder __null_program() placeholder object to fill in. The object will be modified into an instance of the resulting program on successfull compile. Note that lfun::create() in the program will be called without any arguments.
- Note
Note that
sourcemust contain the complete source for a program. It is not possible to compile a single expression or statement.Also note that no preprocessing is performed. To preprocess the program you can use compile_string() or call the preprocessor manually by calling cpp().
- Note
Note that all references to
targetandplaceholdershould removed if compile() failes. On failure theplaceholderobject will be destructed.- See also
compile_string(), compile_file(), cpp(), master(), CompilationHandler