diff options
Diffstat (limited to 'microbe/parser.cpp')
-rw-r--r-- | microbe/parser.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/microbe/parser.cpp b/microbe/parser.cpp index 0bf3fea..0e5545d 100644 --- a/microbe/parser.cpp +++ b/microbe/parser.cpp @@ -203,7 +203,7 @@ Code * Parser::parse( const SourceLineList & lines ) TQString command; // e.g. "delay", "for", "subroutine", "increment", etc { - int spacepos = line.tqfind(' '); + int spacepos = line.find(' '); if ( spacepos >= 0 ) command = line.left( spacepos ); else @@ -218,7 +218,7 @@ Code * Parser::parse( const SourceLineList & lines ) m_code->append(new Instr_sourceCode("{")); // Use the first token in the line to look up the statement type - DefinitionMap::Iterator dmit = m_definitionMap.tqfind(command); + DefinitionMap::Iterator dmit = m_definitionMap.find(command); if(dmit == m_definitionMap.end()) { if( !processAssignment( (*sit).text() ) ) @@ -269,7 +269,7 @@ Code * Parser::parse( const SourceLineList & lines ) case (Field::Variable): case (Field::Name): { - newPosition = line.tqfind( ' ', position ); + newPosition = line.find( ' ', position ); if(position == newPosition) { newPosition = -1; @@ -303,12 +303,12 @@ Code * Parser::parse( const SourceLineList & lines ) { nextField = (*it); if(nextField.type() == Field::FixedString) - newPosition = line.tqfind(TQRegExp("\\b" + nextField.string() + "\\b")); + newPosition = line.find(TQRegExp("\\b" + nextField.string() + "\\b")); // Although code is not neccessarily braced, after an expression it is the only // sensilbe way to have it. else if(nextField.type() == Field::Code) { - newPosition = line.tqfind("{"); + newPosition = line.find("{"); if(newPosition == -1) newPosition = line.length() + 1; } else if(nextField.type() == Field::Newline) @@ -367,7 +367,7 @@ Code * Parser::parse( const SourceLineList & lines ) case (Field::FixedString): { // Is the string found, and is it starting in the right place? - int stringPosition = line.tqfind(TQRegExp("\\b"+field.string()+"\\b")); + int stringPosition = line.find(TQRegExp("\\b"+field.string()+"\\b")); if( stringPosition != position || stringPosition == -1 ) { if( !field.compulsory() ) @@ -402,7 +402,7 @@ Code * Parser::parse( const SourceLineList & lines ) if( nextField.type() == Field::FixedString ) { nextStatement = *(++StatementList::Iterator(sit)); - newPosition = nextStatement.text().tqfind(TQRegExp("\\b" + nextField.string() + "\\b")); + newPosition = nextStatement.text().find(TQRegExp("\\b" + nextField.string() + "\\b")); if(newPosition != 0) { // If the next field is optional just carry on as nothing happened, @@ -476,7 +476,7 @@ bool Parser::processAssignment(const TQString &line) // Look for port variables first. - if ( firstToken.tqcontains(".") ) + if ( firstToken.contains(".") ) { PortPin portPin = m_pPic->toPortPin( firstToken ); @@ -502,14 +502,14 @@ bool Parser::processAssignment(const TQString &line) if ( tokens[1] != "=" ) mistake( Microbe::UnassignedPort, tokens[1] ); - Expression( m_pPic, mb, m_currentSourceLine, false ).compileExpression(line.mid(line.tqfind("=")+1)); + Expression( m_pPic, mb, m_currentSourceLine, false ).compileExpression(line.mid(line.find("=")+1)); m_pPic->saveResultToVar( firstToken ); } else if ( m_pPic->isValidTris( firstToken ) ) { if( tokens[1] == "=" ) { - Expression( m_pPic, mb, m_currentSourceLine, false ).compileExpression(line.mid(line.tqfind("=")+1)); + Expression( m_pPic, mb, m_currentSourceLine, false ).compileExpression(line.mid(line.find("=")+1)); m_pPic->Stristate(firstToken); } } @@ -529,7 +529,7 @@ bool Parser::processAssignment(const TQString &line) // hasn't been defined yet. mb->addVariable( Variable( Variable::charType, firstToken ) ); - Expression( m_pPic, mb, m_currentSourceLine, false ).compileExpression(line.mid(line.tqfind("=")+1)); + Expression( m_pPic, mb, m_currentSourceLine, false ).compileExpression(line.mid(line.find("=")+1)); Variable v = mb->variable( firstToken ); switch ( v.type() ) @@ -676,7 +676,7 @@ void Parser::processStatement( const TQString & name, const OutputFieldMap & fie stepPositive = true; } - TQString variable = fieldMap["initExpression"].string().mid(0,fieldMap["initExpression"].string().tqfind("=")).stripWhiteSpace(); + TQString variable = fieldMap["initExpression"].string().mid(0,fieldMap["initExpression"].string().find("=")).stripWhiteSpace(); TQString endExpr = variable+ " <= " + fieldMap["toExpression"].string().stripWhiteSpace(); if( fieldMap["stepExpression"].found() ) @@ -1027,7 +1027,7 @@ OutputField::OutputField( const TQString & string/*, int lineNumber*/ ) { // only cope with 'sane' strings a.t.m. // e.g. include "filename.extenstion" - TQString filename = (*sit).content.mid( (*sit).content.tqfind("\"") ).stripWhiteSpace(); + TQString filename = (*sit).content.mid( (*sit).content.find("\"") ).stripWhiteSpace(); // don't strip whitespace from within quotes as you // can have filenames composed entirely of spaces (kind of weird)... // remove quotes. |