Exakat\Tasks\Load::processConst PHP Method

processConst() private method

private processConst ( )
    private function processConst()
    {
        $constId = $this->addAtom('Const');
        $current = $this->id;
        $rank = -1;
        --$this->id;
        // back one step for the init in the next loop
        do {
            ++$this->id;
            $const = $this->id;
            $nameId = $this->processNextAsIdentifier();
            ++$this->id;
            // Skip =
            while (!in_array($this->tokens[$this->id + 1][0], array(T_SEMICOLON, T_COMMA))) {
                $this->processNext();
            }
            $valueId = $this->popExpression();
            $defId = $this->addAtom('Constant');
            $this->addLink($defId, $nameId, 'NAME');
            $this->addLink($defId, $valueId, 'VALUE');
            $this->setAtom($defId, array('code' => $this->tokens[$const][1], 'fullcode' => $this->atoms[$nameId]['fullcode'] . ' = ' . $this->atoms[$valueId]['fullcode'], 'line' => $this->tokens[$const][2], 'token' => $this->getToken($this->tokens[$const][0]), 'rank' => ++$rank));
            $fullcode[] = $this->atoms[$defId]['fullcode'];
            $fullnspath = $this->getFullnspath($nameId, 'const');
            $this->addDefinition('const', $fullnspath, $defId);
            $this->setAtom($constId, array('fullnspath' => $fullnspath));
            $this->addLink($constId, $defId, 'CONST');
        } while (!in_array($this->tokens[$this->id + 1][0], array(T_SEMICOLON)));
        $this->setAtom($constId, array('code' => $this->tokens[$current][1], 'fullcode' => $this->tokens[$current][1] . ' ' . implode(', ', $fullcode), 'line' => $this->tokens[$current][2], 'token' => $this->getToken($this->tokens[$current][0]), 'count' => $rank + 1));
        $this->pushExpression($constId);
        return $this->processFCOA($constId);
    }
Load