Remove unused LIB_TABLE_ROW::Parse
This commit is contained in:
parent
6b8d81e95d
commit
48ce1239a2
|
@ -106,107 +106,6 @@ void LIB_TABLE_ROW::Format( OUTPUTFORMATTER* out, int nestLevel ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_TABLE_ROW::Parse( std::unique_ptr< LIB_TABLE_ROW >& aRow, LIB_TABLE_LEXER* in )
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* (lib (name NICKNAME)(descr DESCRIPTION)(type TYPE)(full_uri FULL_URI)(options OPTIONS))
|
|
||||||
*
|
|
||||||
* Elements after (name) are order independent.
|
|
||||||
*/
|
|
||||||
|
|
||||||
T tok = in->NextTok();
|
|
||||||
|
|
||||||
if( tok != T_lib )
|
|
||||||
in->Expecting( T_lib );
|
|
||||||
|
|
||||||
// (name NICKNAME)
|
|
||||||
in->NeedLEFT();
|
|
||||||
|
|
||||||
if( ( tok = in->NextTok() ) != T_name )
|
|
||||||
in->Expecting( T_name );
|
|
||||||
|
|
||||||
in->NeedSYMBOLorNUMBER();
|
|
||||||
|
|
||||||
aRow->SetNickName( in->FromUTF8() );
|
|
||||||
|
|
||||||
in->NeedRIGHT();
|
|
||||||
|
|
||||||
// After (name), remaining (lib) elements are order independent, and in
|
|
||||||
// some cases optional.
|
|
||||||
bool sawType = false;
|
|
||||||
bool sawOpts = false;
|
|
||||||
bool sawDesc = false;
|
|
||||||
bool sawUri = false;
|
|
||||||
|
|
||||||
while( ( tok = in->NextTok() ) != T_RIGHT )
|
|
||||||
{
|
|
||||||
if( tok == T_EOF )
|
|
||||||
in->Unexpected( T_EOF );
|
|
||||||
|
|
||||||
if( tok != T_LEFT )
|
|
||||||
in->Expecting( T_LEFT );
|
|
||||||
|
|
||||||
tok = in->NeedSYMBOLorNUMBER();
|
|
||||||
|
|
||||||
switch( tok )
|
|
||||||
{
|
|
||||||
case T_uri:
|
|
||||||
if( sawUri )
|
|
||||||
in->Duplicate( tok );
|
|
||||||
sawUri = true;
|
|
||||||
in->NeedSYMBOLorNUMBER();
|
|
||||||
// Saved path and file names use the Unix notation (separator = '/')
|
|
||||||
// However old files, and files edited by hands can use the woindows
|
|
||||||
// separator. Force the unix notation
|
|
||||||
// (It works on windows, and moreover, wxFileName and wxDir takes care to that
|
|
||||||
// on windows)
|
|
||||||
// moreover, URLs use the '/' as separator
|
|
||||||
{
|
|
||||||
wxString uri = in->FromUTF8();
|
|
||||||
uri.Replace( '\\', '/' );
|
|
||||||
aRow->SetFullURI( uri );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case T_type:
|
|
||||||
if( sawType )
|
|
||||||
in->Duplicate( tok );
|
|
||||||
sawType = true;
|
|
||||||
in->NeedSYMBOLorNUMBER();
|
|
||||||
aRow->SetType( in->FromUTF8() );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case T_options:
|
|
||||||
if( sawOpts )
|
|
||||||
in->Duplicate( tok );
|
|
||||||
sawOpts = true;
|
|
||||||
in->NeedSYMBOLorNUMBER();
|
|
||||||
aRow->SetOptions( in->FromUTF8() );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case T_descr:
|
|
||||||
if( sawDesc )
|
|
||||||
in->Duplicate( tok );
|
|
||||||
sawDesc = true;
|
|
||||||
in->NeedSYMBOLorNUMBER();
|
|
||||||
aRow->SetDescr( in->FromUTF8() );
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
in->Unexpected( tok );
|
|
||||||
}
|
|
||||||
|
|
||||||
in->NeedRIGHT();
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !sawType )
|
|
||||||
in->Expecting( T_type );
|
|
||||||
|
|
||||||
if( !sawUri )
|
|
||||||
in->Expecting( T_uri );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool LIB_TABLE_ROW::operator==( const LIB_TABLE_ROW& r ) const
|
bool LIB_TABLE_ROW::operator==( const LIB_TABLE_ROW& r ) const
|
||||||
{
|
{
|
||||||
return nickName == r.nickName
|
return nickName == r.nickName
|
||||||
|
|
|
@ -171,8 +171,6 @@ public:
|
||||||
*/
|
*/
|
||||||
void Format( OUTPUTFORMATTER* out, int nestLevel ) const;
|
void Format( OUTPUTFORMATTER* out, int nestLevel ) const;
|
||||||
|
|
||||||
static void Parse( std::unique_ptr< LIB_TABLE_ROW >& aRow, LIB_TABLE_LEXER* in );
|
|
||||||
|
|
||||||
LIB_TABLE_ROW* clone() const
|
LIB_TABLE_ROW* clone() const
|
||||||
{
|
{
|
||||||
return do_clone();
|
return do_clone();
|
||||||
|
|
Loading…
Reference in New Issue