正如我所看到的,這是解析結構內部的方法定義時的一個普遍問題,並且不是特定於代碼完成。無論如何,在這種情況下,解析器中有特殊的處理,您可以在the ParseCXXInlineMethods.cpp file中找到它。
從評論Parser::ParseCXXInlineMethodDef()
:
/// ParseCXXInlineMethodDef - We parsed and verified that the specified
/// Declarator is a well formed C++ inline method definition. Now lex its body
/// and store its tokens for parsing after the C++ class is complete.
Parser::DeclPtrTy
Parser::ParseCXXInlineMethodDef(...
後來,解析方法定義代碼:
/// ParseLexedMethodDefs - We finished parsing the member specification of a top
/// (non-nested) C++ class. Now go over the stack of lexed methods that were
/// collected during its parsing and parse them all.
void Parser::ParseLexedMethodDefs(...
因此詞法分析器生成令牌的函數體後剩下的只是解析的類被解析。
來源
2013-07-09 08:19:35
Oak
感謝您的回答 - 清理了一些東西 – Daniel