private function processFor()
{
$forId = $this->addAtom('For');
$current = $this->id;
++$this->id;
// Skip for
$this->processForblock(array(T_SEMICOLON));
$initId = $this->popExpression();
$this->addLink($forId, $initId, 'INIT');
$this->processForblock(array(T_SEMICOLON));
$finalId = $this->popExpression();
$this->addLink($forId, $finalId, 'FINAL');
$this->processForblock(array(T_CLOSE_PARENTHESIS));
$incrementId = $this->popExpression();
$this->addLink($forId, $incrementId, 'INCREMENT');
$isColon = $this->tokens[$current][0] === T_FOR && $this->tokens[$this->id + 1][0] === T_COLON;
$blockId = $this->processFollowingBlock(array(T_ENDFOR));
$this->popExpression();
$this->addLink($forId, $blockId, 'BLOCK');
$code = $this->tokens[$current][1];
if ($isColon) {
$fullcode = $this->tokens[$current][1] . '(' . $this->atoms[$initId]['fullcode'] . ' ; ' . $this->atoms[$finalId]['fullcode'] . ' ; ' . $this->atoms[$incrementId]['fullcode'] . ') : ' . self::FULLCODE_SEQUENCE . ' ' . $this->tokens[$this->id + 1][1];
} else {
$fullcode = $this->tokens[$current][1] . '(' . $this->atoms[$initId]['fullcode'] . ' ; ' . $this->atoms[$finalId]['fullcode'] . ' ; ' . $this->atoms[$incrementId]['fullcode'] . ')' . ($this->atoms[$blockId]['bracket'] === true ? self::FULLCODE_BLOCK : self::FULLCODE_SEQUENCE);
}
$this->setAtom($forId, array('code' => $code, 'fullcode' => $fullcode, 'line' => $this->tokens[$current][2], 'token' => $this->getToken($this->tokens[$this->id][0]), 'alternative' => $isColon));
$this->pushExpression($forId);
if ($isColon === true) {
++$this->id;
// skip endfor
if ($this->tokens[$this->id + 1][0] === T_SEMICOLON) {
++$this->id;
// skip ; (will do just below)
}
}
$this->processSemicolon();
return $forId;
}