summaryrefslogtreecommitdiffstats
path: root/src/languages/asmparser.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-29 16:05:55 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-29 16:05:55 +0000
commit87a016680e3677da3993f333561e79eb0cead7d5 (patch)
treecbda2b4df8b8ee0d8d1617e6c75bec1e3ee0ccba /src/languages/asmparser.cpp
parent6ce3d1ad09c1096b5ed3db334e02859e45d5c32b (diff)
downloadktechlab-87a016680e3677da3993f333561e79eb0cead7d5.tar.gz
ktechlab-87a016680e3677da3993f333561e79eb0cead7d5.zip
TQt4 port ktechlab
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktechlab@1238801 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/languages/asmparser.cpp')
-rw-r--r--src/languages/asmparser.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/languages/asmparser.cpp b/src/languages/asmparser.cpp
index eb4b7cd..94b01c0 100644
--- a/src/languages/asmparser.cpp
+++ b/src/languages/asmparser.cpp
@@ -13,10 +13,10 @@
#include "gpsimprocessor.h"
#include <kdebug.h>
-#include <qfile.h>
-#include <qregexp.h>
+#include <tqfile.h>
+#include <tqregexp.h>
-AsmParser::AsmParser( const QString &url )
+AsmParser::AsmParser( const TQString &url )
: m_url(url)
{
m_bContainsRadix = false;
@@ -31,40 +31,40 @@ AsmParser::~AsmParser()
bool AsmParser::parse( GpsimDebugger * debugger )
{
- QFile file(m_url);
+ TQFile file(m_url);
if ( !file.open(IO_ReadOnly) )
return false;
- QTextStream stream( &file );
+ TQTextStream stream( &file );
m_type = Absolute;
m_bContainsRadix = false;
- m_picID = QString::null;
+ m_picID = TQString();
- QStringList nonAbsoluteOps = QStringList::split( ",",
+ TQStringList nonAbsoluteOps = TQStringList::split( ",",
"code,.def,.dim,.direct,endw,extern,.file,global,idata,.ident,.line,.type,udata,udata_acs,udata_ovr,udata_shr" );
unsigned inputAtLine = 0;
while ( !stream.atEnd() )
{
- const QString line = stream.readLine().stripWhiteSpace();
+ const TQString line = stream.readLine().stripWhiteSpace();
if ( m_type != Relocatable )
{
- QString col0 = line.section( QRegExp("[; ]"), 0, 0 );
+ TQString col0 = line.section( TQRegExp("[; ]"), 0, 0 );
col0 = col0.stripWhiteSpace();
- if ( nonAbsoluteOps.contains(col0) )
+ if ( nonAbsoluteOps.tqcontains(col0) )
m_type = Relocatable;
}
if ( !m_bContainsRadix )
{
- if ( line.contains( QRegExp("^RADIX[\\s]*") ) || line.contains( QRegExp("^radix[\\s]*") ) )
+ if ( line.tqcontains( TQRegExp("^RADIX[\\s]*") ) || line.tqcontains( TQRegExp("^radix[\\s]*") ) )
m_bContainsRadix = true;
}
if ( m_picID.isEmpty() )
{
// We look for "list p = ", and "list p = picid ", and subtract the positions / lengths away from each other to get the picid text position
- QRegExp fullRegExp("[lL][iI][sS][tT][\\s]+[pP][\\s]*=[\\s]*[\\d\\w]+");
- QRegExp halfRegExp("[lL][iI][sS][tT][\\s]+[pP][\\s]*=[\\s]*");
+ TQRegExp fullRegExp("[lL][iI][sS][tT][\\s]+[pP][\\s]*=[\\s]*[\\d\\w]+");
+ TQRegExp halfRegExp("[lL][iI][sS][tT][\\s]+[pP][\\s]*=[\\s]*");
int startPos = fullRegExp.search(line);
if ( (startPos != -1) && (startPos == halfRegExp.search(line)) )
@@ -81,15 +81,15 @@ bool AsmParser::parse( GpsimDebugger * debugger )
// Assembly file produced (by sdcc) from C, line is in format:
// ;#CSRC\t[file-name] [file-line]
// The filename can contain spaces.
- int fileLineAt = line.findRev(" ");
+ int fileLineAt = line.tqfindRev(" ");
if ( fileLineAt == -1 )
kdWarning() << k_funcinfo << "Syntax error in line \"" << line << "\" while looking for file-line" << endl;
else
{
// 7 = length_of(";#CSRC\t")
- QString fileName = line.mid( 7, fileLineAt-7 );
- QString fileLineString = line.mid( fileLineAt+1, line.length() - fileLineAt - 1 );
+ TQString fileName = line.mid( 7, fileLineAt-7 );
+ TQString fileLineString = line.mid( fileLineAt+1, line.length() - fileLineAt - 1 );
if ( fileName.startsWith("\"") )
{
@@ -111,19 +111,19 @@ bool AsmParser::parse( GpsimDebugger * debugger )
// Assembly file produced by either sdcc or microbe, line is in format:
// \t[".line"/"#MSRC"]\t[file-line]; [file-name]\t[c/microbe source code for that line]
// We're screwed if the file name contains tabs, but hopefully not many do...
- QStringList lineParts = QStringList::split( '\t', line );
+ TQStringList lineParts = TQStringList::split( '\t', line );
if ( lineParts.size() < 2 )
kdWarning() << k_funcinfo << "Line is in wrong format for extracing source line and file: \""<<line<<"\""<<endl;
else
{
- const QString lineAndFile = lineParts[1];
- int lineFileSplit = lineAndFile.find("; ");
+ const TQString lineAndFile = lineParts[1];
+ int lineFileSplit = lineAndFile.tqfind("; ");
if ( lineFileSplit == -1 )
kdDebug() << k_funcinfo << "Could not find file / line split in \""<<lineAndFile<<"\""<<endl;
else
{
- QString fileName = lineAndFile.mid( lineFileSplit + 2 );
- QString fileLineString = lineAndFile.left( lineFileSplit );
+ TQString fileName = lineAndFile.mid( lineFileSplit + 2 );
+ TQString fileLineString = lineAndFile.left( lineFileSplit );
if ( fileName.startsWith("\"") )
{