public function parseLabel()
    {
        $token = '';

        /**
         * Value to be returned.
         *
         * @var Token
         */
        $ret = null;

        /**
         * The value of `$this->last` where `$token` ends in `$this->str`.
         *
         * @var int
         */
        $iEnd = $this->last;
        for ($j = 1; $j < Context::LABEL_MAX_LENGTH && $this->last < $this->len; ++$j, ++$this->last) {
            if ($this->str[$this->last] === ':' && $j > 1) {
                // End of label
                $token .= $this->str[$this->last];
                $ret = new Token($token, Token::TYPE_LABEL);
                $iEnd = $this->last;
                break;
            } elseif (Context::isWhitespace($this->str[$this->last]) && $j > 1) {
                // Whitespace between label and :
                // The size of the keyword didn't increase.
                --$j;
            } elseif (Context::isSeparator($this->str[$this->last])) {
                // Any other separator
                break;
            }
            $token .= $this->str[$this->last];
        }

        $this->last = $iEnd;

        return $ret;
    }
public function parseLabel()
    {
        $token = '';

        /**
         * Value to be returned.
         *
         * @var Token
         */
        $ret = null;

        /**
         * The value of `$this->last` where `$token` ends in `$this->str`.
         *
         * @var int
         */
        $iEnd = $this->last;
        for ($j = 1; $j < Context::LABEL_MAX_LENGTH && $this->last < $this->len; ++$j, ++$this->last) {
            if ($this->str[$this->last] === ':' && $j > 1) {
                // End of label
                $token .= $this->str[$this->last];
                $ret = new Token($token, Token::TYPE_LABEL);
                $iEnd = $this->last;
                break;
            } elseif (Context::isWhitespace($this->str[$this->last]) && $j > 1) {
                // Whitespace between label and :
                // The size of the keyword didn't increase.
                --$j;
            } elseif (Context::isSeparator($this->str[$this->last])) {
                // Any other separator
                break;
            }
            $token .= $this->str[$this->last];
        }

        $this->last = $iEnd;

        return $ret;
    }
public function parseLabel ( ) { $ token = '' ; /**
         * Value to be returned.
         *
         * @var Token
         */ $ ret = null ; /**
         * The value of `$this->last` where `$token` ends in `$this->str`.
         *
         * @var int
         */ $ iEnd = $ this -> last ; for ( $ j = 1 ; $ j < Context :: LABEL_MAX_LENGTH && $ this -> last < $ this -> len ; ++ $ j , ++ $ this -> last ) { if ( $ this -> str [ $ this -> last ] === ':' && $ j > 1 ) { // End of label $ token .= $ this -> str [ $ this -> last ] ; $ ret = new Token ( $ token , Token :: TYPE_LABEL ) ; $ iEnd = $ this -> last ; break ; } elseif ( Context :: isWhitespace ( $ this -> str [ $ this -> last ] ) && $ j > 1 ) { // Whitespace between label and : // The size of the keyword didn't increase. -- $ j ; } elseif ( Context :: isSeparator ( $ this -> str [ $ this -> last ] ) ) { // Any other separator break ; } $ token .= $ this -> str [ $ this -> last ] ; } $ this -> last = $ iEnd ; return $ ret ; }
Parses a label.

@return null|Token
Parses a label .