
/* Do not modify this file it was automatically generated by the
 * TokenList2DsnLexer CMake script.
 *
 * Include this file in your lexer class to provide the keywords for
 * your DSN lexer.
 */

#include "netlist_lexer.h"

using namespace NL_T;

#define TOKDEF(x)    { #x, T_##x }

const KEYWORD NETLIST_LEXER::keywords[] = {
    TOKDEF( code ),
    TOKDEF( comp ),
    TOKDEF( components ),
    TOKDEF( datasheet ),
    TOKDEF( date ),
    TOKDEF( description ),
    TOKDEF( design ),
    TOKDEF( docs ),
    TOKDEF( export ),
    TOKDEF( field ),
    TOKDEF( fields ),
    TOKDEF( footprint ),
    TOKDEF( footprints ),
    TOKDEF( fp ),
    TOKDEF( lib ),
    TOKDEF( libpart ),
    TOKDEF( libraries ),
    TOKDEF( library ),
    TOKDEF( libsource ),
    TOKDEF( name ),
    TOKDEF( names ),
    TOKDEF( net ),
    TOKDEF( nets ),
    TOKDEF( node ),
    TOKDEF( num ),
    TOKDEF( part ),
    TOKDEF( pin ),
    TOKDEF( pins ),
    TOKDEF( ref ),
    TOKDEF( sheetpath ),
    TOKDEF( source ),
    TOKDEF( tool ),
    TOKDEF( tstamp ),
    TOKDEF( tstamps ),
    TOKDEF( uri ),
    TOKDEF( value ),
    TOKDEF( version )
};

const unsigned NETLIST_LEXER::keyword_count = unsigned( sizeof( NETLIST_LEXER::keywords )/sizeof( NETLIST_LEXER::keywords[0] ) );


const char* NETLIST_LEXER::TokenName( T aTok )
{
    const char* ret;

    if( (unsigned) aTok < keyword_count )
    {
        ret = keywords[aTok].name;
    }
    else if( aTok < 0 )
    {
        ret = DSNLEXER::Syntax( aTok );
    }
    else
        ret = "token too big";

    return ret;
}
