ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Compiles a node to PHP code. More...
Public Member Functions | |
__construct (Twig_Environment $env) | |
getFilename () | |
getEnvironment () | |
Returns the environment instance related to this compiler. More... | |
getSource () | |
Gets the current PHP code after compilation. More... | |
compile (Twig_NodeInterface $node, $indentation=0) | |
Compiles a node. More... | |
subcompile (Twig_NodeInterface $node, $raw=true) | |
raw ($string) | |
Adds a raw string to the compiled code. More... | |
write () | |
Writes a string to the compiled code by adding indentation. More... | |
addIndentation () | |
Appends an indentation to the current PHP code after compilation. More... | |
string ($value) | |
Adds a quoted string to the compiled code. More... | |
repr ($value) | |
Returns a PHP representation of a given value. More... | |
addDebugInfo (Twig_NodeInterface $node) | |
Adds debugging information. More... | |
getDebugInfo () | |
indent ($step=1) | |
Indents the generated code. More... | |
outdent ($step=1) | |
Outdents the generated code. More... | |
getVarName () | |
Public Member Functions inherited from Twig_CompilerInterface | |
compile (Twig_NodeInterface $node) | |
Compiles a node. More... | |
Protected Attributes | |
$lastLine | |
$source | |
$indentation | |
$env | |
$debugInfo = array() | |
$sourceOffset | |
$sourceLine | |
$filename | |
Private Attributes | |
$varNameSalt = 0 | |
Compiles a node to PHP code.
Definition at line 18 of file Compiler.php.
Twig_Compiler::__construct | ( | Twig_Environment | $env | ) |
Definition at line 30 of file Compiler.php.
References $env.
Twig_Compiler::addDebugInfo | ( | Twig_NodeInterface | $node | ) |
Adds debugging information.
Definition at line 212 of file Compiler.php.
References $lastLine, $sourceLine, and write().
Referenced by Twig_Node_SetTemp\compile(), Twig_Node_Sandbox\compile(), Twig_Node_SandboxedPrint\compile(), Twig_Node_Do\compile(), Twig_Node_Flush\compile(), Twig_Node_Import\compile(), Twig_Node_BlockReference\compile(), Twig_Node_Print\compile(), Twig_Node_Expression_Name\compile(), Twig_Node_Expression_Parent\compile(), Twig_Node_Text\compile(), Twig_Node_Block\compile(), Twig_Node_Spaceless\compile(), Twig_Node_With\compile(), Twig_Node_Include\compile(), Twig_Node_If\compile(), Twig_Node_Macro\compile(), Twig_Node_For\compile(), Twig_Extensions_Node_Trans\compile(), Twig_Node_Set\compile(), Twig_Node_Expression_BlockReference\compile(), Twig_Node_Module\compileConstructor(), and Twig_Node_Module\compileDisplay().
Twig_Compiler::addIndentation | ( | ) |
Appends an indentation to the current PHP code after compilation.
Definition at line 141 of file Compiler.php.
Twig_Compiler::compile | ( | Twig_NodeInterface | $node, |
$indentation = 0 |
|||
) |
Compiles a node.
Twig_NodeInterface | $node | The node to compile |
int | $indentation | The current indentation |
Definition at line 73 of file Compiler.php.
References $indentation, and Twig_NodeInterface\compile().
Twig_Compiler::getDebugInfo | ( | ) |
Definition at line 237 of file Compiler.php.
References $debugInfo.
Referenced by Twig_Node_Module\compileDebugInfo().
Twig_Compiler::getEnvironment | ( | ) |
Returns the environment instance related to this compiler.
Definition at line 50 of file Compiler.php.
References $env.
Referenced by Twig_Node_Expression_Function\compile(), Twig_Node_Expression_Filter\compile(), Twig_Node_Expression_Test\compile(), Twig_Node_Expression_Name\compile(), Twig_Node_Module\compileClassHeader(), and Twig_Node_Module\compileGetSourceContext().
Twig_Compiler::getFilename | ( | ) |
Definition at line 38 of file Compiler.php.
References $filename.
Twig_Compiler::getSource | ( | ) |
Gets the current PHP code after compilation.
Implements Twig_CompilerInterface.
Definition at line 60 of file Compiler.php.
References $source.
Twig_Compiler::getVarName | ( | ) |
Definition at line 279 of file Compiler.php.
References GuzzleHttp\Psr7\hash().
Referenced by Twig_Node_Expression_Binary_EndsWith\compile(), Twig_Node_Expression_Binary_StartsWith\compile(), and Twig_Node_With\compile().
Twig_Compiler::indent | ( | $step = 1 | ) |
Indents the generated code.
int | $step | The number of indentation to add |
Definition at line 251 of file Compiler.php.
References $step.
Referenced by Twig_Node_Module\compileConstructor().
Twig_Compiler::outdent | ( | $step = 1 | ) |
Outdents the generated code.
int | $step | The number of indentation to remove |
LogicException | When trying to outdent too much so the indentation would become negative |
Definition at line 267 of file Compiler.php.
References $step.
Referenced by Twig_Node_If\compile(), Twig_Node_Include\compile(), Twig_Node_Macro\compile(), and Twig_Node_Module\compileConstructor().
Twig_Compiler::raw | ( | $string | ) |
Adds a raw string to the compiled code.
string | $string | The string |
Definition at line 112 of file Compiler.php.
Referenced by Twig_Node_Include\addTemplateArguments(), Twig_Node_Expression_Binary_EndsWith\compile(), Twig_Node_Expression_Binary_Matches\compile(), Twig_Node_Expression_Binary_NotIn\compile(), Twig_Node_Expression_Binary_Power\compile(), Twig_Node_Expression_Binary_Range\compile(), Twig_Node_Expression_Binary_StartsWith\compile(), Twig_Node_Expression_Binary_FloorDiv\compile(), Twig_Node_Expression_Binary_In\compile(), Twig_Node_Expression_AssignName\compile(), Twig_Node_Expression_TempName\compile(), Twig_Node_Expression_Binary\compile(), Twig_Node_Expression_Conditional\compile(), Twig_Node_Expression_Test_Sameas\compile(), Twig_Node_Expression_Unary\compile(), Twig_Node_Expression_MethodCall\compile(), Twig_Node_Expression_Test_Null\compile(), Twig_Node_Expression_Test_Divisibleby\compile(), Twig_Node_Expression_Test_Odd\compile(), Twig_Node_Expression_Test_Even\compile(), Twig_Node_Expression_GetAttr\compile(), Twig_Node_Expression_NullCoalesce\compile(), Twig_Node_Import\compile(), Twig_Node_Expression_Name\compile(), Twig_Node_Expression_Test_Constant\compile(), Twig_Node_Expression_Parent\compile(), Twig_Node_Expression_ExtensionReference\compile(), Twig_Node_Include\compile(), Twig_Node_Macro\compile(), Twig_Extensions_Node_Trans\compile(), Twig_Node_Set\compile(), Twig_Node_Expression_Array\compile(), Twig_Node_Expression_Call\compileArguments(), Twig_Node_Expression_BlockReference\compileBlockArguments(), Twig_Node_Expression_Call\compileCallable(), Twig_Node_Module\compileDisplay(), Twig_Node_Module\compileGetParent(), Twig_Node_Expression_BlockReference\compileTemplateCall(), Twig_Node_Expression_Binary_Greater\operator(), Twig_Node_Expression_Binary_NotEqual\operator(), Twig_Node_Expression_Binary_LessEqual\operator(), Twig_Node_Expression_Binary_Equal\operator(), Twig_Node_Expression_Binary_GreaterEqual\operator(), Twig_Node_Expression_Binary_Less\operator(), Twig_Node_Expression_Binary_And\operator(), Twig_Node_Expression_Binary_Mod\operator(), Twig_Node_Expression_Unary_Pos\operator(), Twig_Node_Expression_Binary_BitwiseOr\operator(), Twig_Node_Expression_Binary_BitwiseXor\operator(), Twig_Node_Expression_Binary_Concat\operator(), Twig_Node_Expression_Unary_Not\operator(), Twig_Node_Expression_Unary_Neg\operator(), Twig_Node_Expression_Binary_Or\operator(), Twig_Node_Expression_Binary_BitwiseAnd\operator(), Twig_Node_Expression_Binary_Add\operator(), Twig_Node_Expression_Binary_Sub\operator(), Twig_Node_Expression_Binary_Mul\operator(), Twig_Node_Expression_Binary_Div\operator(), Twig_Node_Expression_Binary_FloorDiv\operator(), Twig_Node_Expression_Binary_Matches\operator(), Twig_Node_Expression_Binary_In\operator(), Twig_Node_Expression_Binary_NotIn\operator(), Twig_Node_Expression_Binary_Range\operator(), Twig_Node_Expression_Binary_StartsWith\operator(), Twig_Node_Expression_Binary_EndsWith\operator(), Twig_Node_Expression_Binary_Power\operator(), and repr().
Twig_Compiler::repr | ( | $value | ) |
Returns a PHP representation of a given value.
mixed | $value | The value to convert |
Definition at line 171 of file Compiler.php.
References $key, raw(), and string().
Referenced by Twig_Node_Expression_Constant\compile(), and Twig_Node_Expression_Name\compile().
Twig_Compiler::string | ( | $value | ) |
Adds a quoted string to the compiled code.
string | $value | The string |
Definition at line 157 of file Compiler.php.
Referenced by Twig_Extensions_Node_Trans\compile(), Twig_Node_Expression_Call\compileArguments(), and repr().
Twig_Compiler::subcompile | ( | Twig_NodeInterface | $node, |
$raw = true |
|||
) |
Definition at line 94 of file Compiler.php.
References Twig_NodeInterface\compile().
Referenced by Twig_Node_Include\addTemplateArguments(), Twig_Node_Expression_Unary\compile(), Twig_Node_Expression_MethodCall\compile(), Twig_Node_Expression_GetAttr\compile(), Twig_Node_Block\compile(), Twig_Node_Expression_Test_Constant\compile(), Twig_Node_With\compile(), Twig_Node_If\compile(), Twig_Node_AutoEscape\compile(), Twig_Node_Set\compile(), Twig_Node_Expression_Filter_Default\compile(), Twig_Node_Expression_Test_Defined\compile(), Twig_Node_Expression_Array\compile(), Twig_Node_Module\compile(), Twig_Node_Expression_Call\compileArguments(), Twig_Node_Module\compileClassFooter(), Twig_Node_Module\compileDisplay(), Twig_Node_Module\compileGetParent(), Twig_Node_Module\compileMacros(), and Twig_Node_Module\compileTemplate().
Twig_Compiler::write | ( | ) |
Writes a string to the compiled code by adding indentation.
Definition at line 124 of file Compiler.php.
Referenced by addDebugInfo(), Twig_Node_Embed\addGetTemplate(), Twig_Node_Include\addGetTemplate(), Twig_Node_ForLoop\compile(), Twig_Profiler_Node_EnterProfile\compile(), Twig_Profiler_Node_LeaveProfile\compile(), Twig_Node_With\compile(), Twig_Node_If\compile(), Twig_Node_Include\compile(), Twig_Node_CheckSecurity\compile(), Twig_Node_Macro\compile(), Twig_Node_For\compile(), Twig_Extensions_Node_Trans\compile(), Twig_Node_Set\compile(), Twig_Node_Module\compileClassHeader(), Twig_Node_Module\compileConstructor(), Twig_Node_Module\compileDebugInfo(), Twig_Node_Module\compileDisplay(), Twig_Node_Module\compileGetParent(), Twig_Node_Module\compileGetSource(), Twig_Node_Module\compileGetSourceContext(), Twig_Node_Module\compileGetTemplateName(), Twig_Node_Module\compileIsTraitable(), Twig_Node_Module\compileLoadTemplate(), Twig_Node_Module\compileTemplate(), and Twig_Node_Expression_BlockReference\compileTemplateCall().
|
protected |
Definition at line 24 of file Compiler.php.
Referenced by getDebugInfo().
|
protected |
Definition at line 23 of file Compiler.php.
Referenced by __construct(), and getEnvironment().
|
protected |
Definition at line 27 of file Compiler.php.
Referenced by getFilename().
|
protected |
Definition at line 22 of file Compiler.php.
Referenced by compile().
|
protected |
Definition at line 20 of file Compiler.php.
Referenced by addDebugInfo().
|
protected |
Definition at line 21 of file Compiler.php.
Referenced by getSource().
|
protected |
Definition at line 26 of file Compiler.php.
Referenced by addDebugInfo().
|
protected |
Definition at line 25 of file Compiler.php.
|
private |
Definition at line 28 of file Compiler.php.