Moodle  2.2.1
http://www.collinsharper.com
PHPParser Class Reference
Inheritance diagram for PHPParser:
Collaboration diagram for PHPParser:

Public Member Functions

 getLineType ()

Static Public Attributes

static $contTypes

Protected Member Functions

 openFileReadOnly ()
 getNextToken ($line, &$pos)
 isMultiLineCont ()
 processLine ($line)
 isContinuation (&$token)
 getTokenType ($token)

Detailed Description

Definition at line 24 of file PHPParser.php.


Member Function Documentation

Returns the type of line just read

Returns:
Line type public

Reimplemented from Parser.

Definition at line 385 of file PHPParser.php.

getNextToken ( line,
&$  pos 
) [protected]

Gets the next token.

The same token can be returned several times for multi-line tokens.

Parameters:
$lineThe current line read from the file.
&$posThe position of the next token string in the line.
Returns:
the next token or null at the end of the line. protected

Definition at line 98 of file PHPParser.php.

Here is the caller graph for this function:

getTokenType ( token) [protected]

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

Parameters:
$tokenToken
Returns:
Token type or token itself protected

Definition at line 455 of file PHPParser.php.

Here is the caller graph for this function:

isContinuation ( &$  token) [protected]

Check if a line is a continuation of the previous line

Parameters:
&$tokenSecond token in a line (after PHP start)
Returns:
Boolean True if the line is a continuation; false otherwise protected

Definition at line 398 of file PHPParser.php.

Here is the caller graph for this function:

isMultiLineCont ( ) [protected]

Determines if the beginning of current line is a continuation of an executable multi-line token.

Called at the first token of a line.

Returns:
Boolean true if it is a continuation line protected

Definition at line 166 of file PHPParser.php.

Here is the call graph for this function:

Here is the caller graph for this function:

openFileReadOnly ( ) [protected]

Opens the file to be parsed in Read-only mode. Overriden to tokenize the whole file.

Returns:
FALSE on failure. protected

Reimplemented from Parser.

Definition at line 79 of file PHPParser.php.

processLine ( line) [protected]

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.

Parameters:
$lineLine to be parsed. protected

Reimplemented from Parser.

Definition at line 192 of file PHPParser.php.

Here is the call graph for this function:


Field Documentation

$contTypes [static]
Initial value:
 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,
            T_STRING
        )

Definition at line 40 of file PHPParser.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations