PhpWriter
class PhpWriter extends Object
PHP code generator helpers.
Methods
Expands %node.word, %node.array, %node.args, %escape(), %modify(), %var, %raw, %word in code.
Formats modifiers calling.
Formats macro arguments to PHP code. (It advances tokenizer to the end as a side effect.)
Formats macro arguments to PHP array. (It advances tokenizer to the end as a side effect.)
Formats parameter to PHP string.
Preprocessor for tokens. (It advances tokenizer to the end as a side effect.)
Details
at line 34
__construct(MacroTokens $tokens, $modifiers = NULL, Compiler $compiler = NULL)
No description
at line 47
string
write($mask)
Expands %node.word, %node.array, %node.args, %escape(), %modify(), %var, %raw, %word in code.
at line 106
string
formatModifiers($var)
Formats modifiers calling.
at line 120
string
formatArgs(MacroTokens $tokens = NULL)
Formats macro arguments to PHP code. (It advances tokenizer to the end as a side effect.)
at line 132
string
formatArray(MacroTokens $tokens = NULL)
Formats macro arguments to PHP array. (It advances tokenizer to the end as a side effect.)
at line 146
string
formatWord($s)
Formats parameter to PHP string.
at line 158
MacroTokens
preprocess(MacroTokens $tokens = NULL)
Preprocessor for tokens. (It advances tokenizer to the end as a side effect.)
at line 172
MacroTokens
removeCommentsFilter(MacroTokens $tokens)
Removes PHP comments.
at line 188
MacroTokens
shortTernaryFilter(MacroTokens $tokens)
Simplified ternary expressions without third part.
at line 217
MacroTokens
shortArraysFilter(MacroTokens $tokens)
Simplified array syntax [...]
at line 244
MacroTokens
expandFilter(MacroTokens $tokens)
Pseudocast (expand).
at line 271
MacroTokens
quoteFilter(MacroTokens $tokens)
Quotes symbols to strings.
at line 293
MacroTokens
modifiersFilter(MacroTokens $tokens, $var)
Formats modifiers calling.
at line 341
MacroTokens
escapeFilter(MacroTokens $tokens)
Escapes expression in tokens.