kicad/qa/drc_proto/drc_rules_keywords.cpp

51 lines
1.1 KiB
C++

/* 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 </home/twl/Kicad-dev/kicad-build/debug-dev/common/drc_rules_lexer.h>
using namespace DRCRULE_T;
#define TOKDEF(x) { #x, T_##x }
const KEYWORD DRC_RULES_LEXER::keywords[] = {
TOKDEF( allow ),
TOKDEF( condition ),
TOKDEF( enable ),
TOKDEF( error ),
TOKDEF( expression ),
TOKDEF( ignore ),
TOKDEF( info ),
TOKDEF( max ),
TOKDEF( min ),
TOKDEF( name ),
TOKDEF( opt ),
TOKDEF( priority ),
TOKDEF( rule ),
TOKDEF( severity ),
TOKDEF( type ),
TOKDEF( version ),
TOKDEF( warning )
};
const unsigned DRC_RULES_LEXER::keyword_count = unsigned( sizeof( DRC_RULES_LEXER::keywords )/sizeof( DRC_RULES_LEXER::keywords[0] ) );
const char* DRC_RULES_LEXER::TokenName( T aTok )
{
const char* ret;
if( aTok < 0 )
ret = DSNLEXER::Syntax( aTok );
else if( (unsigned) aTok < keyword_count )
ret = keywords[aTok].name;
else
ret = "token too big";
return ret;
}