diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-29 16:05:55 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-29 16:05:55 +0000 |
commit | 87a016680e3677da3993f333561e79eb0cead7d5 (patch) | |
tree | cbda2b4df8b8ee0d8d1617e6c75bec1e3ee0ccba /microbe/microbe.h | |
parent | 6ce3d1ad09c1096b5ed3db334e02859e45d5c32b (diff) | |
download | ktechlab-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/microbe.h')
-rw-r--r-- | microbe/microbe.h | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/microbe/microbe.h b/microbe/microbe.h index efa7aa4..c97417a 100644 --- a/microbe/microbe.h +++ b/microbe/microbe.h @@ -25,21 +25,21 @@ #include <variable.h> // #include <pic14.h> -#include <qmap.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqmap.h> +#include <tqstring.h> +#include <tqstringlist.h> -class QString; +class TQString; class BTreeBase; class BTreeNode; class Code; class PIC14; class PortPin; -typedef QValueList<PortPin> PortPinList; +typedef TQValueList<PortPin> PortPinList; -typedef QValueList<Variable> VariableList; -typedef QMap<QString,QString> AliasMap; +typedef TQValueList<Variable> VariableList; +typedef TQMap<TQString,TQString> AliasMap; enum ExprType { @@ -53,7 +53,7 @@ enum ExprType class SourceLine; -typedef QValueList<SourceLine> SourceLineList; +typedef TQValueList<SourceLine> SourceLineList; /** Represents a source line, with the convention of line number starting at zero. @author David Saxton @@ -62,26 +62,26 @@ class SourceLine { public: /** - * The QValueList template requires a default constructor - calling this + * The TQValueList template requires a default constructor - calling this * though creates an invalid SourceLine with line() returning -1. So * this constructor should never be used. */ SourceLine(); - SourceLine( const QString & text, const QString & url, int line ); + SourceLine( const TQString & text, const TQString & url, int line ); - QString text() const { return m_text; } - QString url() const { return m_url; } + TQString text() const { return m_text; } + TQString url() const { return m_url; } int line() const { return m_line; } /** * Extracts the text from each SourceLine and adds it to the - * returned QStringList. + * returned TQStringList. */ - static QStringList toStringList( const SourceLineList & lines ); + static TQStringList toStringList( const SourceLineList & lines ); protected: - QString m_text; - QString m_url; + TQString m_text; + TQString m_url; int m_line; }; @@ -140,32 +140,32 @@ class Microbe * Returns a list of errors occured during compilation, intended for * outputting to stderr. */ - QString errorReport() const { return m_errorReport; } + TQString errorReport() const { return m_errorReport; } /** * Call this to compile the given code. This serves as the top level of * recursion as it performs initialisation of things, to recurse at * levels use parseUsingChild(), or create your own Parser. * @param url is used for reporting errors */ - QString compile( const QString & url, bool showSource, bool optimize ); + TQString compile( const TQString & url, bool showSource, bool optimize ); /** * Adds the given compiler error at the file line number to the * compilation report. */ - void compileError( MistakeType type, const QString & context, const SourceLine & sourceLine ); + void compileError( MistakeType type, const TQString & context, const SourceLine & sourceLine ); /** * This is for generating unique numbers for computer generated labels. */ - QString uniqueLabel() { return QString("__%1").arg(m_uniqueLabel++); } + TQString uniqueLabel() { return TQString("__%1").tqarg(m_uniqueLabel++); } /** * If alias is an alias for something then it returns that something, * otherwise it just returns alias (which in that case is not an alias!) */ - QString alias( const QString & alias ) const; + TQString alias( const TQString & alias ) const; /** * Aliases the name to the dest. */ - void addAlias( const QString & name, const QString & dest ); + void addAlias( const TQString & name, const TQString & dest ); /** * Tell Microbe that a minimum of the given delay routine needs to be * created. @@ -182,15 +182,15 @@ class Microbe * Add the interrupt as being used, i.e. make sure there is one and only * one occurance of its name in m_usedInterrupts. */ - void setInterruptUsed( const QString & interruptName ); + void setInterruptUsed( const TQString & interruptName ); /** * @returns whether the given interrupt has already been used. */ - bool isInterruptUsed( const QString & interruptName ); + bool isInterruptUsed( const TQString & interruptName ); /** * @returns whether the variable name is valid. */ - static bool isValidVariableName( const QString & variableName ); + static bool isValidVariableName( const TQString & variableName ); /** * Appends the given variable name to the variable list. */ @@ -199,15 +199,15 @@ class Microbe * @returns the variable with the given name, or one of invalidType if * no such variable exists. */ - Variable variable( const QString & variableName ) const; + Variable variable( const TQString & variableName ) const; /** * @returns whether the variable has been declared yet. */ - bool isVariableKnown( const QString & variableName ) const; + bool isVariableKnown( const TQString & variableName ) const; /** * This is used as a temporary variable while evaluating an expression. */ - QString dest() const; + TQString dest() const; void incDest(); void decDest(); void resetDest(); @@ -219,9 +219,9 @@ class Microbe */ void simplifyProgram(); - QStringList m_usedInterrupts; + TQStringList m_usedInterrupts; SourceLineList m_program; - QString m_errorReport; + TQString m_errorReport; int m_uniqueLabel; VariableList m_variables; int m_dest; @@ -234,7 +234,7 @@ class Microbe * alias ken bob * alias mary bob */ - QMap<QString,QString> m_aliasList; + TQMap<TQString,TQString> m_aliasList; /** * Once the child parser has found it, this is set to the pic type * string found in the source file. The pic type directive must be |