Class Base
Base class to implement a source code generator.
Direct known subclasses
Peg\Lib\Generator\ZendPHP
public
|
#
__construct( string $templates, string $output, string $generator_name,
The symbols object with all definitions required to generate the code. |
public
string
|
|
public
|
#
GetHeaderDefine( string $name )
Converts a header file name into a suitable flag for the compiler pre-processor. Eg: header.h -> PHP_HEADER_H this can be used for #ifndef checks on the generated code to prevent double inclusions. |
public
|
#
GetHeaderNamePHP( string $name )
Converts a header filename into one that doesn't conflicts with original which can be used to store the generated code. Eg: header.h -> php_header.h or lib/header.h -> php_lib_header.h |
public
|
#
GetSourceNamePHP( string $name )
Converts a header filename into a source file name which can be used to store the generated code. Eg: header.h -> php_header.cpp or lib/header.h -> php_lib_header.cpp |
public
|
#
GetCustomSources( )
Gets a list of custom source files on the custom_sources directory that resides in the templates/$generator_name directory with the .php extension stripped out. |
public
string
|
#
GetTemplatePath( string $name, string $type, string $subtype, string $dir, string $overrides_prefix = "", string $namespace = "" )
Get a php template file path based on the given parameters. |
public
string
|
#
GetGenericTemplate( string $name, string $subdir = "" )
Get a php template file for a given file name. |
public
string
|
#
GetParameterTemplate(
Retrieve the template path for parameters, also checks if a valid override exists and returns that instead. |
public
string
|
#
GetReturnTemplate(
Retrieve the template path for return, also checks if a valid override exists and returns that instead. |
public
|
#
RemoveHeader( string $header_name )
Deletes a generated header declarations file and its source file |
public
|
|
public
|
|
public
|
#
AddGenericFile( string $file_name, string & $content, string $subdir = "" )
Adds or updates a generic file if neccessary. |
abstract public
|
|
abstract public
string
|
|
abstract public
string
|
|
abstract public
string
|
#
GenerateFunction(
Generate the wrapping code of a specific C/C++ function. |
public
|
$symbols | |
#
Reference to the symbols object with all definitions required to generate the code. |
public
string
|
$templates_path | |
#
Path where template files reside. |
public
string
|
$output_path | |
#
Path where the generated source code is going to be saved. |
public
string
|
$generator_name | |
#
Name of the generator implementing this base class. Useful to determine the directory where generated source code is going to be stored. |