src/POData/UriProcessor/QueryProcessor/ExpressionParser/ExpressionLexer.php
/**
     * Parses a token that starts with a digit
     * 
     * @return ExpressionTokenId The kind of token recognized.
     */
Parses a token that starts with a digit

@return ExpressionTokenId The kind of token recognized.
Parses a token that starts with a digit @return ExpressionTokenId The kind of token recognized .
private function _parseFromDigit()
    {        
        $result = null;
        $startChar = $this->_ch;
        $this->_nextChar();
        if ($startChar == '0' && $this->_ch == 'x' || $this->_ch == 'X') {
            $result = ExpressionTokenId::BINARY_LITERAL;
            do {
                $this->_nextChar();
            } while (ctype_xdigit($this->_ch));
        } else {
            $result = ExpressionTokenId::INTEGER_LITERAL;
            while (Char::isDigit($this->_ch)) {
                $this->_nextChar();
            }
            if ($this->_ch == '.') {
                $result = ExpressionTokenId::DOUBLE_LITERAL;
                $this->_nextChar();
                $this->_validateDigit();
                do {
                    $this->_nextChar();
                } while (Char::isDigit($this->_ch));
            }
            if ($this->_ch == 'E' || $this->_ch == 'e') {
                $result = ExpressionTokenId::DOUBLE_LITERAL;
                $this->_nextChar();
                if ($this->_ch == '+' || $this->_ch == '-') {
                    $this->_nextChar();
                }
                $this->_validateDigit();
                do {
                    $this->_nextChar();
                } while (Char::isDigit($this->_ch));
            }
            if ($this->_ch == 'M' || $this->_ch == 'm') {
                $result = ExpressionTokenId::DECIMAL_LITERAL;
                $this->_nextChar();
            } else if ($this->_ch == 'd' || $this->_ch == 'D') {
                $result = ExpressionTokenId::DOUBLE_LITERAL;
                $this->_nextChar();
            } else if ($this->_ch == 'L' || $this->_ch == 'l') {
                $result = ExpressionTokenId::INT64_LITERAL;
                $this->_nextChar();
            } else if ($this->_ch == 'f' || $this->_ch == 'F') {
                $result = ExpressionTokenId::SINGLE_LITERAL;
                $this->_nextChar();
            }
        }
        return $result;
    }
private function _parseFromDigit ( ) { $ result = null ; $ startChar = $ this -> _ch ; $ this -> _nextChar ( ) ; if ( $ startChar == '0' && $ this -> _ch == 'x' || $ this -> _ch == 'X' ) { $ result = ExpressionTokenId :: BINARY_LITERAL ; do { $ this -> _nextChar ( ) ; } while ( ctype_xdigit ( $ this -> _ch ) ) ; } else { $ result = ExpressionTokenId :: INTEGER_LITERAL ; while ( Char :: isDigit ( $ this -> _ch ) ) { $ this -> _nextChar ( ) ; } if ( $ this -> _ch == '.' ) { $ result = ExpressionTokenId :: DOUBLE_LITERAL ; $ this -> _nextChar ( ) ; $ this -> _validateDigit ( ) ; do { $ this -> _nextChar ( ) ; } while ( Char :: isDigit ( $ this -> _ch ) ) ; } if ( $ this -> _ch == 'E' || $ this -> _ch == 'e' ) { $ result = ExpressionTokenId :: DOUBLE_LITERAL ; $ this -> _nextChar ( ) ; if ( $ this -> _ch == '+' || $ this -> _ch == '-' ) { $ this -> _nextChar ( ) ; } $ this -> _validateDigit ( ) ; do { $ this -> _nextChar ( ) ; } while ( Char :: isDigit ( $ this -> _ch ) ) ; } if ( $ this -> _ch == 'M' || $ this -> _ch == 'm' ) { $ result = ExpressionTokenId :: DECIMAL_LITERAL ; $ this -> _nextChar ( ) ; } else if ( $ this -> _ch == 'd' || $ this -> _ch == 'D' ) { $ result = ExpressionTokenId :: DOUBLE_LITERAL ; $ this -> _nextChar ( ) ; } else if ( $ this -> _ch == 'L' || $ this -> _ch == 'l' ) { $ result = ExpressionTokenId :: INT64_LITERAL ; $ this -> _nextChar ( ) ; } else if ( $ this -> _ch == 'f' || $ this -> _ch == 'F' ) { $ result = ExpressionTokenId :: SINGLE_LITERAL ; $ this -> _nextChar ( ) ; } } return $ result ; }
Parses a token that starts with a digit
Parses a token that starts with a digit