EgtGeneral 1.5d4 :

- aggiunto param. bSkipEmptyLine a Init di Scanner
- aggiunto a TSC comando EXEC con sottocomandi SKIP, DO e STOP.
This commit is contained in:
Dario Sassi
2014-04-21 21:53:35 +00:00
parent 230352742d
commit d8f3704d20
4 changed files with 66 additions and 7 deletions
+7 -3
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2013-2014
//----------------------------------------------------------------------------
// File : Scan.cpp Data : 06.03.14 Versione : 1.5c1
// File : Scan.cpp Data : 17.04.14 Versione : 1.5d
// Contenuto : Implementazione della classe Scanner.
// Scansione di file di testo con codifica UTF-8 (anche con BOM)
// e quindi anche ASCII.
@@ -9,6 +9,7 @@
//
// Modifiche : 30.09.13 DS Creazione modulo.
// 06.03.14 DS Aggiunta UngetLine.
// 17.04.14 DS Aggiunto parametro bSkipEmptyLine a Init.
//
//----------------------------------------------------------------------------
@@ -23,7 +24,7 @@ using namespace std ;
//----------------------------------------------------------------------------
bool
Scanner::Init( const std::string& sFile, const char* szRemInit)
Scanner::Init( const std::string& sFile, const char* szRemInit, bool bSkipEmptyLine)
{
// apertura del file di ingresso
m_InFile.open( stringtoW( sFile), ios::in) ;
@@ -42,6 +43,9 @@ Scanner::Init( const std::string& sFile, const char* szRemInit)
else
m_sRemInit = "//" ;
// assegno flag per saltare linee vuote
m_bSkipEmptyLine = bSkipEmptyLine ;
return ( ! m_InFile.fail()) ;
}
@@ -79,7 +83,7 @@ Scanner::GetLine( string& sLine)
TrimUtf8Bom( sLine) ;
Trim( sLine) ;
m_nLineNbr ++ ;
} while ( sLine.empty() || sLine.find( m_sRemInit) == 0) ;
} while ( ( m_bSkipEmptyLine && sLine.empty()) || sLine.find( m_sRemInit) == 0) ;
m_nDeltaLineUnget = m_nLineNbr - nOldLineNbr ;
}
return true ;