Class PHPParser

Description

Parser for PHP files

  • version: $Revision: 14665 $
  • author: Nimish Pachapurkar (npac@spikesource.com)

Located in /parser/PHPParser.php (line 24)

Parser
   |
   --PHPParser
Variable Summary
mixed $contTypes
Method Summary
mixed getLastTokenType (&$tokens &$tokens)
Line getLineType ()
Token getTokenType ($token $token)
Boolean isContinuation (&$token &$token)
void processLine ($line $line)
Variables
mixed $contTypes = array("(", ",", ".", "=",
T_LOGICAL_XOR,
T_LOGICAL_AND,
T_LOGICAL_OR,
T_PLUS_EQUAL,
T_MINUS_EQUAL,
T_MUL_EQUAL,
T_DIV_EQUAL,
T_CONCAT_EQUAL,
T_MOD_EQUAL,
T_AND_EQUAL,
T_OR_EQUAL,
T_XOR_EQUAL,
T_BOOLEAN_AND,
T_BOOLEAN_OR,
T_OBJECT_OPERATOR,
T_DOUBLE_ARROW,
"[",
"]",
T_LOGICAL_OR,
T_LOGICAL_XOR,
T_LOGICAL_AND)
(line 36)
  • static:
  • access: public

Inherited Variables

Inherited from Parser

Parser::$coveredLines
Parser::$filename
Parser::$fileRef
Parser::$line
Parser::$totalLines
Parser::$uncoveredLines
Methods
getLastTokenType (line 370)

Return the type of last non-empty token in a line

  • return: Last non-empty token type (or token) if exists; false otherwise
  • access: protected
mixed getLastTokenType (&$tokens &$tokens)
  • &$tokens &$tokens: Array of tokens for a line
getLineType (line 281)

Returns the type of line just read

  • return: type
  • access: public
Line getLineType ()

Redefinition of:
Parser::getLineType()
Returns the type of last line read.
getTokenType (line 351)

Get the token type of a token (if exists) or the token itself.

  • return: type or token itself
  • access: protected
Token getTokenType ($token $token)
  • $token $token: Token
isContinuation (line 294)

Check if a line is a continuation of the previous line

  • return: True if the line is a continuation; false otherwise
  • access: protected
Boolean isContinuation (&$token &$token)
  • &$token &$token: Second token in a line (after PHP start)
processLine (line 72)

Process a line read from the file and determine if it is an executable line or not.

This is the work horse function that does most of the parsing. To parse PHP, get_all_tokens() tokenizer function is used.

  • access: protected
void processLine ($line $line)
  • $line $line: Line to be parsed.

Redefinition of:
Parser::processLine()
Process the line and classify it into either covered and uncovered.

Inherited Methods

Inherited From Parser

Parser::__construct()
Parser::getCoveredLines()
Parser::getLine()
Parser::getLineType()
Parser::getLineTypeStr()
Parser::getTotalLines()
Parser::getUncoveredLines()
Parser::openFileReadOnly()
Parser::parse()
Parser::processLine()

Documentation generated on Mon, 20 Jun 2005 13:11:05 -0700 by phpDocumentor 1.3.0RC3