Exakat\Tasks\Load::processOpenTag PHP Метод

processOpenTag() приватный Метод

private processOpenTag ( )
    private function processOpenTag()
    {
        $id = $this->addAtom('Php');
        $current = $this->id;
        $this->startSequence();
        // Special case for pretty much empty script (<?php .... END)
        if ($this->tokens[$this->id + 1][0] === T_END) {
            $voidId = $this->addAtomVoid();
            $this->addToSequence($voidId);
            $this->addLink($id, $this->sequence, 'CODE');
            $this->endSequence();
            $closing = '';
            $this->setAtom($id, array('code' => $this->tokens[$current][1], 'fullcode' => '<?php ' . self::FULLCODE_SEQUENCE . ' ' . $closing, 'line' => $this->tokens[$current][2], 'token' => $this->getToken($this->tokens[$current][0])));
            return $id;
        }
        $n = count($this->tokens) - 2;
        if ($this->tokens[$n][0] === T_INLINE_HTML) {
            --$n;
        }
        while ($this->id < $n) {
            if ($this->tokens[$this->id][0] === T_OPEN_TAG_WITH_ECHO) {
                --$this->id;
                $this->processOpenWithEcho();
                /// processing the first expression as an echo
                $this->processSemicolon();
                if ($this->tokens[$this->id + 1][0] == T_END) {
                    --$this->id;
                }
            } elseif ($this->tokens[$this->id][0] === T_CLOSE_TAG) {
                --$this->id;
            }
            $this->processNext();
        }
        if ($this->tokens[$this->id][0] === T_INLINE_HTML) {
            --$this->id;
        }
        if ($this->tokens[$this->id - 1][0] === T_CLOSE_TAG) {
            $close_tag = true;
            $closing = '?>';
        } elseif ($this->tokens[$this->id][0] === T_HALT_COMPILER) {
            $close_tag = false;
            ++$this->id;
            // Go to HaltCompiler
            $this->processHalt();
            $closing = '';
        } else {
            $close_tag = false;
            $closing = '';
        }
        if ($this->tokens[$this->id - 1][0] === T_OPEN_TAG) {
            $voidId = $this->addAtomVoid();
            $this->addToSequence($voidId);
        }
        $this->addLink($id, $this->sequence, 'CODE');
        $this->endSequence();
        $this->setAtom($id, array('code' => $this->tokens[$current][1], 'fullcode' => '<?php ' . self::FULLCODE_SEQUENCE . ' ' . $closing, 'line' => $this->tokens[$current][2], 'token' => $this->getToken($this->tokens[$current][0]), 'close_tag' => $close_tag));
        return $id;
    }
Load