Launched when a [ is encountered.

@param TokenInfo $token
the current token
510322
private function _processSquareBracketOpen($token) {

		// If the [ is preceded by = we are in a array declaration
		if ($this->tokenizer->checkPreviousValidToken(T_EQUAL)) {

			$stackitem = new StatementItem();
			$stackitem->line = $token->line;
			$stackitem->type = 'ARRAY';
			$stackitem->name = 'square_bracket_open';

			$this->statementStack->push($stackitem);
		}
	}
619674
public function setToken($token)
    {
        $token = trim($token);

        $this->isChanged('token', $token);

        $this->token = $token;

        return $this;
    }
990167
private function _processMinus($token) {
		if (!$this->_inFuncCall) {
			$this->_checkWhiteSpaceBefore($token->text);
		}
		// We allow some '-' signs to skip the the space afterwards for negative numbers
		// float number or integer
		if (!($this->tokenizer->checkNextToken(T_LNUMBER) || $this->tokenizer->checkNextToken(T_DNUMBER))) {
			$this->_checkWhiteSpaceAfter($token->text);
		}
	}
1001788
public function handlesToken($token)
    {
        return (
            isset($this->tokensHandled)
            && is_array($this->tokensHandled)
            && in_array($token, $this->tokensHandled)
        );
    }
255349
public function addToken($token)
    {
        if (!in_array($token, $this->tokens)) {
            $this->tokens[] = $token;
        }

        return $this;
    }
413630
public function acceptToken($type, &$token = null)
    {
        $token = $this->peek();
        if (! isset($token[0]) or $token[0] != $type) {
            return false;
        }
        $this->pop();
        return true;
    }
656213
protected function handleEach(array $token)
    {

        $node = $this->createNode('each', $token);
        $node->subject = $token['subject'];
        $node->itemName = $token['itemName'];
        $node->keyName = isset($token['keyName']) ? $token['keyName'] : null;

        $this->current = $node;
    }
1023430
private function setToken(array $token)
    {
        if (is_a($this->container, '\\ArrayAccess')) {
            $this->container['token'] = $token;
            return;
        }

        $this->container->set('token', $token);
    }
606712
protected function handleCase(array $token)
    {

        $node = $this->createNode('case', $token);
        $node->subject = $token['subject'];
        $this->current = $node;
    }
513041
public function delete(Token $token)
    {
        $this->om->remove($token);
        $this->om->flush();
    }
833601
public function setAccessToken($token)
    {
        if (!\is_array($token)) {
            throw new AuthException('Token is not a valid json string.');
        }

        if (isset($token['data']['access_token'])) {
            $token = $token['data'];
        }

        if (!isset($token['access_token'])) {
            throw new AuthException('Access token could not be retrieved from the decoded json response.');
        }

        $this->token = $token;

        $this->sign();
    }
1237784
protected function handleMixinCall(array $token)
    {

        $node = $this->createNode('mixinCall', $token);
        $node->name = $token['name'];
        $node->attributes = [];
        $node->assignments = [];

        $this->current = $node;
    }
838359
protected function handleText(array $token)
    {

        $node = $this->createNode('text', $token);
        $node->value = $token['value'];
        $node->level = $token['level'];
        $node->escaped = $token['escaped'];

        if ($this->current) {

            $this->current->append($node);
        } else
            $this->current = $node;
    }
671820
private function _processControlStatement($token) {
		$csText = strtolower($token->text);

		$this->_inControlStatement = true;
		$this->_currentStatement = $csText;

		// first token: if not one whitespace, error
		if ($this->_isActive('spaceAfterControlStmt')) {
			if (!$this->tokenizer->checkNextToken(T_WHITESPACE)) {
				if (($token->id !== T_ELSE) && ($token->id !== T_TRY) && ($token->id !== T_DO)) {
					$msg = $this->_getMessage('SPACE_AFTER_TOKEN', $csText);
					$this->_writeError('spaceAfterControlStmt', $msg);
				}
			}
		}

		// for some control structures like "else" and "do",
		// there is no statements they will be followed directly by "{"
		if (($token->id === T_ELSE) || ($token->id === T_DO) || ($token->id === T_TRY)) {
			if ($this->tokenizer->checkNextValidToken(T_BRACES_OPEN)) {
				$this->_inControlStatement = false;
				$this->_justAfterControlStmt = true;
			}
		}

		// "else if" is different
		if ($token->id === T_ELSE) {
			if ($this->tokenizer->checkNextValidToken(T_IF)) {
				// control statement for "else" is done
				// new control statement "if" will start
				$this->_inControlStatement = false;
			}

			// ELSE just after a IF with no curly : we close the IF statement
			if ($this->statementStack->getCurrentStackItem()->type === StatementItem::TYPE_IF && $this->statementStack->getCurrentStackItem()->noCurly === true) {
				$this->statementStack->pop();
			}
		}

		if ($token->id === T_IF) {
			// IF just after a ELSE with no curly : we close the ELSE statement
			if ($this->statementStack->getCurrentStackItem()->type === StatementItem::TYPE_ELSE && $this->statementStack->getCurrentStackItem()->noCurly === true) {
				$this->statementStack->pop();
			}
		}

		// "else" and "elseif" should start in the same line as "}"
		if ($token->id === T_ELSE || $token->id === T_ELSEIF) {
			$position = $this->_config->getTestProperty('controlStructElse', 'position');
			$previousToken = $this->tokenizer->peekPrvsValidToken();
			if ($previousToken->id === T_BRACES_CLOSE) {
				if (($position === SAME_LINE) && ($previousToken->line !== $token->line)) {
					$msg = $this->_getMessage('CS_STMT_ALIGNED_WITH_CURLY', $csText);
					$this->_writeError('controlStructElse', $msg);
				}
				if (($position === NEW_LINE) && ($previousToken->line === $token->line)) {
					$msg = $this->_getMessage('CS_STMT_ON_NEW_LINE', $csText);
					$this->_writeError('controlStructElse', $msg);
				}
			}
		}

		// The checkNeedBraces rule is usually launched after a closing parenthesis
		// In the case of the "else", we need to launch it now
		if ($token->id === T_ELSE) {
			$this->_checkNeedBraces();
		}

		// By default we consider that the statement block will start after the next '{'
		// In case there is no curly opening we need to consider the next line as being the statement
		if ($this->tokenizer->checkNextValidToken(T_PARENTHESIS_OPEN)) {
			// in case the statement type is IF, FOR, FOREACH, CATCH, WHILE we skip the conditional
			$startPos = $this->tokenizer->findClosingParenthesisPosition($token->position);
		} else {
			$startPos = $token->position;
		}

		// Now we expect the '{' token
		if (!$this->tokenizer->checkNextValidToken(T_BRACES_OPEN, null, $startPos + 1)) {

			// If not the case, we store the control statement in the stack
			$stackitem = new StatementItem();
			$stackitem->line = $token->line;
			$stackitem->type = strtoupper($csText);
			$stackitem->name = $csText;
			$stackitem->noCurly = true;
			$this->statementStack->push($stackitem);
		}

		// To avoid a false positive when treating the while statement of a do/while
		// We keep track that we have met a do statement
		if ($token->id === T_DO) {
			// Note : The current stack item is not yet the control statement itself, it's the parent
			$this->statementStack->getCurrentStackItem()->afterDoStatement = true;
		}
	}
571786
private function initParse(array $tokens)
    {
        $this->queue = array_merge($tokens, [$this->createEoeToken()]);
        $this->states = [1];
        $this->stack = [];
    }
1007516
private function ConsumeChar( $token )
	{
		$curr = new CurrentToken();
		$curr->token = $token;
		$curr->value = null;
		$curr->anchor = $this->m_anchor;
		$curr->length = 1;
		array_push( $this->m_token, $curr );
	}
1322037
protected static function pushToken(&$context, $token) {
        if ($token === '') {
            return;
        }
        if (is_string($token)) {
            if (is_string(end($context['parsed'][0]))) {
                $context['parsed'][0][key($context['parsed'][0])] .= $token;
                return;
            }
        }
        $context['parsed'][0][] = $token;
    }