summaryrefslogtreecommitdiffstats
path: root/microbe/instruction.h
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 /microbe/instruction.h
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 'microbe/instruction.h')
-rw-r--r--microbe/instruction.h144
1 files changed, 72 insertions, 72 deletions
diff --git a/microbe/instruction.h b/microbe/instruction.h
index 2d43343..595dd16 100644
--- a/microbe/instruction.h
+++ b/microbe/instruction.h
@@ -21,10 +21,10 @@
#ifndef INSTRUCTION_H
#define INSTRUCTION_H
-#include <qmap.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qvaluelist.h>
+#include <tqmap.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqvaluelist.h>
class Code;
class CodeIterator;
@@ -32,7 +32,7 @@ class CodeConstIterator;
class Instruction;
class PIC14;
-typedef QValueList<Instruction*> InstructionList;
+typedef TQValueList<Instruction*> InstructionList;
/**
@@ -85,7 +85,7 @@ class Register
* Construct a Register with the given name. If the name is not
* recognized, then it is assumed to be a GPR register.
*/
- Register( const QString & name );
+ Register( const TQString & name );
/**
* Construct a Register with the given name. If the name is not
* recognized, then it is assumed to be a GPR register.
@@ -114,7 +114,7 @@ class Register
/**
* Returns the name of the register, or the alias for the GPR.
*/
- QString name() const { return m_name; }
+ TQString name() const { return m_name; }
/**
* @return the type of register.
*/
@@ -129,7 +129,7 @@ class Register
bool affectsExternal() const;
protected:
- QString m_name;
+ TQString m_name;
Type m_type;
};
@@ -189,7 +189,7 @@ class RegisterBit
/**
* Construct a register bit with the given name.
*/
- RegisterBit( const QString & name );
+ RegisterBit( const TQString & name );
/**
* Construct a register bit with the given name.
*/
@@ -211,7 +211,7 @@ class RegisterBit
/**
* @return the name of the bit, e.g. "Z" for Z.
*/
- QString name() const { return m_name; }
+ TQString name() const { return m_name; }
protected:
@@ -222,7 +222,7 @@ class RegisterBit
Register::Type m_registerType;
uchar m_bitPos:3;
- QString m_name;
+ TQString m_name;
};
@@ -377,7 +377,7 @@ class ProcessorState
RegisterState status;
protected:
- typedef QMap< Register, RegisterState > RegisterMap;
+ typedef TQMap< Register, RegisterState > RegisterMap;
/**
* All registers other than working and status. Entries are created on
* calls to reg with a new Register.
@@ -411,7 +411,7 @@ class ProcessorBehaviour
RegisterBehaviour status;
protected:
- typedef QMap< Register, RegisterBehaviour > RegisterMap;
+ typedef TQMap< Register, RegisterBehaviour > RegisterMap;
/**
* All registers other than working and status. Entries are created on
* calls to reg with a new Register.
@@ -448,7 +448,7 @@ class RegisterDepends
uchar status;
protected:
- typedef QMap< Register, uchar > RegisterMap;
+ typedef TQMap< Register, uchar > RegisterMap;
/**
* All registers other than working and status. Entries are created on
* calls to reg with a new Register.
@@ -492,12 +492,12 @@ class Code
* Queues a label to be given to the next instruction to be added in the
* given position
*/
- void queueLabel( const QString & label, InstructionPosition position = Middle );
+ void queueLabel( const TQString & label, InstructionPosition position = Middle );
/**
* Returns the list of queued labels for the given position. This is
* used in merging code, as we also need to merge any queued labels.
*/
- QStringList queuedLabels( InstructionPosition position ) const { return m_queuedLabels[position]; }
+ TQStringList queuedLabels( InstructionPosition position ) const { return m_queuedLabels[position]; }
/**
* Adds the Instruction at the given position.
*/
@@ -506,13 +506,13 @@ class Code
* @returns the Instruction with the given label (or null if no such
* Instruction).
*/
- Instruction * instruction( const QString & label ) const;
+ Instruction * instruction( const TQString & label ) const;
/**
* Look for an Assembly instruction (other types are ignored).
* @return an iterator to the current instruction, or end if it wasn't
* found.
*/
- iterator find( Instruction * instruction );
+ iterator tqfind( Instruction * instruction );
/**
* Removes the Instruction (regardless of position).
* @warning You should always use only this function to remove an
@@ -524,7 +524,7 @@ class Code
* Merges all the blocks output together with other magic such as adding
* variables, gpasm directives, etc.
*/
- QString generateCode( PIC14 * pic ) const;
+ TQString generateCode( PIC14 * pic ) const;
/**
* Appends the InstructionLists to the end of the ones in this instance.
* @param middleInsertionPosition is the position where the middle code
@@ -559,10 +559,10 @@ class Code
* Used when generating the code. Finds the list of general purpose
* registers that are referenced and returns their aliases.
*/
- QStringList findVariables() const;
+ TQStringList findVariables() const;
InstructionList m_instructionLists[ PositionCount ]; ///< @see InstructionPosition
- QStringList m_queuedLabels[ PositionCount ]; ///< @see InstructionPosition
+ TQStringList m_queuedLabels[ PositionCount ]; ///< @see InstructionPosition
private: // Disable copy constructor and operator=
Code( const Code & );
@@ -687,7 +687,7 @@ class Instruction
/**
* The text to output to the generated assembly.
*/
- virtual QString code() const = 0;
+ virtual TQString code() const = 0;
/**
* The input processor state is used to generate the outputlinks and the
* output processor state.
@@ -748,15 +748,15 @@ class Instruction
* with it - these will be printed before the instruction in the
* assembly output.
*/
- QStringList labels() const { return m_labels; }
+ TQStringList labels() const { return m_labels; }
/**
* @see labels
*/
- void addLabels( const QStringList & labels );
+ void addLabels( const TQStringList & labels );
/**
* @see labels
*/
- void setLabels( const QStringList & labels );
+ void setLabels( const TQStringList & labels );
/**
* @see used
*/
@@ -824,7 +824,7 @@ class Instruction
* This function is provided for instructions that jump to a label (i.e.
* call and goto).
*/
- void makeLabelOutputLink( const QString & label );
+ void makeLabelOutputLink( const TQString & label );
RegisterDepends m_registerDepends;
bool m_bInputStateChanged;
@@ -832,13 +832,13 @@ class Instruction
bool m_bPositionAffectsBranching;
InstructionList m_inputLinks;
InstructionList m_outputLinks;
- QStringList m_labels;
+ TQStringList m_labels;
Code * m_pCode;
// Commonly needed member variables for assembly instructions
Register m_file;
RegisterBit m_bit;
- QString m_raw; // Used by source code, raw asm, etc
+ TQString m_raw; // Used by source code, raw asm, etc
uchar m_literal;
unsigned m_dest:1; // is 0 (W) or 1 (file).
ProcessorState m_inputState;
@@ -856,7 +856,7 @@ class Instr_addwf : public Instruction
{
public:
Instr_addwf( const Register & file, int dest ) { m_file = file; m_dest = dest; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return FileOriented; }
@@ -867,7 +867,7 @@ class Instr_andwf : public Instruction
{
public:
Instr_andwf( const Register & file, int dest ) { m_file = file; m_dest = dest; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return FileOriented; }
@@ -878,7 +878,7 @@ class Instr_clrf : public Instruction
{
public:
Instr_clrf( const Register & file ) { m_file = file; m_dest = 1; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return FileOriented; }
@@ -893,7 +893,7 @@ class Instr_decf : public Instruction
{
public:
Instr_decf( const Register & file, int dest ) { m_file = file; m_dest = dest; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return FileOriented; }
@@ -904,7 +904,7 @@ class Instr_decfsz : public Instruction
{
public:
Instr_decfsz( const Register & file, int dest ) { m_file = file; m_dest = dest; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return FileOriented; }
@@ -915,7 +915,7 @@ class Instr_incf : public Instruction
{
public:
Instr_incf( const Register & file, int dest ) { m_file = file; m_dest = dest; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return FileOriented; }
@@ -929,7 +929,7 @@ class Instr_iorwf : public Instruction
{
public:
Instr_iorwf( const Register & file, int dest ) { m_file = file; m_dest = dest; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return FileOriented; }
@@ -940,7 +940,7 @@ class Instr_movf : public Instruction
{
public:
Instr_movf( const Register & file, int dest ) { m_file = file; m_dest = dest; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return FileOriented; }
@@ -951,7 +951,7 @@ class Instr_movwf : public Instruction
{
public:
Instr_movwf( const Register & file ) { m_file = file; m_dest = 1; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return FileOriented; }
@@ -965,7 +965,7 @@ class Instr_rlf : public Instruction
{
public:
Instr_rlf( const Register & file, int dest ) { m_file = file; m_dest = dest; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return FileOriented; }
@@ -976,7 +976,7 @@ class Instr_rrf : public Instruction
{
public:
Instr_rrf( const Register & file, int dest ) { m_file = file; m_dest = dest; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return FileOriented; }
@@ -987,7 +987,7 @@ class Instr_subwf : public Instruction
{
public:
Instr_subwf( const Register & file, int dest ) { m_file = file; m_dest = dest; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return FileOriented; }
@@ -998,7 +998,7 @@ class Instr_swapf : public Instruction
{
public:
Instr_swapf( const Register & file, int dest ) { m_file = file; m_dest = dest; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return FileOriented; }
@@ -1009,7 +1009,7 @@ class Instr_xorwf : public Instruction
{
public:
Instr_xorwf( const Register & file, int dest ) { m_file = file; m_dest = dest; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return FileOriented; }
@@ -1023,7 +1023,7 @@ class Instr_bcf : public Instruction
{
public:
Instr_bcf( const Register & file, const RegisterBit & bit ) { m_file = file; m_bit = bit; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return BitOriented; }
@@ -1034,7 +1034,7 @@ class Instr_bsf : public Instruction
{
public:
Instr_bsf( const Register & file, const RegisterBit & bit ) { m_file = file; m_bit = bit; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return BitOriented; }
@@ -1045,7 +1045,7 @@ class Instr_btfsc : public Instruction
{
public:
Instr_btfsc( const Register & file, const RegisterBit & bit ) { m_file = file; m_bit = bit; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return Other; }
@@ -1056,7 +1056,7 @@ class Instr_btfss : public Instruction
{
public:
Instr_btfss( const Register & file, const RegisterBit & bit ) { m_file = file; m_bit = bit; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return Other; }
@@ -1070,7 +1070,7 @@ class Instr_addlw : public Instruction
{
public:
Instr_addlw( int literal ) { m_literal = literal; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return WorkingOriented; }
@@ -1082,7 +1082,7 @@ class Instr_andlw : public Instruction
{
public:
Instr_andlw( int literal ) { m_literal = literal; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return WorkingOriented; }
@@ -1092,8 +1092,8 @@ class Instr_andlw : public Instruction
class Instr_call : public Instruction
{
public:
- Instr_call( const QString & label ) { m_label = label; }
- virtual QString code() const;
+ Instr_call( const TQString & label ) { m_label = label; }
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return Other; }
@@ -1107,8 +1107,8 @@ class Instr_call : public Instruction
*/
void makeReturnLinks( Instruction * next );
- QString label() const { return m_label; }
- void setLabel( const QString & label ) { m_label = label; }
+ TQString label() const { return m_label; }
+ void setLabel( const TQString & label ) { m_label = label; }
protected:
/**
@@ -1121,7 +1121,7 @@ class Instr_call : public Instruction
*/
void linkReturns( Instruction * current, Instruction * returnPoint );
- QString m_label;
+ TQString m_label;
};
@@ -1131,17 +1131,17 @@ class Instr_call : public Instruction
class Instr_goto : public Instruction
{
public:
- Instr_goto( const QString & label ) { m_label = label; }
- virtual QString code() const;
+ Instr_goto( const TQString & label ) { m_label = label; }
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return Other; }
- QString label() const { return m_label; }
- void setLabel( const QString & label ) { m_label = label; }
+ TQString label() const { return m_label; }
+ void setLabel( const TQString & label ) { m_label = label; }
protected:
- QString m_label;
+ TQString m_label;
};
@@ -1149,7 +1149,7 @@ class Instr_iorlw : public Instruction
{
public:
Instr_iorlw( int literal ) { m_literal = literal; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return WorkingOriented; }
@@ -1160,7 +1160,7 @@ class Instr_movlw : public Instruction
{
public:
Instr_movlw( int literal ) { m_literal = literal; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return WorkingOriented; }
@@ -1171,7 +1171,7 @@ class Instr_retfie : public Instruction
{
public:
Instr_retfie() {};
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return Other; }
@@ -1182,7 +1182,7 @@ class Instr_retlw : public Instruction
{
public:
Instr_retlw( int literal ) { m_literal = literal; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return Other; }
@@ -1193,7 +1193,7 @@ class Instr_return : public Instruction
{
public:
Instr_return() {};
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return Other; }
@@ -1204,7 +1204,7 @@ class Instr_sleep : public Instruction
{
public:
Instr_sleep() {};
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return Other; }
@@ -1215,7 +1215,7 @@ class Instr_sublw : public Instruction
{
public:
Instr_sublw( int literal ) { m_literal = literal; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return WorkingOriented; }
@@ -1226,7 +1226,7 @@ class Instr_xorlw : public Instruction
{
public:
Instr_xorlw( int literal ) { m_literal = literal; }
- virtual QString code() const;
+ virtual TQString code() const;
virtual void generateLinksAndStates( Code::iterator current );
virtual ProcessorBehaviour behaviour() const;
virtual AssemblyType assemblyType() const { return WorkingOriented; }
@@ -1239,8 +1239,8 @@ class Instr_xorlw : public Instruction
class Instr_sourceCode : public Instruction
{
public:
- Instr_sourceCode( const QString & source ) { m_raw = source; }
- virtual QString code() const;
+ Instr_sourceCode( const TQString & source ) { m_raw = source; }
+ virtual TQString code() const;
virtual InstructionType type() const { return Comment; }
virtual AssemblyType assemblyType() const { return None; }
};
@@ -1249,8 +1249,8 @@ class Instr_sourceCode : public Instruction
class Instr_asm : public Instruction
{
public:
- Instr_asm( const QString & raw ) { m_raw = raw; }
- virtual QString code() const;
+ Instr_asm( const TQString & raw ) { m_raw = raw; }
+ virtual TQString code() const;
virtual InstructionType type() const { return Raw; }
virtual AssemblyType assemblyType() const { return None; }
};
@@ -1261,8 +1261,8 @@ class Instr_asm : public Instruction
class Instr_raw : public Instruction
{
public:
- Instr_raw( const QString & raw ) { m_raw = raw; }
- virtual QString code() const;
+ Instr_raw( const TQString & raw ) { m_raw = raw; }
+ virtual TQString code() const;
virtual InstructionType type() const { return Raw; }
virtual AssemblyType assemblyType() const { return None; }
};