class Compiler

Compiles a node to PHP code.

Methods

__construct(array $functions)

No description

getFunction($name)

No description

string
getSource()

Gets the current PHP code after compilation.

reset()

No description

compile(Node $node)

Compiles a node.

subcompile(Node $node)

No description

raw(string $string)

Adds a raw string to the compiled code.

string(string $value)

Adds a quoted string to the compiled code.

repr(mixed $value)

Returns a PHP representation of a given value.

Details

at line line 24
__construct(array $functions)

Parameters

array $functions

at line line 29
getFunction($name)

Parameters

$name

at line line 39
string getSource()

Gets the current PHP code after compilation.

Return Value

string The PHP code

at line line 44
reset()

at line line 58
Compiler compile(Node $node)

Compiles a node.

Parameters

Node $node The node to compile

Return Value

Compiler The current compiler instance

at line line 65
subcompile(Node $node)

Parameters

Node $node

at line line 85
Compiler raw(string $string)

Adds a raw string to the compiled code.

Parameters

string $string The string

Return Value

Compiler The current compiler instance

at line line 99
Compiler string(string $value)

Adds a quoted string to the compiled code.

Parameters

string $value The string

Return Value

Compiler The current compiler instance

at line line 113
Compiler repr(mixed $value)

Returns a PHP representation of a given value.

Parameters

mixed $value The value to convert

Return Value

Compiler The current compiler instance