diff --git a/src/shared/cplusplus/ASTMatcher.cpp b/src/shared/cplusplus/ASTMatcher.cpp index 75993309d7d0ba132c4b54f734021d77bc187be2..40fb554175dcd608d886d8eaf3f8f7ef86af1bc6 100644 --- a/src/shared/cplusplus/ASTMatcher.cpp +++ b/src/shared/cplusplus/ASTMatcher.cpp @@ -89,8 +89,6 @@ void ASTMatcher::getTokenStartPosition(unsigned index, unsigned *line, unsigned void ASTMatcher::getTokenEndPosition(unsigned index, unsigned *line, unsigned *column) const { getPosition(tokenAt(index).end(), line, column); } - - bool ASTMatcher::match(SimpleSpecifierAST *node, SimpleSpecifierAST *pattern) { if (node->specifier_token != pattern->specifier_token) diff --git a/src/tools/cplusplus/Main.cpp b/src/tools/cplusplus/Main.cpp index c1160cb1868f9eff9b9124f458ba497b18636987..51694363475d54b940f123f442200fb42b6fc6f0 100644 --- a/src/tools/cplusplus/Main.cpp +++ b/src/tools/cplusplus/Main.cpp @@ -325,12 +325,69 @@ public: QTextStream output(&file); out = &output; - *out << copyrightHeader << - "\n" - "#include \"AST.h\"\n" - "#include \"ASTMatcher.h\"\n" - "\n" - "using namespace CPlusPlus;\n" << endl; + *out << copyrightHeader << endl + << "#include \"AST.h\"" << endl + << "#include \"ASTMatcher.h\"" << endl + << "#include \"Control.h\"" << endl + << "#include \"TranslationUnit.h\"" << endl + << endl + << "using namespace CPlusPlus;" << endl + << endl + << "ASTMatcher::ASTMatcher(Control *control)" << endl + << " : _control(control)" << endl + << "{ }" << endl + << endl + << "ASTMatcher::~ASTMatcher()" << endl + << "{ }" << endl + << endl + << "Control *ASTMatcher::control() const" << endl + << "{ return _control; }" << endl + << endl + << "TranslationUnit *ASTMatcher::translationUnit() const" << endl + << "{ return _control->translationUnit(); }" << endl + << endl + << "unsigned ASTMatcher::tokenCount() const" << endl + << "{ return translationUnit()->tokenCount(); }" << endl + << endl + << "const Token &ASTMatcher::tokenAt(unsigned index) const" << endl + << "{ return translationUnit()->tokenAt(index); }" << endl + << endl + << "int ASTMatcher::tokenKind(unsigned index) const" << endl + << "{ return translationUnit()->tokenKind(index); }" << endl + << endl + << "const char *ASTMatcher::spell(unsigned index) const" << endl + << "{ return translationUnit()->spell(index); }" << endl + << endl + << "Identifier *ASTMatcher::identifier(unsigned index) const" << endl + << "{ return translationUnit()->identifier(index); }" << endl + << endl + << "Literal *ASTMatcher::literal(unsigned index) const" << endl + << "{ return translationUnit()->literal(index); }" << endl + << endl + << "NumericLiteral *ASTMatcher::numericLiteral(unsigned index) const" << endl + << "{ return translationUnit()->numericLiteral(index); }" << endl + << endl + << "StringLiteral *ASTMatcher::stringLiteral(unsigned index) const" << endl + << "{ return translationUnit()->stringLiteral(index); }" << endl + << endl + << "void ASTMatcher::getPosition(unsigned offset," << endl + << " unsigned *line," << endl + << " unsigned *column," << endl + << " StringLiteral **fileName) const" << endl + << "{ translationUnit()->getPosition(offset, line, column, fileName); }" << endl + << endl + << "void ASTMatcher::getTokenPosition(unsigned index," << endl + << " unsigned *line," << endl + << " unsigned *column," << endl + << " StringLiteral **fileName) const" << endl + << "{ translationUnit()->getTokenPosition(index, line, column, fileName); }" << endl + << endl + << "void ASTMatcher::getTokenStartPosition(unsigned index, unsigned *line, unsigned *column) const" << endl + << "{ getPosition(tokenAt(index).begin(), line, column); }" << endl + << endl + << "void ASTMatcher::getTokenEndPosition(unsigned index, unsigned *line, unsigned *column) const" << endl + << "{ getPosition(tokenAt(index).end(), line, column); }" << endl + << endl; accept(ast); }