src/POData/UriProcessor/QueryProcessor/ExpressionParser/ExpressionLexer.php
/**
     * Handles the literals that are prefixed by types.
     * This method modified the token field as necessary.
     * 
     * @return void 
     * 
     * @throws ODataException
     */
Handles the literals that are prefixed by types.
This method modified the token field as necessary.

@return void


Handles the literals that are prefixed by types . This method modified the token field as necessary . @return void
private function _handleTypePrefixedLiterals()
    {
        $id = $this->_token->Id;
        if ($id != ExpressionTokenId::IDENTIFIER) {
            return;
        }
        $quoteFollows = $this->_ch == '\'';
        if (!$quoteFollows) {
            return;
        }
        $tokenText = $this->_token->Text;
        if (strcasecmp('datetime', $tokenText) == 0) {
            $id = ExpressionTokenId::DATETIME_LITERAL;
        } else if (strcasecmp('guid', $tokenText) == 0) {
            $id = ExpressionTokenId::GUID_LITERAL;
        } else if (strcasecmp('binary', $tokenText) == 0 
            || strcasecmp('X', $tokenText) == 0 
            || strcasecmp('x', $tokenText) == 0
        ) {
            $id =  ExpressionTokenId::BINARY_LITERAL;
        } else {
            return;
        }
        $tokenPos = $this->_token->Position;
        do {
            $this->_nextChar();
        } while ($this->_ch != '\0' && $this->_ch != '\'');
        if ($this->_ch == '\0') {
            $this->_parseError(
                Messages::expressionLexerUnterminatedStringLiteral(
                    $this->_textPos, $this->_text
                )
            );
        }
        $this->_nextChar();
        $this->_token->Id = $id;
        $this->_token->Text 
            = substr($this->_text, $tokenPos, $this->_textPos - $tokenPos);
    }
private function _handleTypePrefixedLiterals ( ) { $ id = $ this -> _token -> Id ; if ( $ id != ExpressionTokenId :: IDENTIFIER ) { return ; } $ quoteFollows = $ this -> _ch == '\'' ; if ( ! $ quoteFollows ) { return ; } $ tokenText = $ this -> _token -> Text ; if ( strcasecmp ( 'datetime' , $ tokenText ) == 0 ) { $ id = ExpressionTokenId :: DATETIME_LITERAL ; } else if ( strcasecmp ( 'guid' , $ tokenText ) == 0 ) { $ id = ExpressionTokenId :: GUID_LITERAL ; } else if ( strcasecmp ( 'binary' , $ tokenText ) == 0 || strcasecmp ( 'X' , $ tokenText ) == 0 || strcasecmp ( 'x' , $ tokenText ) == 0 ) { $ id = ExpressionTokenId :: BINARY_LITERAL ; } else { return ; } $ tokenPos = $ this -> _token -> Position ; do { $ this -> _nextChar ( ) ; } while ( $ this -> _ch != '\0' && $ this -> _ch != '\'' ) ; if ( $ this -> _ch == '\0' ) { $ this -> _parseError ( Messages :: expressionLexerUnterminatedStringLiteral ( $ this -> _textPos , $ this -> _text ) ) ; } $ this -> _nextChar ( ) ; $ this -> _token -> Id = $ id ; $ this -> _token -> Text = substr ( $ this -> _text , $ tokenPos , $ this -> _textPos - $ tokenPos ) ; }
Handles the literals that are prefixed by types.
Handles the literals that are prefixed by types .