From 49524cb4a1ff7fa289e6f6a7cc3669699a5b107d Mon Sep 17 00:00:00 2001 From: rfhits <70683664+rfhits@users.noreply.github.com> Date: Sun, 21 Aug 2022 15:54:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84identifierexpr=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=A3=E8=AF=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 第二章中,关于identifierexpr生成规则的代码解说,少了return语句 --- source/chapter-2.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/chapter-2.rst b/source/chapter-2.rst index 4068ee7..6645898 100644 --- a/source/chapter-2.rst +++ b/source/chapter-2.rst @@ -113,7 +113,7 @@ __ http://en.wikipedia.org/wiki/Operator-precedence_parser .. literalinclude:: _includes/chapter-2_full.cpp :language: cpp - :lines: 172-198 + :lines: 172-204 该函数与其它函数的风格别无二致。(调用该函数时当前语元必须是\ ``tok_identifier``\ 。)前文提到的有关递归和错误处理的特点它统统具备。有意思的是这里采用了\ **预读**\ (lookahead)的手段来试探当前标识符的类型,判断它究竟是个独立的变量引用还是个函数调用。只要检查紧跟标识符之后的语元是不是“\ ``(``\ ”,它就能知道到底应该构造\ ``VariableExprAST``\ 节点还是\ ``CallExprAST``\ 节点。