diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-14 16:45:05 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-14 16:45:05 +0000 |
commit | 48d4a26399959121f33d2bc3bfe51c7827b654fc (patch) | |
tree | 5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /buildtools/lib/parsers/qmake | |
parent | 7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff) | |
download | tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.tar.gz tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.zip |
TQt4 port kdevelop
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'buildtools/lib/parsers/qmake')
19 files changed, 176 insertions, 175 deletions
diff --git a/buildtools/lib/parsers/qmake/location.hh b/buildtools/lib/parsers/qmake/location.hh index 4da36b8a..41ec2015 100644 --- a/buildtools/lib/parsers/qmake/location.hh +++ b/buildtools/lib/parsers/qmake/location.hh @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* As a special exception, you may create a larger work that contains +/* As a special exception, you may create a larger work that tqcontains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof @@ -34,7 +34,7 @@ /** ** \file location.hh - ** Define the QMake::location class. + ** Define the TQMake::location class. */ #ifndef BISON_LOCATION_HH @@ -44,7 +44,7 @@ # include <string> # include "position.hh" -namespace QMake +namespace TQMake { /// Abstract a location. diff --git a/buildtools/lib/parsers/qmake/position.hh b/buildtools/lib/parsers/qmake/position.hh index 704f0df4..63fe2d81 100644 --- a/buildtools/lib/parsers/qmake/position.hh +++ b/buildtools/lib/parsers/qmake/position.hh @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* As a special exception, you may create a larger work that contains +/* As a special exception, you may create a larger work that tqcontains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof @@ -34,7 +34,7 @@ /** ** \file position.hh - ** Define the QMake::position class. + ** Define the TQMake::position class. */ #ifndef BISON_POSITION_HH @@ -43,7 +43,7 @@ # include <iostream> # include <string> -namespace QMake +namespace TQMake { /// Abstract a position. class position diff --git a/buildtools/lib/parsers/qmake/qmake.yy b/buildtools/lib/parsers/qmake/qmake.yy index e11c086d..75d306d0 100644 --- a/buildtools/lib/parsers/qmake/qmake.yy +++ b/buildtools/lib/parsers/qmake/qmake.yy @@ -90,7 +90,7 @@ currently on the top in the stack. When a scope or function scope statement is parsed, the child ProjectAST is created and pushed onto the stack. Therefore all statements which belong to the scope -or function scope are added as childs to their direct parent (scope or function scope). +or function scope are added as childs to their direct tqparent (scope or function scope). */ //QValueStack<ProjectAST*> projects; @@ -359,7 +359,7 @@ function_call : ID_SIMPLE LBRACE function_args RBRACE depth++; //qWarning("%s", $<value>1.ascii()); - if ($<value>1.contains("include")) + if ($<value>1.tqcontains("include")) { IncludeAST *includeAST = new IncludeAST(); includeAST->projectName = $<value>3; diff --git a/buildtools/lib/parsers/qmake/qmake_lex.cpp b/buildtools/lib/parsers/qmake/qmake_lex.cpp index 9fe37664..4d74571c 100644 --- a/buildtools/lib/parsers/qmake/qmake_lex.cpp +++ b/buildtools/lib/parsers/qmake/qmake_lex.cpp @@ -398,7 +398,7 @@ int yyFlexLexer::yylex() return 0; } -#define YY_DECL int QMake::Lexer::yylex() +#define YY_DECL int TQMake::Lexer::yylex() /* %if-c-only Standard (non-C++) definition */ /* %endif */ @@ -630,7 +630,7 @@ static yyconst flex_int16_t yy_rule_linenum[23] = /** @file qmake.ll -QMake Lexer +TQMake Lexer There are 3 types of identifiers recognized by this lexer: -id_simple: examples of such identifiers are qmake variables and scoped variables @@ -638,8 +638,8 @@ at the left of the operator in assignments (like "SOURCES" in "SOURCES+=foo.cpp -id_list: those are "value list identifiers" at the right side in assignments (like "foo.cpp goo.cpp" in "SOURCES+=foo.cpp goo.cpp"); -id_args: function arguments recognized as one identifier -(example: ""${QMAKE_FILE} is intended only for Windows!"" -in "!win32-*:!wince-*:error("${QMAKE_FILE} is intended only for Windows!")" statements). +(example: ""${TQMAKE_FILE} is intended only for Windows!"" +in "!win32-*:!wince-*:error("${TQMAKE_FILE} is intended only for Windows!")" statements). . To recognize those identifiers two additional start conditions are used: list and funcargs. @@ -1011,7 +1011,7 @@ YY_RULE_SETUP { BEGIN(vallist); mylval->value = TQString::fromLocal8Bit( YYText(), YYLeng() ); - return Parser::token::token::QUOTED_VARIABLE_VALUE; + return Parser::token::token::TQUOTED_VARIABLE_VALUE; } YY_BREAK case 9: @@ -2202,14 +2202,14 @@ void yyfree (void * ptr ) #line 203 "qmake.ll" -namespace QMake +namespace TQMake { Lexer::Lexer( std::istream* argin, std::ostream* argout ) : yyFlexLexer(argin, argout), mylval(0), m_lineEnding(None) { } - int Lexer::yylex( QMake::Parser::semantic_type* yylval ) + int Lexer::yylex( TQMake::Parser::semantic_type* yylval ) { mylval = yylval; return yylex(); @@ -2231,7 +2231,7 @@ namespace QMake } } -int QMakelex( QMake::Parser::semantic_type* yylval, QMake::Lexer* lexer) +int TQMakelex( TQMake::Parser::semantic_type* yylval, TQMake::Lexer* lexer) { return lexer->yylex( yylval ); } diff --git a/buildtools/lib/parsers/qmake/qmake_lex.h b/buildtools/lib/parsers/qmake/qmake_lex.h index 242cec2a..514631bf 100644 --- a/buildtools/lib/parsers/qmake/qmake_lex.h +++ b/buildtools/lib/parsers/qmake/qmake_lex.h @@ -1,4 +1,4 @@ -/* KDevelop QMake Support +/* KDevelop TQMake Support * * Copyright 2007 Andreas Pakulat <apaku@gmx.de> * @@ -17,8 +17,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ -#ifndef QMAKE_LEX_H -#define QMAKE_LEX_H +#ifndef TQMAKE_LEX_H +#define TQMAKE_LEX_H #include "qmake_yacc.hpp" #include <iostream> @@ -27,23 +27,23 @@ #include "FlexLexer.h" #endif -namespace QMake +namespace TQMake { class Lexer : public yyFlexLexer { public: enum LineEnding{ None, Unix, MacOS, Windows }; Lexer( std::istream* argin = 0, std::ostream* argout = 0 ); - int yylex( QMake::Parser::semantic_type* yylval ); + int yylex( TQMake::Parser::semantic_type* yylval ); int yylex(); void setLineEndingFromString( const TQString& ); LineEnding lineending(); private: - QMake::Parser::semantic_type* mylval; + TQMake::Parser::semantic_type* mylval; LineEnding m_lineEnding; }; } #endif -// kate: space-indent on; indent-width 4; tab-width: 4; replace-tabs on; auto-insert-doxygen on +// kate: space-indent on; indent-width 4; tab-width: 4; tqreplace-tabs on; auto-insert-doxygen on diff --git a/buildtools/lib/parsers/qmake/qmake_yacc.cpp b/buildtools/lib/parsers/qmake/qmake_yacc.cpp index 32722979..718cb4f5 100644 --- a/buildtools/lib/parsers/qmake/qmake_yacc.cpp +++ b/buildtools/lib/parsers/qmake/qmake_yacc.cpp @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* As a special exception, you may create a larger work that contains +/* As a special exception, you may create a larger work that tqcontains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof @@ -33,7 +33,7 @@ version 2.2 of Bison. */ // Take the name prefix into account. -#define yylex QMakelex +#define yylex TQMakelex #include "qmake_yacc.hpp" @@ -41,7 +41,7 @@ /* Line 317 of lalr1.cc. */ -#line 45 "qmake_yacc.cpp" +#line 45 "tqmake_yacc.cpp" #ifndef YY_ # if YYENABLE_NLS @@ -100,7 +100,7 @@ do { \ #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab -namespace QMake +namespace TQMake { #if YYERROR_VERBOSE @@ -144,7 +144,7 @@ namespace QMake #endif /// Build a parser object. - Parser::Parser (QMake::Lexer* lexer_yyarg, TQValueStack<ProjectAST*>& projects_yyarg, int depth_yyarg) + Parser::Parser (TQMake::Lexer* lexer_yyarg, TQValueStack<ProjectAST*>& projects_yyarg, int depth_yyarg) : yydebug_ (false), yycdebug_ (&std::cerr), lexer (lexer_yyarg), @@ -679,7 +679,7 @@ namespace QMake depth++; //qWarning("%s", $<value>1.ascii()); - if ((yysemantic_stack_[(4) - (1)].value).contains("include")) + if ((yysemantic_stack_[(4) - (1)].value).tqcontains("include")) { IncludeAST *includeAST = new IncludeAST(); includeAST->projectName = (yysemantic_stack_[(4) - (3)].value); @@ -752,7 +752,7 @@ namespace QMake /* Line 675 of lalr1.cc. */ -#line 756 "qmake_yacc.cpp" +#line 756 "tqmake_yacc.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); @@ -1089,7 +1089,7 @@ namespace QMake "$end", "error", "$undefined", "ID_SIMPLE", "EQ", "PLUSEQ", "MINUSEQ", "STAREQ", "TILDEEQ", "LBRACE", "RBRACE", "COLON", "NEWLINE", "COMMENT", "CONT", "COMMENT_CONT", "RCURLY", "LCURLY", "ID_ARGS", - "QUOTED_VARIABLE_VALUE", "VARIABLE_VALUE", "LIST_WS", "ENDOFFILE", + "TQUOTED_VARIABLE_VALUE", "VARIABLE_VALUE", "LIST_WS", "ENDOFFILE", "\"else\"", "$accept", "project", "@1", "statements", "statement", "variable_assignment", "possible_value", "multiline_values", "variable_value", "listws", "operator", "scope", "@2", "function_call", @@ -1227,13 +1227,13 @@ namespace QMake const unsigned int Parser::yyuser_token_number_max_ = 278; const Parser::token_number_type Parser::yyundef_token_ = 2; -} // namespace QMake +} // namespace TQMake #line 421 "qmake.yy" -namespace QMake +namespace TQMake { void Parser::error(const location_type& /*l*/, const std::string& m) { diff --git a/buildtools/lib/parsers/qmake/qmake_yacc.hpp b/buildtools/lib/parsers/qmake/qmake_yacc.hpp index 91583cd3..0b67bb14 100644 --- a/buildtools/lib/parsers/qmake/qmake_yacc.hpp +++ b/buildtools/lib/parsers/qmake/qmake_yacc.hpp @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* As a special exception, you may create a larger work that contains +/* As a special exception, you may create a larger work that tqcontains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof @@ -41,7 +41,7 @@ #include <iostream> #include "stack.hh" -namespace QMake +namespace TQMake { class position; class location; @@ -74,9 +74,9 @@ namespace QMake /** @file qmake.yy -QMake Parser +TQMake Parser -Simple LALR parser which builds the syntax tree (see @ref QMake::AST). +Simple LALR parser which builds the syntax tree (see @ref TQMake::AST). @todo Recognize comments after statements like: SOURCES = foo #regognize me @@ -91,7 +91,7 @@ SOURCES = foo #regognize me #define YYSTYPE_IS_DECLARED -namespace QMake +namespace TQMake { class Lexer; @@ -129,7 +129,7 @@ struct Result { typedef Result YYSTYPE; } -extern int QMakelex( QMake::Result* yylval, QMake::Lexer* lexer ); +extern int TQMakelex( TQMake::Result* yylval, TQMake::Lexer* lexer ); /** The stack to store ProjectAST pointers when a new child @@ -141,7 +141,7 @@ currently on the top in the stack. When a scope or function scope statement is parsed, the child ProjectAST is created and pushed onto the stack. Therefore all statements which belong to the scope -or function scope are added as childs to their direct parent (scope or function scope). +or function scope are added as childs to their direct tqparent (scope or function scope). */ //TQValueStack<ProjectAST*> projects; @@ -202,7 +202,7 @@ do { \ } while (false) #endif -namespace QMake +namespace TQMake { /// A Bison parser. @@ -238,7 +238,7 @@ namespace QMake RCURLY = 271, LCURLY = 272, ID_ARGS = 273, - QUOTED_VARIABLE_VALUE = 274, + TQUOTED_VARIABLE_VALUE = 274, VARIABLE_VALUE = 275, LIST_WS = 276, ENDOFFILE = 277 @@ -249,7 +249,7 @@ namespace QMake typedef token::yytokentype token_type; /// Build a parser object. - Parser (QMake::Lexer* lexer_yyarg, TQValueStack<ProjectAST*>& projects_yyarg, int depth_yyarg); + Parser (TQMake::Lexer* lexer_yyarg, TQValueStack<ProjectAST*>& projects_yyarg, int depth_yyarg); virtual ~Parser (); /// Parse. @@ -408,7 +408,7 @@ namespace QMake /* User arguments. */ - QMake::Lexer* lexer; + TQMake::Lexer* lexer; TQValueStack<ProjectAST*>& projects; int depth; }; diff --git a/buildtools/lib/parsers/qmake/qmakeast.cpp b/buildtools/lib/parsers/qmake/qmakeast.cpp index 91e48d2d..c551abef 100644 --- a/buildtools/lib/parsers/qmake/qmakeast.cpp +++ b/buildtools/lib/parsers/qmake/qmakeast.cpp @@ -21,34 +21,34 @@ #include <kdebug.h> -namespace QMake { +namespace TQMake { //AST AST::~AST() { - for (TQValueList<AST*>::iterator it = m_children.begin(); it != m_children.end(); ++it) + for (TQValueList<AST*>::iterator it = m_tqchildren.begin(); it != m_tqchildren.end(); ++it) { AST *node = *it; delete node; } - m_children.clear(); + m_tqchildren.clear(); } void AST::addChildAST(AST *node) { - m_children.append(node); + m_tqchildren.append(node); } void AST::removeChildAST(AST *node) { - m_children.remove(node); + m_tqchildren.remove(node); } void AST::writeBack(TQString &buffer) { - for (TQValueList<AST*>::const_iterator it = m_children.constBegin(); - it != m_children.constEnd(); ++it) + for (TQValueList<AST*>::const_iterator it = m_tqchildren.constBegin(); + it != m_tqchildren.constEnd(); ++it) { if (*it) { @@ -70,7 +70,7 @@ TQString AST::indentation() void ProjectAST::writeBack(TQString &buffer) { bool hasActualStatements = false; - for (TQValueList<QMake::AST*>::const_iterator it = m_children.begin(); it != m_children.end(); ++it) + for (TQValueList<TQMake::AST*>::const_iterator it = m_tqchildren.begin(); it != m_tqchildren.end(); ++it) { if ((*it)->nodeType() != AST::IncludeAST) { @@ -84,7 +84,7 @@ void ProjectAST::writeBack(TQString &buffer) if( !buffer.endsWith(": ") ) buffer += indentation(); buffer += scopedID; - if( m_children.count() == 1 ) + if( m_tqchildren.count() == 1 ) buffer += " : "; else buffer += " {"; @@ -94,9 +94,9 @@ void ProjectAST::writeBack(TQString &buffer) if( !buffer.endsWith(": ") ) buffer += indentation(); buffer += scopedID + "(" + args + ")"; - if( m_children.count() == 1 && hasActualStatements ) + if( m_tqchildren.count() == 1 && hasActualStatements ) buffer += ": "; - else if( (m_children.count() > 0 && hasActualStatements) ) + else if( (m_tqchildren.count() > 0 && hasActualStatements) ) buffer += "{"; else buffer += ""; @@ -104,10 +104,10 @@ void ProjectAST::writeBack(TQString &buffer) else if( !buffer.endsWith(": ") ) buffer += indentation(); AST::writeBack(buffer); - if (isScope() && m_children.count() > 1 ) + if (isScope() && m_tqchildren.count() > 1 ) buffer += indentation() + "}"; - if (isFunctionScope() && (hasActualStatements) && m_children.count() > 1) + if (isFunctionScope() && (hasActualStatements) && m_tqchildren.count() > 1) buffer += indentation() + "}"; } @@ -165,6 +165,6 @@ void IncludeAST::writeBack(TQString &/*buffer*/) } -// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on +// kate: space-indent on; indent-width 4; tab-width 4; tqreplace-tabs on diff --git a/buildtools/lib/parsers/qmake/qmakeast.h b/buildtools/lib/parsers/qmake/qmakeast.h index 45aedb2e..e2abba70 100644 --- a/buildtools/lib/parsers/qmake/qmakeast.h +++ b/buildtools/lib/parsers/qmake/qmakeast.h @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef QMAKEQMAKEAST_H -#define QMAKEQMAKEAST_H +#ifndef TQMAKETQMAKEAST_H +#define TQMAKETQMAKEAST_H #include <tqstringlist.h> @@ -27,13 +27,13 @@ Abstract Syntax Tree (AST) class declarations. */ -namespace QMake { +namespace TQMake { /** AST node. This is the base class. Objects of this type are not created by the parser. -Each AST node holds the list of its children which are always deleted in the +Each AST node holds the list of its tqchildren which are always deleted in the destructor. This way, it's possible call delete for only root AST node and others will be deleted automatically. @@ -79,7 +79,7 @@ public: virtual TQString indentation(); /**The list of child AST nodes.*/ - TQValueList<AST*> m_children; + TQValueList<AST*> m_tqchildren; protected: NodeType m_nodeType; diff --git a/buildtools/lib/parsers/qmake/qmakeastvisitor.cpp b/buildtools/lib/parsers/qmake/qmakeastvisitor.cpp index 1f7e6cb6..b9470bd9 100644 --- a/buildtools/lib/parsers/qmake/qmakeastvisitor.cpp +++ b/buildtools/lib/parsers/qmake/qmakeastvisitor.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ #include "qmakeastvisitor.h" -namespace QMake { +namespace TQMake { void ASTVisitor::processProject(ProjectAST *project) { @@ -29,31 +29,31 @@ void ASTVisitor::processProject(ProjectAST *project) enterScope(project); else if (project->isFunctionScope()) enterFunctionScope(project); - for (TQValueList<QMake::AST*>::const_iterator it = project->m_children.constBegin(); - it != project->m_children.constEnd(); ++it) + for (TQValueList<TQMake::AST*>::const_iterator it = project->m_tqchildren.constBegin(); + it != project->m_tqchildren.constEnd(); ++it) { AST *ast = *it; if (ast == 0) continue; switch (ast->nodeType()) { case AST::AssignmentAST: - processAssignment(static_cast<QMake::AssignmentAST*>(ast)); + processAssignment(static_cast<TQMake::AssignmentAST*>(ast)); break; case AST::NewLineAST: - processNewLine(static_cast<QMake::NewLineAST*>(ast)); + processNewLine(static_cast<TQMake::NewLineAST*>(ast)); break; case AST::CommentAST: - processComment(static_cast<QMake::CommentAST*>(ast)); + processComment(static_cast<TQMake::CommentAST*>(ast)); break; case AST::ProjectAST: - processProject(static_cast<QMake::ProjectAST*>(ast)); + processProject(static_cast<TQMake::ProjectAST*>(ast)); break; case AST::IncludeAST: - processInclude(static_cast<QMake::IncludeAST*>(ast)); + processInclude(static_cast<TQMake::IncludeAST*>(ast)); break; } } diff --git a/buildtools/lib/parsers/qmake/qmakeastvisitor.h b/buildtools/lib/parsers/qmake/qmakeastvisitor.h index 3db9d14d..6978074c 100644 --- a/buildtools/lib/parsers/qmake/qmakeastvisitor.h +++ b/buildtools/lib/parsers/qmake/qmakeastvisitor.h @@ -17,12 +17,12 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef QMAKEQMAKEASTVISITOR_H -#define QMAKEQMAKEASTVISITOR_H +#ifndef TQMAKETQMAKEASTVISITOR_H +#define TQMAKETQMAKEASTVISITOR_H #include "qmakeast.h" -namespace QMake { +namespace TQMake { class ASTVisitor{ public: diff --git a/buildtools/lib/parsers/qmake/qmakedriver.cpp b/buildtools/lib/parsers/qmake/qmakedriver.cpp index e2d93ef8..09256178 100644 --- a/buildtools/lib/parsers/qmake/qmakedriver.cpp +++ b/buildtools/lib/parsers/qmake/qmakedriver.cpp @@ -30,7 +30,7 @@ #include "qmake_lex.h" #include "qmake_yacc.hpp" -namespace QMake { +namespace TQMake { int Driver::parseFile(const char *fileName, ProjectAST **ast, int debug) { @@ -52,15 +52,15 @@ int Driver::parseFile(const char *fileName, ProjectAST **ast, int debug) (*ast)->setFileName(fileName); switch( l.lineending() ) { - case QMake::Lexer::Windows: - (*ast)->setLineEnding(QMake::ProjectAST::Windows); + case TQMake::Lexer::Windows: + (*ast)->setLineEnding(TQMake::ProjectAST::Windows); break; - case QMake::Lexer::MacOS: - (*ast)->setLineEnding(QMake::ProjectAST::MacOS); + case TQMake::Lexer::MacOS: + (*ast)->setLineEnding(TQMake::ProjectAST::MacOS); break; - case QMake::Lexer::Unix: + case TQMake::Lexer::Unix: default: - (*ast)->setLineEnding(QMake::ProjectAST::Unix); + (*ast)->setLineEnding(TQMake::ProjectAST::Unix); break; } return ret; @@ -96,15 +96,15 @@ int Driver::parseString( const char* string, ProjectAST **ast, int debug ) (*ast)->setFileName(""); switch( l.lineending() ) { - case QMake::Lexer::Windows: - (*ast)->setLineEnding(QMake::ProjectAST::Windows); + case TQMake::Lexer::Windows: + (*ast)->setLineEnding(TQMake::ProjectAST::Windows); break; - case QMake::Lexer::MacOS: - (*ast)->setLineEnding(QMake::ProjectAST::MacOS); + case TQMake::Lexer::MacOS: + (*ast)->setLineEnding(TQMake::ProjectAST::MacOS); break; - case QMake::Lexer::Unix: + case TQMake::Lexer::Unix: default: - (*ast)->setLineEnding(QMake::ProjectAST::Unix); + (*ast)->setLineEnding(TQMake::ProjectAST::Unix); break; } return ret; diff --git a/buildtools/lib/parsers/qmake/qmakedriver.h b/buildtools/lib/parsers/qmake/qmakedriver.h index 918054fa..ee56f388 100644 --- a/buildtools/lib/parsers/qmake/qmakedriver.h +++ b/buildtools/lib/parsers/qmake/qmakedriver.h @@ -17,13 +17,13 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef QMAKEQMAKEDRIVER_H -#define QMAKEQMAKEDRIVER_H +#ifndef TQMAKETQMAKEDRIVER_H +#define TQMAKETQMAKEDRIVER_H class TQString; class KURL; -namespace QMake { +namespace TQMake { /** @file qmakedriver.h diff --git a/buildtools/lib/parsers/qmake/stack.hh b/buildtools/lib/parsers/qmake/stack.hh index b81e4a28..07f71922 100644 --- a/buildtools/lib/parsers/qmake/stack.hh +++ b/buildtools/lib/parsers/qmake/stack.hh @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* As a special exception, you may create a larger work that contains +/* As a special exception, you may create a larger work that tqcontains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof @@ -37,7 +37,7 @@ #include <deque> -namespace QMake +namespace TQMake { template <class T, class S = std::deque<T> > class stack diff --git a/buildtools/lib/parsers/qmake/tests/runner.cpp b/buildtools/lib/parsers/qmake/tests/runner.cpp index 6f1d5956..5dd417db 100644 --- a/buildtools/lib/parsers/qmake/tests/runner.cpp +++ b/buildtools/lib/parsers/qmake/tests/runner.cpp @@ -21,8 +21,8 @@ #include <cstdlib> #include <iostream> #include <stdio.h> -#include "qmakedriver.h" -#include "qmakeastvisitor.h" +#include "tqmakedriver.h" +#include "tqmakeastvisitor.h" #include <tqstring.h> @@ -34,92 +34,92 @@ static const KCmdLineOptions options[] = { {"silent", "Enable Parser debug output", 0}, {"!debug", "Disable output of the generated AST", 0}, - {"!+files", "QMake project files", 0} + {"!+files", "TQMake project files", 0} }; -class PrintAST : QMake::ASTVisitor +class PrintAST : TQMake::ASTVisitor { public: - PrintAST() : QMake::ASTVisitor() + PrintAST() : TQMake::ASTVisitor() { indent = 0; } - virtual void processProject( QMake::ProjectAST* p ) + virtual void processProject( TQMake::ProjectAST* p ) { - QMake::ASTVisitor::processProject(p); + TQMake::ASTVisitor::processProject(p); } private: - virtual void enterRealProject( QMake::ProjectAST* p ) + virtual void enterRealProject( TQMake::ProjectAST* p ) { kdDebug(9024) << getIndent() << "--------- Entering Project: " << replaceWs(p->fileName()) << "| LineEnding:" << p->lineEnding() << " --------------" << endl; indent += 4; - QMake::ASTVisitor::enterRealProject(p); + TQMake::ASTVisitor::enterRealProject(p); } - virtual void leaveRealProject( QMake::ProjectAST* p ) + virtual void leaveRealProject( TQMake::ProjectAST* p ) { indent -= 4; kdDebug(9024) << getIndent() << "--------- Leaving Project: " << replaceWs(p->fileName()) << " --------------" << endl; - QMake::ASTVisitor::leaveRealProject(p); + TQMake::ASTVisitor::leaveRealProject(p); } - virtual void enterScope( QMake::ProjectAST* p ) + virtual void enterScope( TQMake::ProjectAST* p ) { kdDebug(9024) << getIndent() << "--------- Entering Scope: " << replaceWs(p->scopedID) << " --------------" << endl; indent += 4; - QMake::ASTVisitor::enterScope(p); + TQMake::ASTVisitor::enterScope(p); } - virtual void leaveScope( QMake::ProjectAST* p ) + virtual void leaveScope( TQMake::ProjectAST* p ) { indent -= 4; kdDebug(9024) << getIndent() << "--------- Leaving Scope: " << replaceWs(p->scopedID) << " --------------" << endl; - QMake::ASTVisitor::leaveScope(p); + TQMake::ASTVisitor::leaveScope(p); } - virtual void enterFunctionScope( QMake::ProjectAST* p ) + virtual void enterFunctionScope( TQMake::ProjectAST* p ) { kdDebug(9024) << getIndent() << "--------- Entering FunctionScope: " << replaceWs(p->scopedID) << "(" << replaceWs(p->args) << ")"<< " --------------" << endl; indent += 4; - QMake::ASTVisitor::enterFunctionScope(p); + TQMake::ASTVisitor::enterFunctionScope(p); } - virtual void leaveFunctionScope( QMake::ProjectAST* p ) + virtual void leaveFunctionScope( TQMake::ProjectAST* p ) { indent -= 4; kdDebug(9024) << getIndent() << "--------- Leaving FunctionScope: " << replaceWs(p->scopedID) << "(" << replaceWs(p->args) << ")"<< " --------------" << endl; - QMake::ASTVisitor::leaveFunctionScope(p); + TQMake::ASTVisitor::leaveFunctionScope(p); } TQString replaceWs(TQString s) { - return s.replace("\n", "%nl").replace("\t", "%tab").replace(" ", "%spc"); + return s.tqreplace("\n", "%nl").tqreplace("\t", "%tab").tqreplace(" ", "%spc"); } - virtual void processAssignment( QMake::AssignmentAST* a) + virtual void processAssignment( TQMake::AssignmentAST* a) { kdDebug(9024) << getIndent() << "Assignment(" << replaceWs(a->indent) << "):" << replaceWs(a->scopedID) << " " << replaceWs(a->op) << " " << replaceWs(a->values.join("|")) << endl; - QMake::ASTVisitor::processAssignment(a); + TQMake::ASTVisitor::processAssignment(a); } - virtual void processNewLine( QMake::NewLineAST* n) + virtual void processNewLine( TQMake::NewLineAST* n) { kdDebug(9024) << getIndent() << "Newline " << endl; - QMake::ASTVisitor::processNewLine(n); + TQMake::ASTVisitor::processNewLine(n); } - virtual void processComment( QMake::CommentAST* a) + virtual void processComment( TQMake::CommentAST* a) { kdDebug(9024) << getIndent() << "Comment: " << replaceWs(a->comment) << endl; - QMake::ASTVisitor::processComment(a); + TQMake::ASTVisitor::processComment(a); } - virtual void processInclude( QMake::IncludeAST* a) + virtual void processInclude( TQMake::IncludeAST* a) { kdDebug(9024) << getIndent() << "Include: " << replaceWs(a->projectName) << endl; - QMake::ASTVisitor::processInclude(a); + TQMake::ASTVisitor::processInclude(a); } TQString getIndent() @@ -133,7 +133,7 @@ private: }; int main(int argc, char *argv[]) { - KCmdLineArgs::init( argc, argv, "QMake Parser", "qmake-parser", "Parse QMake project files", "1.0.0"); + KCmdLineArgs::init( argc, argv, "TQMake Parser", "qmake-parser", "Parse TQMake project files", "1.0.0"); KCmdLineArgs::addCmdLineOptions(options); KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); @@ -152,8 +152,8 @@ int main(int argc, char *argv[]) debug = 1; for( int i = 0 ; i < args->count() ; i++ ) { - QMake::ProjectAST *projectAST; - int ret = QMake::Driver::parseFile(args->url(i).path(), &projectAST, debug); + TQMake::ProjectAST *projectAST; + int ret = TQMake::Driver::parseFile(args->url(i).path(), &projectAST, debug); PrintAST pa; if ( ret == 0 ) if ( !silent ) @@ -161,7 +161,7 @@ int main(int argc, char *argv[]) pa.processProject(projectAST); TQString profile; projectAST->writeBack(profile); - kdDebug(9024) << "QMake file written back:\n" << profile << endl; + kdDebug(9024) << "TQMake file written back:\n" << profile << endl; } return ret; } diff --git a/buildtools/lib/parsers/qmake/tests/viewer.cpp b/buildtools/lib/parsers/qmake/tests/viewer.cpp index 4583ab11..6f1e5f25 100644 --- a/buildtools/lib/parsers/qmake/tests/viewer.cpp +++ b/buildtools/lib/parsers/qmake/tests/viewer.cpp @@ -29,14 +29,14 @@ #include <tqlistview.h> #include <tqtabwidget.h> -#include <qmakeast.h> -#include <qmakedriver.h> -#include <qmakeastvisitor.h> +#include <tqmakeast.h> +#include <tqmakedriver.h> +#include <tqmakeastvisitor.h> -using namespace QMake; +using namespace TQMake; -Viewer::Viewer(TQWidget *parent, const char *name) - :ViewerBase(parent, name), projectAST(0) +Viewer::Viewer(TQWidget *tqparent, const char *name) + :ViewerBase(tqparent, name), projectAST(0) { if (TQFile::exists(TQDir::currentDirPath() + "/" + "qtlist")) { @@ -47,7 +47,7 @@ Viewer::Viewer(TQWidget *parent, const char *name) files->insertItem(str.readLine()); } ast->setSorting(-1); -// parentProject.push((TQListViewItem*)0); +// tqparentProject.push((TQListViewItem*)0); } void Viewer::addAll_clicked() @@ -78,7 +78,7 @@ void Viewer::files_currentChanged(TQListBoxItem* item) source->setText(str.read()); f.close(); - int result = QMake::Driver::parseFile(item->text().ascii(), &projectAST, 0); + int result = TQMake::Driver::parseFile(item->text().ascii(), &projectAST, 0); if (projectAST && (result == 0)) { processAST(projectAST); @@ -102,7 +102,7 @@ public: ViewerVisitor(Viewer *v): ASTVisitor() { this->v = v; - parentProject.push((TQListViewItem*)0); + tqparentProject.push((TQListViewItem*)0); } virtual void processProject(ProjectAST *project) @@ -113,39 +113,39 @@ public: virtual void enterRealProject(ProjectAST *project) { TQListViewItem *projectIt; - if (!parentProject.top()) + if (!tqparentProject.top()) { projectIt = new TQListViewItem(v->ast, "Project"); projectIt->setOpen(true); - parentProject.push(projectIt); + tqparentProject.push(projectIt); } ASTVisitor::enterRealProject(project); } virtual void enterScope(ProjectAST *scope) { - TQListViewItem *projectIt = new TQListViewItem(parentProject.top(), scope->scopedID, "scope"); - parentProject.push(projectIt); + TQListViewItem *projectIt = new TQListViewItem(tqparentProject.top(), scope->scopedID, "scope"); + tqparentProject.push(projectIt); ASTVisitor::enterScope(scope); } virtual void leaveScope(ProjectAST *scope) { - parentProject.pop(); + tqparentProject.pop(); } virtual void enterFunctionScope(ProjectAST *fscope) { - TQListViewItem *projectIt = new TQListViewItem(parentProject.top(), + TQListViewItem *projectIt = new TQListViewItem(tqparentProject.top(), fscope->scopedID + "(" + fscope->args + ")", "function scope"); - parentProject.push(projectIt); + tqparentProject.push(projectIt); ASTVisitor::enterFunctionScope(fscope); } virtual void leaveFunctionScope(ProjectAST *fscope) { - parentProject.pop(); + tqparentProject.pop(); } virtual void processAssignment(AssignmentAST *assignment) { - TQListViewItem *item = new TQListViewItem(parentProject.top(), + TQListViewItem *item = new TQListViewItem(tqparentProject.top(), assignment->scopedID, assignment->op, assignment->values.join("|"), "assignment"); item->setMultiLinesEnabled(true); @@ -154,26 +154,26 @@ public: } virtual void processNewLine(NewLineAST *newline) { - new TQListViewItem(parentProject.top(), "<newline>"); + new TQListViewItem(tqparentProject.top(), "<newline>"); ASTVisitor::processNewLine(newline); } virtual void processComment(CommentAST *comment) { - new TQListViewItem(parentProject.top(), "<comment>"); + new TQListViewItem(tqparentProject.top(), "<comment>"); ASTVisitor::processComment(comment); } virtual void processInclude(IncludeAST *include) { - new TQListViewItem(parentProject.top(), "<include>", include->projectName); - QMake::ASTVisitor::processInclude(include); + new TQListViewItem(tqparentProject.top(), "<include>", include->projectName); + TQMake::ASTVisitor::processInclude(include); } Viewer *v; - TQValueStack<TQListViewItem *> parentProject; + TQValueStack<TQListViewItem *> tqparentProject; }; -void Viewer::processAST(QMake::ProjectAST *projectAST, TQListViewItem *globAfter) +void Viewer::processAST(TQMake::ProjectAST *projectAST, TQListViewItem *globAfter) { ViewerVisitor visitor(this); visitor.processProject(projectAST); diff --git a/buildtools/lib/parsers/qmake/tests/viewer.h b/buildtools/lib/parsers/qmake/tests/viewer.h index bba85b1f..28a7613c 100644 --- a/buildtools/lib/parsers/qmake/tests/viewer.h +++ b/buildtools/lib/parsers/qmake/tests/viewer.h @@ -24,7 +24,7 @@ #include "viewerbase.h" -namespace QMake { +namespace TQMake { class ProjectAST; } @@ -32,16 +32,17 @@ class TQListViewItem; class Viewer: public ViewerBase { Q_OBJECT + TQ_OBJECT public: - Viewer(TQWidget *parent = 0, const char *name = 0); - void processAST(QMake::ProjectAST *projectAST, TQListViewItem *globAfter = 0); + Viewer(TQWidget *tqparent = 0, const char *name = 0); + void processAST(TQMake::ProjectAST *projectAST, TQListViewItem *globAfter = 0); public slots: virtual void tabWidget2_selected(const TQString&); virtual void files_currentChanged(TQListBoxItem*); virtual void choose_clicked(); virtual void addAll_clicked(); private: - QMake::ProjectAST *projectAST; + TQMake::ProjectAST *projectAST; friend class ViewerVisitor; }; diff --git a/buildtools/lib/parsers/qmake/tests/viewer_main.cpp b/buildtools/lib/parsers/qmake/tests/viewer_main.cpp index c31ea02c..199b106d 100644 --- a/buildtools/lib/parsers/qmake/tests/viewer_main.cpp +++ b/buildtools/lib/parsers/qmake/tests/viewer_main.cpp @@ -27,7 +27,7 @@ int main(int argc, char **argv) Viewer viewer; app.setMainWidget(&viewer); viewer.show(); - viewer.setWindowState(viewer.windowState() | Qt::WindowMaximized); + viewer.setWindowState(viewer.windowState() | TQt::WindowMaximized); return app.exec(); } diff --git a/buildtools/lib/parsers/qmake/tests/viewerbase.ui b/buildtools/lib/parsers/qmake/tests/viewerbase.ui index 976d4d0f..c37f41bf 100644 --- a/buildtools/lib/parsers/qmake/tests/viewerbase.ui +++ b/buildtools/lib/parsers/qmake/tests/viewerbase.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>ViewerBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>ViewerBase</cstring> </property> @@ -19,37 +19,37 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QSplitter" row="0" column="0"> + <widget class="TQSplitter" row="0" column="0"> <property name="name"> <cstring>splitter5</cstring> </property> <property name="orientation"> <enum>Horizontal</enum> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout4</cstring> + <cstring>tqlayout4</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>allLocation</cstring> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>32767</width> <height>32767</height> </size> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>addAll</cstring> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>32767</width> <height>32767</height> @@ -59,11 +59,11 @@ <string>Add All From Directory</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>choose</cstring> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>32767</width> <height>32767</height> @@ -73,7 +73,7 @@ <string>Choose File to Add...</string> </property> </widget> - <widget class="QListBox"> + <widget class="TQListBox"> <property name="name"> <cstring>files</cstring> </property> @@ -85,7 +85,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>32767</width> <height>32767</height> @@ -97,14 +97,14 @@ </widget> </vbox> </widget> - <widget class="QSplitter"> + <widget class="TQSplitter"> <property name="name"> <cstring>splitter2</cstring> </property> <property name="orientation"> <enum>Vertical</enum> </property> - <widget class="QTextEdit"> + <widget class="TQTextEdit"> <property name="name"> <cstring>source</cstring> </property> @@ -117,7 +117,7 @@ </sizepolicy> </property> </widget> - <widget class="QTabWidget"> + <widget class="TQTabWidget"> <property name="name"> <cstring>tabWidget2</cstring> </property> @@ -129,7 +129,7 @@ <verstretch>2</verstretch> </sizepolicy> </property> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>tab</cstring> </property> @@ -140,7 +140,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QListView" row="0" column="0"> + <widget class="TQListView" row="0" column="0"> <column> <property name="text"> <string>Name</string> @@ -191,7 +191,7 @@ </widget> </grid> </widget> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>tab</cstring> </property> @@ -202,7 +202,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QTextEdit" row="0" column="0"> + <widget class="TQTextEdit" row="0" column="0"> <property name="name"> <cstring>writeBack</cstring> </property> @@ -240,11 +240,11 @@ <slot>tabWidget2_selected(const QString&)</slot> </connection> </connections> -<slots> +<Q_SLOTS> <slot>addAll_clicked()</slot> <slot>choose_clicked()</slot> <slot>files_currentChanged( QListBoxItem * )</slot> <slot>tabWidget2_selected( const QString & )</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> |