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 32
__construct(MacroTokens $tokens, $modifiers = NULL, Compiler $compiler = NULL)
No description
at line 45
string
write($mask)
Expands %node.word, %node.array, %node.args, %escape(), %modify(), %var, %raw, %word in code.
at line 104
string
formatModifiers($var)
Formats modifiers calling.
at line 118
string
formatArgs(MacroTokens $tokens = NULL)
Formats macro arguments to PHP code. (It advances tokenizer to the end as a side effect.)
at line 130
string
formatArray(MacroTokens $tokens = NULL)
Formats macro arguments to PHP array. (It advances tokenizer to the end as a side effect.)
at line 144
string
formatWord($s)
Formats parameter to PHP string.
at line 156
MacroTokens
preprocess(MacroTokens $tokens = NULL)
Preprocessor for tokens. (It advances tokenizer to the end as a side effect.)
at line 170
MacroTokens
removeCommentsFilter(MacroTokens $tokens)
Removes PHP comments.
at line 186
MacroTokens
shortTernaryFilter(MacroTokens $tokens)
Simplified ternary expressions without third part.
at line 215
MacroTokens
shortArraysFilter(MacroTokens $tokens)
Simplified array syntax [...]
at line 242
MacroTokens
expandFilter(MacroTokens $tokens)
Pseudocast (expand).
at line 269
MacroTokens
quoteFilter(MacroTokens $tokens)
Quotes symbols to strings.
at line 291
MacroTokens
modifiersFilter(MacroTokens $tokens, $var)
Formats modifiers calling.
at line 339
MacroTokens
escapeFilter(MacroTokens $tokens)
Escapes expression in tokens.