diff options
author | Noel Grandin <noel@peralex.com> | 2016-02-11 14:33:36 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-02-11 14:47:01 +0200 |
commit | 4e13a6911259d3d7d23b61cb76614263608bbd95 (patch) | |
tree | 7dcd289f650a0a179b6ab3fd2934dea2252c42d5 /idl | |
parent | 489dd9027f53e6328f281bf087bb5a59246f9500 (diff) |
use exceptions for error handling in .SDI parsing
to simplify the normal control flow
Change-Id: If325ec0507a51d8e2d3340fc5b628bb75a078a44
Diffstat (limited to 'idl')
-rw-r--r-- | idl/inc/basobj.hxx | 2 | ||||
-rw-r--r-- | idl/inc/database.hxx | 15 | ||||
-rw-r--r-- | idl/inc/slot.hxx | 2 | ||||
-rw-r--r-- | idl/inc/types.hxx | 2 | ||||
-rw-r--r-- | idl/source/objects/basobj.cxx | 2 | ||||
-rw-r--r-- | idl/source/objects/bastype.cxx | 13 | ||||
-rw-r--r-- | idl/source/objects/module.cxx | 72 | ||||
-rw-r--r-- | idl/source/objects/object.cxx | 51 | ||||
-rw-r--r-- | idl/source/objects/slot.cxx | 65 | ||||
-rw-r--r-- | idl/source/objects/types.cxx | 20 | ||||
-rw-r--r-- | idl/source/prj/command.cxx | 12 | ||||
-rw-r--r-- | idl/source/prj/database.cxx | 75 |
12 files changed, 137 insertions, 194 deletions
diff --git a/idl/inc/basobj.hxx b/idl/inc/basobj.hxx index 8b301264479a..12a1dc769c19 100644 --- a/idl/inc/basobj.hxx +++ b/idl/inc/basobj.hxx @@ -103,7 +103,7 @@ public: void SetName( const OString& rName ); virtual const OString & GetName() const { return aName; } - virtual bool Test( SvIdlDataBase &, SvTokenStream & rInStm ); + virtual bool Test( SvTokenStream & rInStm ); virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ); }; diff --git a/idl/inc/database.hxx b/idl/inc/database.hxx index 3b7f15f02534..22d6b7801f4b 100644 --- a/idl/inc/database.hxx +++ b/idl/inc/database.hxx @@ -28,6 +28,7 @@ #include <rtl/ustring.hxx> #include <set> +#include <exception> class SvCommand; @@ -53,6 +54,16 @@ public: } }; +class SvParseException : public std::exception +{ +public: + SvIdlError aError; + SvParseException( SvTokenStream & rInStm, const OString& rError ); + SvParseException( const OString& rError, SvToken& rTok ); +}; + + + class SvIdlDataBase { bool bExport; @@ -106,10 +117,6 @@ public: SvRefMemberList<SvMetaObject *>& GetStack() { return aContextStack; } void Write(const OString& rText); - static void WriteError(const OString& rErrWrn, - const OString& rFileName, - const OString& rErrorText, - sal_uLong nRow = 0, sal_uLong nColumn = 0 ); void WriteError( SvTokenStream & rInStm ); void SetError( const OString& rError, SvToken& rTok ); void SetAndWriteError( SvTokenStream & rInStm, const OString& rError ); diff --git a/idl/inc/slot.hxx b/idl/inc/slot.hxx index 8c838ad02633..93f127dd2a7a 100644 --- a/idl/inc/slot.hxx +++ b/idl/inc/slot.hxx @@ -136,7 +136,7 @@ public: void ResetSlotPointer() { pNextSlot = pLinkedSlot = nullptr; } - virtual bool Test( SvIdlDataBase &, SvTokenStream & rInStm ) override; + virtual bool Test( SvTokenStream & rInStm ) override; virtual void ReadAttributesSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm ) override; virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override; diff --git a/idl/inc/types.hxx b/idl/inc/types.hxx index 34f12d740db2..748dc6ef637d 100644 --- a/idl/inc/types.hxx +++ b/idl/inc/types.hxx @@ -45,7 +45,7 @@ public: const SvIdentifier& GetSlotId() const; SvMetaType * GetType() const; - virtual bool Test( SvIdlDataBase &, SvTokenStream & rInStm ) override; + virtual bool Test( SvTokenStream & rInStm ) override; virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override; sal_uLong MakeSfx( OStringBuffer& rAtrrArray ); virtual void Insert( SvSlotElementList&, const OString& rPrefix, diff --git a/idl/source/objects/basobj.cxx b/idl/source/objects/basobj.cxx index 797b84926664..62632a7e528a 100644 --- a/idl/source/objects/basobj.cxx +++ b/idl/source/objects/basobj.cxx @@ -108,7 +108,7 @@ void SvMetaObject::ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & ) { } -bool SvMetaObject::Test( SvIdlDataBase &, SvTokenStream & ) +bool SvMetaObject::Test( SvTokenStream & ) { return true; } diff --git a/idl/source/objects/bastype.cxx b/idl/source/objects/bastype.cxx index ce1d8f379c66..d200f682939d 100644 --- a/idl/source/objects/bastype.cxx +++ b/idl/source/objects/bastype.cxx @@ -94,16 +94,11 @@ void SvIdentifier::ReadSvIdl( SvIdlDataBase & rBase, if( rTok.IsIdentifier() ) { sal_uLong n; - if( rBase.FindId( rTok.GetString(), &n ) ) - { - setString(rTok.GetString()); - nValue = n; - return; - } - else - { + if( !rBase.FindId( rTok.GetString(), &n ) ) rBase.SetAndWriteError( rInStm, "no value for identifier <" + getString() + "> " ); - } + setString(rTok.GetString()); + nValue = n; + return; } rInStm.Seek( nTokPos ); } diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx index 29ce9721cbbe..2062f05f633e 100644 --- a/idl/source/objects/module.cxx +++ b/idl/source/objects/module.cxx @@ -40,12 +40,9 @@ void SvMetaModule::ReadAttributesSvIdl( SvIdlDataBase & rBase, if( ReadStringSvIdl( SvHash_SlotIdFile(), rInStm, aSlotIdFile ) ) { - sal_uInt32 nTokPos = rInStm.Tell(); if( !rBase.ReadIdFile( OStringToOUString(aSlotIdFile, RTL_TEXTENCODING_ASCII_US)) ) { - rBase.SetAndWriteError( rInStm, "cannot read file: " + aSlotIdFile ); - - rInStm.Seek( nTokPos ); + throw SvParseException( rInStm, "cannot read file: " + aSlotIdFile ); } } } @@ -96,48 +93,41 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase, OUString aFullName(OStringToOUString(rTok.GetString(), RTL_TEXTENCODING_ASCII_US)); rBase.StartNewFile( aFullName ); osl::FileBase::RC searchError = osl::File::searchFileURL(aFullName, rBase.GetPath(), aFullName); + if( osl::FileBase::E_None != searchError ) + { + OStringBuffer aStr("cannot find file:"); + aStr.append(OUStringToOString(aFullName, RTL_TEXTENCODING_UTF8)); + throw SvParseException(aStr.makeStringAndClear(), rTok); + } osl::FileBase::getSystemPathFromFileURL( aFullName, aFullName ); + rBase.AddDepFile( aFullName ); + SvTokenStream aTokStm( aFullName ); - if( osl::FileBase::E_None == searchError ) + if( SVSTREAM_OK != aTokStm.GetStream().GetError() ) { - rBase.AddDepFile( aFullName ); - SvTokenStream aTokStm( aFullName ); - - if( SVSTREAM_OK == aTokStm.GetStream().GetError() ) - { - // rescue error from old file - SvIdlError aOldErr = rBase.GetError(); - // reset error - rBase.SetError( SvIdlError() ); - - sal_uInt32 nBeginPos = 0xFFFFFFFF; // can not happen with Tell - while( nBeginPos != aTokStm.Tell() ) - { - nBeginPos = aTokStm.Tell(); - ReadContextSvIdl( rBase, aTokStm ); - aTokStm.ReadDelimiter(); - } - bOk = aTokStm.GetToken().IsEof(); - if( !bOk ) - { - rBase.WriteError( aTokStm ); - } - // recover error from old file - rBase.SetError( aOldErr ); - } - else - { - OStringBuffer aStr("cannot open file: "); - aStr.append(OUStringToOString(aFullName, RTL_TEXTENCODING_UTF8)); - rBase.SetError(aStr.makeStringAndClear(), rTok); - } + OStringBuffer aStr("cannot open file: "); + aStr.append(OUStringToOString(aFullName, RTL_TEXTENCODING_UTF8)); + throw SvParseException(aStr.makeStringAndClear(), rTok); } - else + // rescue error from old file + SvIdlError aOldErr = rBase.GetError(); + // reset error + rBase.SetError( SvIdlError() ); + + sal_uInt32 nBeginPos = 0xFFFFFFFF; // can not happen with Tell + while( nBeginPos != aTokStm.Tell() ) { - OStringBuffer aStr("cannot find file:"); - aStr.append(OUStringToOString(aFullName, RTL_TEXTENCODING_UTF8)); - rBase.SetError(aStr.makeStringAndClear(), rTok); + nBeginPos = aTokStm.Tell(); + ReadContextSvIdl( rBase, aTokStm ); + aTokStm.ReadDelimiter(); + } + bOk = aTokStm.GetToken().IsEof(); + if( !bOk ) + { + rBase.WriteError( aTokStm ); } + // recover error from old file + rBase.SetError( aOldErr ); } if( !bOk ) rInStm.Seek( nTokPos ); @@ -148,7 +138,7 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase, if( xSlot->ReadSvIdl( rBase, rInStm ) ) { - if( xSlot->Test( rBase, rInStm ) ) + if( xSlot->Test( rInStm ) ) { // announce globally rBase.AppendSlot( xSlot ); diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx index 697fe9f291b2..396eedaaebfe 100644 --- a/idl/source/objects/object.cxx +++ b/idl/source/objects/object.cxx @@ -48,25 +48,19 @@ void SvMetaClass::ReadContextSvIdl( SvIdlDataBase & rBase, if( rTok.Is( SvHash_import() ) ) { SvMetaClass * pClass = rBase.ReadKnownClass( rInStm ); - if( pClass ) + if( !pClass ) + throw SvParseException( rInStm, "unknown imported interface" ); + SvClassElement xEle; + xEle.SetClass( pClass ); + aClassElementList.push_back( xEle ); + + rTok = rInStm.GetToken(); + if( rTok.IsString() ) { - SvClassElement xEle; - xEle.SetClass( pClass ); - aClassElementList.push_back( xEle ); - - rTok = rInStm.GetToken(); - if( rTok.IsString() ) - { - xEle.SetPrefix( rTok.GetString() ); - rInStm.GetToken_Next(); - } - return; - } - else - { - // set error - rBase.SetAndWriteError( rInStm, "unknown imported interface" ); + xEle.SetPrefix( rTok.GetString() ); + rInStm.GetToken_Next(); } + return; } else { @@ -79,13 +73,13 @@ void SvMetaClass::ReadContextSvIdl( SvIdlDataBase & rBase, { xAttr = new SvMetaSlot( pType ); if( xAttr->ReadSvIdl( rBase, rInStm ) ) - bOk = xAttr->Test( rBase, rInStm ); + bOk = xAttr->Test( rInStm ); } else { xAttr = new SvMetaAttribute( pType ); if( xAttr->ReadSvIdl( rBase, rInStm ) ) - bOk = xAttr->Test( rBase, rInStm ); + bOk = xAttr->Test( rInStm ); } if( bOk ) @@ -118,8 +112,7 @@ bool SvMetaClass::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm ) bOk = aSuperClass.Is(); if( !bOk ) { - // set error - rBase.SetAndWriteError( rInStm, "unknown super class" ); + throw SvParseException( rInStm, "unknown super class" ); } } if( bOk ) @@ -151,13 +144,7 @@ bool SvMetaClass::TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInStm, // values have to match if( pS->GetSlotId().GetValue() != rAttr.GetSlotId().GetValue() ) { - OSL_FAIL( "Same Name in MetaClass : " ); - OSL_FAIL( pS->GetName().getStr() ); - OSL_FAIL( pS->GetSlotId().getString().getStr() ); - OSL_FAIL( rAttr.GetSlotId().getString().getStr() ); - - rBase.SetAndWriteError(rInStm, "Attribute's " + pS->GetName() + " with different id's"); - return false; + throw SvParseException( rInStm, "Attribute's " + pS->GetName() + " with different id's"); } } else @@ -166,14 +153,8 @@ bool SvMetaClass::TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInStm, sal_uInt32 nId2 = rAttr.GetSlotId().GetValue(); if( nId1 == nId2 && nId1 != 0 ) { - OSL_FAIL( "Gleiche Id in MetaClass : " ); - OSL_FAIL(OString::number(pS->GetSlotId().GetValue()).getStr()); - OSL_FAIL( pS->GetSlotId().getString().getStr() ); - OSL_FAIL( rAttr.GetSlotId().getString().getStr() ); - OString aStr = "Attribute " + pS->GetName() + " and Attribute " + rAttr.GetName() + " with equal id's"; - rBase.SetAndWriteError(rInStm, aStr); - return false; + throw SvParseException(rInStm, aStr); } } } diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx index 72463693f21b..60960d2e5c74 100644 --- a/idl/source/objects/slot.cxx +++ b/idl/source/objects/slot.cxx @@ -286,15 +286,11 @@ void SvMetaSlot::ReadAttributesSvIdl( SvIdlDataBase & rBase, if( rInStm.Read( '=' ) ) { aSlotType = rBase.ReadKnownType( rInStm ); - if( aSlotType.Is() ) - { - if( aSlotType->IsItem() ) - { - return; - } - rBase.SetAndWriteError( rInStm, "the SlotType is not a item" ); - } - rBase.SetAndWriteError( rInStm, "SlotType with unknown item type" ); + if( !aSlotType.Is() ) + throw SvParseException( rInStm, "SlotType with unknown item type" ); + if( !aSlotType->IsItem() ) + throw SvParseException( rInStm, "the SlotType is not a item" ); + return; } } rInStm.Seek( nTokPos ); @@ -312,7 +308,7 @@ void SvMetaSlot::ReadAttributesSvIdl( SvIdlDataBase & rBase, if( aMethod->IsMethod() ) { aMethod->SetSlotId( GetSlotId() ); - if( aMethod->Test( rBase, rInStm ) ) + if( aMethod->Test( rInStm ) ) return; } rInStm.Seek( nTokPos ); @@ -323,9 +319,9 @@ void SvMetaSlot::ReadAttributesSvIdl( SvIdlDataBase & rBase, } } -bool SvMetaSlot::Test( SvIdlDataBase & rBase, SvTokenStream & rInStm ) +bool SvMetaSlot::Test( SvTokenStream & rInStm ) { - bool bOk = SvMetaAttribute::Test( rBase, rInStm ); + bool bOk = SvMetaAttribute::Test( rInStm ); if( bOk ) { SvMetaType * pType = GetType(); @@ -333,8 +329,7 @@ bool SvMetaSlot::Test( SvIdlDataBase & rBase, SvTokenStream & rInStm ) pType = pType->GetReturnType(); if( !pType->IsItem() ) { - rBase.SetAndWriteError( rInStm, "this attribute is not a slot" ); - bOk = false; + throw SvParseException( rInStm, "this attribute is not a slot" ); } } @@ -351,17 +346,11 @@ bool SvMetaSlot::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm ) { // c SvMetaSlot * pKnownSlot = dynamic_cast<SvMetaSlot*>( pAttr ); - if( pKnownSlot ) - { - SetRef( pKnownSlot ); - SetName( pKnownSlot->GetName() ); - bOk = SvMetaObject::ReadSvIdl( rBase, rInStm ); - } - else - { - rBase.SetAndWriteError( rInStm, "attribute " + pAttr->GetName() + " is method or variable but not a slot" ); - bOk = false; - } + if( !pKnownSlot ) + throw SvParseException( rInStm, "attribute " + pAttr->GetName() + " is method or variable but not a slot" ); + SetRef( pKnownSlot ); + SetName( pKnownSlot->GetName() ); + bOk = SvMetaObject::ReadSvIdl( rBase, rInStm ); } else { @@ -372,25 +361,19 @@ bool SvMetaSlot::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm ) { // for testing purposes: reference in case of complete definition SvMetaSlot * pKnownSlot = dynamic_cast<SvMetaSlot*>( pAttr2 ); - if( pKnownSlot ) - { - SetRef( pKnownSlot ); - - // names may differ, because explicitly given - if ( pKnownSlot->GetName() != GetName() ) - { - OSL_FAIL("Illegal definition!"); - rInStm.Seek( nTokPos ); - return false; - } + if( !pKnownSlot ) + throw SvParseException( rInStm, "attribute " + pAttr2->GetName() + " is method or variable but not a slot" ); + SetRef( pKnownSlot ); - SetName( pKnownSlot->GetName() ); - } - else + // names may differ, because explicitly given + if ( pKnownSlot->GetName() != GetName() ) { - rBase.SetAndWriteError( rInStm, "attribute " + pAttr2->GetName() + " is method or variable but not a slot" ); - bOk = false; + OSL_FAIL("Illegal definition!"); + rInStm.Seek( nTokPos ); + return false; } + + SetName( pKnownSlot->GetName() ); } } diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx index 393eb42c58bb..f0bf9d6ac50a 100644 --- a/idl/source/objects/types.cxx +++ b/idl/source/objects/types.cxx @@ -50,13 +50,12 @@ const SvIdentifier & SvMetaAttribute::GetSlotId() const return static_cast<SvMetaAttribute *>(GetRef())->GetSlotId(); } -bool SvMetaAttribute::Test( SvIdlDataBase & rBase, - SvTokenStream & rInStm ) +bool SvMetaAttribute::Test( SvTokenStream & rInStm ) { bool bOk = true; if( GetType()->IsItem() && !GetSlotId().IsSet() ) { - rBase.SetAndWriteError( rInStm, "slot without id declared" ); + throw SvParseException( rInStm, "slot without id declared" ); bOk = false; } return bOk; @@ -199,15 +198,10 @@ bool SvMetaType::ReadHeaderSvIdl( SvIdlDataBase & rBase, bIsItem = true; SvMetaType * pType = rBase.ReadKnownType( rInStm ); - if( pType ) - { - SetRef( pType ); - bOk = ReadNameSvIdl( rInStm ); - } - else - { - rBase.SetAndWriteError( rInStm, "wrong typedef: "); - } + if( !pType ) + throw SvParseException( rInStm, "wrong typedef: "); + SetRef( pType ); + bOk = ReadNameSvIdl( rInStm ); } if( !bOk ) rInStm.Seek( nTokPos ); @@ -236,7 +230,7 @@ void SvMetaType::ReadContextSvIdl( SvIdlDataBase & rBase, tools::SvRef<SvMetaAttribute> xAttr( new SvMetaAttribute() ); if( xAttr->ReadSvIdl( rBase, rInStm ) ) { - if( xAttr->Test( rBase, rInStm ) ) + if( xAttr->Test( rInStm ) ) GetAttrList().push_back( xAttr ); } } diff --git a/idl/source/prj/command.cxx b/idl/source/prj/command.cxx index 4ad62f971d3f..2095ad267c3b 100644 --- a/idl/source/prj/command.cxx +++ b/idl/source/prj/command.cxx @@ -124,9 +124,15 @@ bool ReadIdl( SvIdlWorkingBase * pDataBase, const SvCommand & rCommand ) OUString aFileName ( rCommand.aInFileList[ n ] ); pDataBase->AddDepFile(aFileName); SvTokenStream aTokStm( aFileName ); - SvIdlParser aParser(*pDataBase, aTokStm); - if( !aParser.ReadSvIdl( false, rCommand.aPath ) ) - return false; + try { + SvIdlParser aParser(*pDataBase, aTokStm); + if( !aParser.ReadSvIdl( false, rCommand.aPath ) ) + return false; + } catch (const SvParseException& ex) { + pDataBase->SetError(ex.aError); + pDataBase->WriteError(aTokStm); + return false; + } } return true; } diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx index ee5a072871af..96c4e3a0f802 100644 --- a/idl/source/prj/database.cxx +++ b/idl/source/prj/database.cxx @@ -29,6 +29,21 @@ #include <rtl/strbuf.hxx> #include <osl/file.hxx> + +SvParseException::SvParseException( SvTokenStream & rInStm, const OString& rError ) +{ + SvToken& rTok = rInStm.GetToken(); + aError = SvIdlError( rTok.GetLine(), rTok.GetColumn() ); + aError.SetText( rError ); +}; + +SvParseException::SvParseException( const OString& rError, SvToken& rTok ) +{ + aError = SvIdlError( rTok.GetLine(), rTok.GetColumn() ); + aError.SetText( rError ); +}; + + SvIdlDataBase::SvIdlDataBase( const SvCommand& rCmd ) : bExport( false ) , nUniqueId( 0 ) @@ -150,16 +165,9 @@ bool SvIdlDataBase::ReadIdFile( const OUString & rFileName ) { rTok = aTokStm.GetToken_Next(); OString aDefName; - if( rTok.IsIdentifier() ) - aDefName = rTok.GetString(); - else - { - OString aStr("unexpected token after define"); - // set error - SetError( aStr, rTok ); - WriteError( aTokStm ); - return false; - } + if( !rTok.IsIdentifier() ) + throw SvParseException( "unexpected token after define", rTok ); + aDefName = rTok.GetString(); sal_uLong nVal = 0; bool bOk = true; @@ -184,11 +192,7 @@ bool SvIdlDataBase::ReadIdFile( const OUString & rFileName ) || rTok.GetChar() == '^' || rTok.GetChar() == '~' ) { - OString aStr = "unknown operator '" + OString(rTok.GetChar()) + "'in define"; - // set error - SetError( aStr, rTok ); - WriteError( aTokStm ); - return false; + throw SvParseException( "unknown operator '" + OString(rTok.GetChar()) + "'in define", rTok ); } if( rTok.GetChar() != '+' && rTok.GetChar() != '(' @@ -208,10 +212,7 @@ bool SvIdlDataBase::ReadIdFile( const OUString & rFileName ) { if( !InsertId( aDefName, nVal ) ) { - OString aStr("hash table overflow: "); - SetError( aStr, rTok ); - WriteError( aTokStm ); - return false; + throw SvParseException( "hash table overflow: ", rTok ); } } } @@ -232,19 +233,13 @@ bool SvIdlDataBase::ReadIdFile( const OUString & rFileName ) } if( rTok.IsEof() ) { - OString aStr("unexpected eof in #include"); - // set error - SetError(aStr, rTok); - WriteError( aTokStm ); - return false; + throw SvParseException("unexpected eof in #include", rTok); } } if (!ReadIdFile(OStringToOUString(aName.toString(), RTL_TEXTENCODING_ASCII_US))) { - SetError("cannot read file: " + aName, rTok); - WriteError( aTokStm ); - return false; + throw SvParseException("cannot read file: " + aName, rTok); } } } @@ -394,21 +389,6 @@ void SvIdlDataBase::Write(const OString& rText) fprintf( stdout, "%s", rText.getStr() ); } -void SvIdlDataBase::WriteError( const OString& rErrWrn, - const OString& rFileName, - const OString& rErrorText, - sal_uLong nRow, sal_uLong nColumn ) -{ - // error treatment - fprintf( stderr, "\n%s --- %s: ( %" SAL_PRIuUINTPTR ", %" SAL_PRIuUINTPTR " )\n", - rFileName.getStr(), rErrWrn.getStr(), nRow, nColumn ); - - if( !rErrorText.isEmpty() ) - { // error set - fprintf( stderr, "\t%s\n", rErrorText.getStr() ); - } -} - void SvIdlDataBase::WriteError( SvTokenStream & rInStm ) { // error treatment @@ -453,8 +433,15 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm ) aError = SvIdlError(); } - WriteError("error", OUStringToOString(aFileName, - RTL_TEXTENCODING_UTF8), aErrorText.makeStringAndClear(), nRow, nColumn); + // error treatment + fprintf( stderr, "\n%s --- %s: ( %" SAL_PRIuUINTPTR ", %" SAL_PRIuUINTPTR " )\n", + OUStringToOString(aFileName, RTL_TEXTENCODING_UTF8).getStr(), + "error", nRow, nColumn ); + + if( !aErrorText.isEmpty() ) + { // error set + fprintf( stderr, "\t%s\n", aErrorText.getStr() ); + } // look for identifier close by if( !rTok.IsIdentifier() ) |