Pelzini

This is the code documentation for the Pelzini project

Page options:

Inherited members

class Analyser

Generic language analyser. Analysers are used to tranform the language-specific tokens into a set of ParserItems

Authors

Variables

NameVisibilityDescription
$pos 
$token_pos 
$tokens 

Functions

NameVisibilityDescription
findTokenBackwardsprotectedFinds a token looking backwards from the current position.
findTokenForwardsprotectedFinds a token looking forward from the current position.
getPosprotectedReturns the current position
getTokenprotectedReturns a token at a specific position
getTokenPosprotectedGets the position of the last token found using one of the search functions
movePosBackwardprotectedMoves the internal token pointer backwards
movePosForwardprotectedMoves the internal token pointer forwards
processpublicProcesses a set of token and populates a ParserFile
resetStatepublicResets the analyser ready for more parsing work
setPosprotectedSets the current position
setTokensprotectedTells the analyser what tokens it should use

protected findTokenBackwards

Token $Analyser->findTokenBackwards ( mixed $token_types [, mixed $stop_list ] );

Finds a token looking backwards from the current position.
Searching starts before the current token.
The token must be of the type specified

protected findTokenForwards

Token $Analyser->findTokenForwards ( mixed $token_types [, mixed $stop_list ] );

Finds a token looking forward from the current position.
Searching starts after the current token.
The token must be of the type specified

protected getPos

unknown $Analyser->getPos ( );

Returns the current position

protected getToken

unknown $Analyser->getToken ( [ mixed $pos ] );

Returns a token at a specific position
If no position is specified, uses the current position

protected getTokenPos

unknown $Analyser->getTokenPos ( );

Gets the position of the last token found using one of the search functions

protected movePosBackward

void $Analyser->movePosBackward ( [ integer $num ] );

Moves the internal token pointer backwards

protected movePosForward

void $Analyser->movePosForward ( [ integer $num ] );

Moves the internal token pointer forwards

public process

void $Analyser->process ( mixed $tokens , mixed $parser_file );

Processes a set of token and populates a ParserFile

public resetState

void $Analyser->resetState ( );

Resets the analyser ready for more parsing work

protected setPos

void $Analyser->setPos ( mixed $pos );

Sets the current position

protected setTokens

void $Analyser->setTokens ( mixed $tokens );

Tells the analyser what tokens it should use