PT_ParserImplements interfaces:
Smart iterator for tokens obtained parsed code.
Located in /pt-parser.php (line 43)
Array[String]Int
$braceBlock
= array() (line 95)
Braces counter for the block function.
Array[String]Bool
$inBlock
= array() (line 89)
State for the block function.
Array
$mods
= array() (line 61)
Possible modifiers for upcoming tokens.
Int
$mod_distance
= 0 (line 67)
Distance since the modifier was captured.
Mixed
$mod_list
= array( Tokens of modifiers to be captured.
Int
$position
(line 55)
Current Position
Array()
$tokens
(line 49)
Token list
Constructor __construct (line 104)
Constructor -- tokenizes code.
Function required for the Iterator interface.
block (line 241)
Returns true while till the _upcoming_ pair of braces is matched.
Useful for parsing blocks encapsulated using { }: for example, to parse a function definition. Should only be used from the _same place_ in a single file: identifying which block must be managed is done on the basis of uniqueness of the line number and the file name.
Can also be passed an id to over-ride the auto generated id when the 1st stack frame from `debug_backtrace` doesn't prove sufficient for identifing the final caller: for example from a constructor of another class.
current (line 150)
Returns a PT_Parser_Token instance or NULL in case the iterator has overshot.
Function required for the Iterator interface.
each (line 200)
Run on all tokens internally. Useful in derived classes.
key (line 137)
Returns the current key val.
Function required for the Iterator interface.
line (line 207)
Returns the line of the current token.
modifiers (line 179)
Saves modifiers for future tokens.
Saves modifiers from the mod_list, resets in case they become inapplicable.
next (line 127)
Moves to the next token and runs an 'each' internal call.
Function required for the Iterator interface.
reset_modifiers (line 193)
Resets all modifiers
rewind (line 120)
Return to the start.
Function required for the Iterator interface.
skip_till (line 220)
Skip tokens till the specified token is reached.
Useful for exploratory parsing
val (line 165)
Return the current val of the token.
valid (line 113)
Checks whether the iterator can still move forward.
Function required for the Iterator interface.
Documentation generated on Thu, 29 Sep 2011 01:44:45 +0530 by phpDocumentor 1.4.3