Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes

OqlParser Class Reference
[Object Query Language based on Criteria]

Inheritance diagram for OqlParser:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 parse ($string=null)
 getTokenizer ()
 setTokenizer (OqlTokenizer $tokenizer)

Public Attributes

const INITIAL_STATE = 254
const FINAL_STATE = 255
const PREFIX_UNARY_EXPRESSION = 1
const POSTFIX_UNARY_EXPRESSION = 2
const BINARY_EXPRESSION = 3
const BETWEEN_EXPRESSION = 4
const LOGIC_PRIORITY_OR = 1
const LOGIC_PRIORITY_AND = 2
const LOGIC_PRIORITY_LT_GT = 3
const LOGIC_PRIORITY_EQ = 4
const LOGIC_PRIORITY_TERMINAL = 5
const LOGIC_PRIORITY_LOWEST = self::LOGIC_PRIORITY_OR
const LOGIC_PRIORITY_UNARY_NOT = self::LOGIC_PRIORITY_LT_GT
const ARITHMETIC_PRIORITY_ADD = 1
const ARITHMETIC_PRIORITY_MUL = 2
const ARITHMETIC_PRIORITY_TERMINAL = 3
const ARITHMETIC_PRIORITY_LOWEST = self::ARITHMETIC_PRIORITY_ADD

Protected Member Functions

 makeOqlObject ()
 handleState ()
 getTokenValue ($token, $raw=false)
 checkToken ($token, $type, $value=null)
 checkKeyword ($token, $value)
 checkIdentifier ($token)
 checkConstant ($token)
 checkUnaryMinus ($token)
 checkParentheses ($message=null)
 openParentheses ($required, $message=null)
 closeParentheses ($required, $message=null)
 getIdentifierExpression ()
 getConstantExpression ()
 getLogicExpression ($priority=self::LOGIC_PRIORITY_LOWEST)
 getArithmeticExpression ($priority=self::ARITHMETIC_PRIORITY_LOWEST)
 getCommaSeparatedList ($callback, $message)
 makeQueryExpression ($className)
 makeQuerySignedExpression ($argument, $isUnaryMinus)
 makeQueryParameter ($argument)
 error ($message, $extraMessage=null)

Protected Attributes

 $state = null
 $tokenizer = null
 $oqlObject = null
 $parentheses = null

Private Member Functions

 isArithmeticExpression ()
 getArithmeticArgumentExpression ()

Static Private Attributes

static $classMap
static $binaryOperatorMap
static $logicPriorityMap
static $arithmeticPriorityMap

Detailed Description

Definition at line 15 of file OqlParser.class.php.


Member Function Documentation

OqlParser::checkConstant ( token  )  [protected]
OqlParser::checkIdentifier ( token  )  [protected]
OqlParser::checkKeyword ( token,
value 
) [protected]
OqlParser::checkParentheses ( message = null  )  [protected]
Exceptions:
SyntaxErrorException 

Definition at line 219 of file OqlParser.class.php.

References closeParentheses(), error(), and openParentheses().

Referenced by parse().

Here is the call graph for this function:

OqlParser::checkToken ( token,
type,
value = null 
) [protected]
OqlParser::checkUnaryMinus ( token  )  [protected]

Definition at line 211 of file OqlParser.class.php.

References OqlToken::ARITHMETIC_OPERATOR, and checkToken().

Referenced by getArithmeticExpression(), getConstantExpression(), getIdentifierExpression(), and isArithmeticExpression().

Here is the call graph for this function:

OqlParser::closeParentheses ( required,
message = null 
) [protected]
Exceptions:
SyntaxErrorException 

Definition at line 257 of file OqlParser.class.php.

References checkToken(), error(), and OqlToken::PARENTHESES.

Referenced by checkParentheses(), OqlSelectPropertiesParser::getArgumentExpression(), getArithmeticExpression(), and getLogicExpression().

Here is the call graph for this function:

OqlParser::error ( message,
extraMessage = null 
) [protected]
OqlParser::getArithmeticArgumentExpression (  )  [private]
Returns:
OqlQueryParameter

Definition at line 781 of file OqlParser.class.php.

References checkIdentifier(), checkToken(), makeQueryParameter(), OqlToken::NUMBER, and OqlToken::SUBSTITUTION.

Referenced by getArithmeticExpression(), and isArithmeticExpression().

Here is the call graph for this function:

OqlParser::getArithmeticExpression ( priority = self::ARITHMETIC_PRIORITY_LOWEST  )  [protected]
OqlParser::getCommaSeparatedList ( callback,
message 
) [protected]
OqlParser::getConstantExpression (  )  [protected]
Returns:
OqlQueryParameter

Definition at line 298 of file OqlParser.class.php.

References OqlToken::BOOLEAN, checkUnaryMinus(), makeQuerySignedExpression(), OqlToken::NULL, OqlToken::NUMBER, OqlToken::STRING, and OqlToken::SUBSTITUTION.

Referenced by getLogicExpression().

Here is the call graph for this function:

OqlParser::getIdentifierExpression (  )  [protected]
Returns:
OqlQueryParameter

Definition at line 279 of file OqlParser.class.php.

References checkIdentifier(), checkUnaryMinus(), and makeQuerySignedExpression().

Referenced by getLogicExpression().

Here is the call graph for this function:

OqlParser::getLogicExpression ( priority = self::LOGIC_PRIORITY_LOWEST  )  [protected]
OqlParser::getTokenizer (  ) 
Returns:
OqlTokenizer

Definition at line 127 of file OqlParser.class.php.

OqlParser::getTokenValue ( token,
raw = false 
) [protected]
OqlParser::handleState (  )  [abstract, protected]
OqlParser::isArithmeticExpression (  )  [private]

Definition at line 754 of file OqlParser.class.php.

References OqlToken::ARITHMETIC_OPERATOR, checkToken(), checkUnaryMinus(), getArithmeticArgumentExpression(), and OqlToken::PARENTHESES.

Referenced by getLogicExpression().

Here is the call graph for this function:

OqlParser::makeOqlObject (  )  [abstract, protected]
OqlParser::makeQueryExpression ( className  )  [protected]
OqlParser::makeQueryParameter ( argument  )  [protected]
OqlParser::makeQuerySignedExpression ( argument,
isUnaryMinus 
) [protected]
Returns:
OqlQueryParameter

Definition at line 711 of file OqlParser.class.php.

References makeQueryParameter().

Referenced by getArithmeticExpression(), getConstantExpression(), and getIdentifierExpression().

Here is the call graph for this function:

OqlParser::openParentheses ( required,
message = null 
) [protected]
Exceptions:
SyntaxErrorException 

Definition at line 237 of file OqlParser.class.php.

References checkToken(), error(), and OqlToken::PARENTHESES.

Referenced by checkParentheses(), OqlSelectPropertiesParser::getArgumentExpression(), getArithmeticExpression(), and getLogicExpression().

Here is the call graph for this function:

OqlParser::parse ( string = null  ) 
OqlParser::setTokenizer ( OqlTokenizer tokenizer  ) 

Member Data Documentation

OqlParser::$arithmeticPriorityMap [static, private]
Initial value:
 array(
            self::ARITHMETIC_PRIORITY_ADD       => array('+', '-'),
            self::ARITHMETIC_PRIORITY_MUL       => array('*', '/'),
            self::ARITHMETIC_PRIORITY_TERMINAL  => null
        )

Definition at line 80 of file OqlParser.class.php.

OqlParser::$binaryOperatorMap [static, private]
OqlParser::$classMap [static, private]
Initial value:
 array(
            self::PREFIX_UNARY_EXPRESSION   => 'PrefixUnaryExpression',
            self::POSTFIX_UNARY_EXPRESSION  => 'PostfixUnaryExpression',
            self::BINARY_EXPRESSION         => 'BinaryExpression',
            self::BETWEEN_EXPRESSION        => 'LogicalBetween'
        )

Reimplemented in OqlSelectPropertiesParser.

Definition at line 26 of file OqlParser.class.php.

OqlParser::$logicPriorityMap [static, private]
Initial value:
 array(
            self::LOGIC_PRIORITY_OR         => 'or',
            self::LOGIC_PRIORITY_AND        => 'and',
            self::LOGIC_PRIORITY_LT_GT      => array('>', '<', '>=', '<='),
            self::LOGIC_PRIORITY_EQ         => array('=', '!='),
            self::LOGIC_PRIORITY_TERMINAL   => null
        )

Definition at line 65 of file OqlParser.class.php.

OqlParser::$oqlObject = null [protected]

Definition at line 88 of file OqlParser.class.php.

OqlParser::$parentheses = null [protected]

Definition at line 90 of file OqlParser.class.php.

OqlParser::$state = null [protected]

Definition at line 86 of file OqlParser.class.php.

OqlParser::$tokenizer = null [protected]

Definition at line 87 of file OqlParser.class.php.

Definition at line 74 of file OqlParser.class.php.

const OqlParser::ARITHMETIC_PRIORITY_LOWEST = self::ARITHMETIC_PRIORITY_ADD

Definition at line 78 of file OqlParser.class.php.

Definition at line 75 of file OqlParser.class.php.

Definition at line 76 of file OqlParser.class.php.

Definition at line 24 of file OqlParser.class.php.

Definition at line 23 of file OqlParser.class.php.

Definition at line 18 of file OqlParser.class.php.

Definition at line 17 of file OqlParser.class.php.

Definition at line 57 of file OqlParser.class.php.

Definition at line 59 of file OqlParser.class.php.

const OqlParser::LOGIC_PRIORITY_LOWEST = self::LOGIC_PRIORITY_OR

Definition at line 62 of file OqlParser.class.php.

Definition at line 58 of file OqlParser.class.php.

Definition at line 56 of file OqlParser.class.php.

Definition at line 60 of file OqlParser.class.php.

const OqlParser::LOGIC_PRIORITY_UNARY_NOT = self::LOGIC_PRIORITY_LT_GT

Definition at line 63 of file OqlParser.class.php.

Definition at line 22 of file OqlParser.class.php.

Definition at line 21 of file OqlParser.class.php.


The documentation for this class was generated from the following file: