本文整理汇总了C++中AST::numFunctions方法的典型用法代码示例。如果您正苦于以下问题:C++ AST::numFunctions方法的具体用法?C++ AST::numFunctions怎么用?C++ AST::numFunctions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AST
的用法示例。
在下文中一共展示了AST::numFunctions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeAST
void DepGenerator::writeAST(const AST& ast, StringBuilder& output, unsigned indent, bool isExternal) const {
for (unsigned i=0; i<ast.numTypes(); i++) {
const Decl* D = ast.getType(i);
if (isExternal && !D->isUsed()) continue;
writeDecl(D, output, indent);
}
for (unsigned i=0; i<ast.numVars(); i++) {
const Decl* D = ast.getVar(i);
if (isExternal && !D->isUsed()) continue;
writeDecl(D, output, indent);
}
for (unsigned i=0; i<ast.numFunctions(); i++) {
const Decl* D = ast.getFunction(i);
if (isExternal && !D->isUsed()) continue;
writeDecl(D, output, indent);
}
}
示例2: analyse
void TagWriter::analyse(const AST& ast) {
currentFile = getFile(ast.getFileName());
for (unsigned i=0; i<ast.numTypes(); i++) {
TagVisitor visitor(*this, ast.getType(i), SM);
visitor.run();
}
for (unsigned i=0; i<ast.numVars(); i++) {
TagVisitor visitor(*this, ast.getVar(i), SM);
visitor.run();
}
for (unsigned i=0; i<ast.numFunctions(); i++) {
TagVisitor visitor(*this, ast.getFunction(i), SM);
visitor.run();
}
// TODO TypeDecls ArrayValueDecls
}
示例3: writeAST
void DepGenerator::writeAST(const AST& ast, StringBuilder& output, unsigned indent) const {
if (showExternals) {
for (unsigned i=0; i<ast.numImports(); i++) {
const ImportDecl* U = ast.getImport(i);
QualType Q = U->getType();
const ModuleType* T = cast<ModuleType>(Q.getTypePtr());
const Module* P = T->getModule();
assert(P);
if (P->isExternal()) addExternal(P);
}
}
for (unsigned i=0; i<ast.numTypes(); i++) {
writeDecl(ast.getType(i), output, indent);
}
for (unsigned i=0; i<ast.numVars(); i++) {
writeDecl(ast.getVar(i), output, indent);
}
for (unsigned i=0; i<ast.numFunctions(); i++) {
writeDecl(ast.getFunction(i), output, indent);
}
}