We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在第二章中提到:
下一条生成规则也很简单,它负责处理变量引用和函数调用: .. literalinclude:: _includes/chapter-2_full.cpp :language: cpp :lines: 172-198
下一条生成规则也很简单,它负责处理变量引用和函数调用:
.. literalinclude:: _includes/chapter-2_full.cpp :language: cpp :lines: 172-198
代码如下:
/// identifierexpr /// ::= identifier /// ::= identifier '(' expression* ')' static ExprAST *ParseIdentifierExpr() { std::string IdName = IdentifierStr; getNextToken(); // eat identifier. if (CurTok != '(') // Simple variable ref. return new VariableExprAST(IdName); // Call. getNextToken(); // eat ( std::vector<ExprAST*> Args; if (CurTok != ')') { while (1) { ExprAST *Arg = ParseExpression(); if (!Arg) return 0; Args.push_back(Arg); if (CurTok == ')') break; if (CurTok != ',') return Error("Expected ')' or ',' in argument list"); getNextToken(); } }
在前几条规则中,函数都有return语句,那么对于词条规则的代码描述,是不是应该加上如下几行:
// Eat the ')'. getNextToken(); return new CallExprAST(IdName, Args); }
应该对应172-204行代码。
The text was updated successfully, but these errors were encountered:
好像是这样,这样看着是一个整体,建议你提个 pr
Sorry, something went wrong.
pr已经提出
No branches or pull requests
在第二章中提到:
代码如下:
在前几条规则中,函数都有return语句,那么对于词条规则的代码描述,是不是应该加上如下几行:
应该对应172-204行代码。
The text was updated successfully, but these errors were encountered: