Commit d7a85428 authored by dickelbeck's avatar dickelbeck

more specctra work

parent ed4b9015
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* This program source code file is part of KICAD, a free EDA CAD application. * This program source code file is part of KICAD, a free EDA CAD application.
* *
* Copyright (C) 2007 Dick Hollenbeck, dick@softplc.com * Copyright (C) 2007-2008 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2007 Kicad Developers, see change_log.txt for contributors. * Copyright (C) 2007 Kicad Developers, see change_log.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -506,50 +506,58 @@ int LEXER::findToken( const std::string& tok ) ...@@ -506,50 +506,58 @@ int LEXER::findToken( const std::string& tok )
} }
wxString LEXER::GetTokenText( DSN_T aTok ) const char* LEXER::GetTokenText( DSN_T aTok )
{ {
wxString ret; const char* ret;
if( aTok < 0 ) if( aTok < 0 )
{ {
switch( aTok ) switch( aTok )
{ {
case T_QUOTE_DEF: case T_QUOTE_DEF:
ret << _("'quoted text delimiter'"); ret = "'quoted text delimiter'";
break; break;
case T_DASH: case T_DASH:
ret << wxT( "'-'" ); ret = "'-'";
break; break;
case T_SYMBOL: case T_SYMBOL:
ret << _("'symbol'"); ret = "'symbol'";
break; break;
case T_NUMBER: case T_NUMBER:
ret << _("'number'"); ret = "'number'";
break; break;
case T_RIGHT: case T_RIGHT:
ret << wxT( "')'" ); ret = "')'";
break; break;
case T_LEFT: case T_LEFT:
ret << wxT( "'('" ); ret = "'('";
break; break;
case T_STRING: case T_STRING:
ret << _("\"quoted string\""); ret = "'quoted string'";
break; break;
case T_EOF: case T_EOF:
ret << _("'end of file'"); ret = "'end of file'";
break; break;
default: default:
; ret = "???";
} }
} }
else else
{ {
ret << wxT("'") << CONV_FROM_UTF8( tokens[aTok].name ) << wxT("'"); ret = tokens[aTok].name;
} }
return ret; return ret;
} }
wxString LEXER::GetTokenString( DSN_T aTok )
{
wxString ret = CONV_FROM_UTF8( GetTokenText(aTok) );
return ret;
}
void LEXER::ThrowIOError( wxString aText, int charOffset ) throw (IOError) void LEXER::ThrowIOError( wxString aText, int charOffset ) throw (IOError)
{ {
......
/* /*
* This program source code file is part of KICAD, a free EDA CAD application. * This program source code file is part of KICAD, a free EDA CAD application.
* *
* Copyright (C) 2007 Dick Hollenbeck, dick@softplc.com * Copyright (C) 2007-2008 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2007 Kicad Developers, see change_log.txt for contributors. * Copyright (C) 2007 Kicad Developers, see change_log.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -606,8 +606,18 @@ public: ...@@ -606,8 +606,18 @@ public:
*/ */
void ThrowIOError( wxString aText, int charOffset ) throw (IOError); void ThrowIOError( wxString aText, int charOffset ) throw (IOError);
/**
* Function GetTokenString
* returns the wxString representation of a DSN_T value.
*/
static wxString GetTokenString( DSN_T aTok );
wxString GetTokenText( DSN_T aTok ); /**
* Function GetTokenString
* returns the C string representation of a DSN_T value.
*/
static const char* GetTokenText( DSN_T aTok );
/** /**
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment