SS_ConfigStaticManifest_Parser
class SS_ConfigStaticManifest_Parser (View source)
A parser that processes a PHP file, using PHP's built in parser to get a string of tokens, then processing them to find the static class variables, their access levels & values
We can't do this using TokenisedRegularExpression because we need to keep track of state as we process the token list (when we enter and leave a namespace or class, when we see an access level keyword, etc)
Properties
protected | $info | |||
protected | $statics | |||
protected | $path | |||
protected | $tokens | |||
protected | $length | |||
protected | $pos |
Methods
Get the next token to process, incrementing the pointer
Get the previous token processed. Does not decrement the pointer
Get the next set of tokens that form a string to process, incrementing the pointer
Parse the given file to find the static variables declared in it, along with their access & values
During parsing we've found a "static" keyword. Parse out the variable names and value assignments that follow.
Details
__construct($path)
No description
getInfo()
No description
getStatics()
No description
protected null
next(bool $ignoreWhitespace = true)
Get the next token to process, incrementing the pointer
protected null
lastToken(bool $ignoreWhitespace = true)
Get the previous token processed. Does not decrement the pointer
protected null|string
nextString(bool $ignoreWhitespace = true)
Get the next set of tokens that form a string to process, incrementing the pointer
parse()
Parse the given file to find the static variables declared in it, along with their access & values
parseStatic($access, $class)
During parsing we've found a "static" keyword. Parse out the variable names and value assignments that follow.
Seperated out from parse partially so that we can recurse if there are multiple statics being declared in a comma seperated list