b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

php语法基础 【原创】PHP魔方加密 手动反编译基于栈的指令(5)

电脑杂谈  发布时间:2018-02-08 12:09:56  来源:网络整理

db 指令,就直接写入就行了。注意,是构造语法树相应的数据类型的节点,而不是直接输入数据。

/**
 * 读取数据
 * @param string|int $data
 * @throws \Exception
 */
protected function _db($data)
{
    if (is_string($data)) {
        $this->ast[$this->astp] = new String_($data);
    } elseif (is_numeric($data)) {
        $this->ast[$this->astp] = new LNumber($data);
    } elseif (is_array($data)) {
        $this->ast[$this->astp] = new Array_($data);
    } else {
        throw new \Exception('Move invalid data.');
    }
}

protected function _call($argCount)
{
    $args = [];
    for ($i = $argCount - 1; $i >= 0; --$i) {
        $args[] = new \PhpParser\Node\Arg($this->ast[$this->astp - $i]);
    }
    $this->ast[$this->astp - $argCount] = new FuncCall(
        new Name($this->ast[$this->astp - $argCount]->value),
        $args
    );
}

not 就是在外面再套一层 Not

protected function _not()
{
    $this->ast[$this->astp] = new BooleanNot($this->ast[$this->astp]);
}

现在你应该已经基本了解如何根据指令堆栈的操作来构造语法树了。php语法基础接下来我们来分析一下条件分支结构。

php语法教程_php语法基础_php语言入门

if               [esp]
    pop
else
    pop

$this->ast[$this->astp] = new If_($this->ast[$this->astp]);


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-67089-5.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...