KiCad PCB EDA Suite
dialog_bom_cfg_keywords.cpp
Go to the documentation of this file.
1 
2 /* Do not modify this file it was automatically generated by the
3  * TokenList2DsnLexer CMake script.
4  *
5  * Include this file in your lexer class to provide the keywords for
6  * your DSN lexer.
7  */
8 
9 #include <dialog_bom_cfg_lexer.h>
10 
11 using namespace T_BOMCFG_T;
12 
13 #define TOKDEF(x) { #x, T_##x }
14 
16  TOKDEF( cmd ),
17  TOKDEF( opts ),
18  TOKDEF( plugin ),
19  TOKDEF( plugins )
20 };
21 
22 const unsigned DIALOG_BOM_CFG_LEXER::keyword_count = unsigned( sizeof( DIALOG_BOM_CFG_LEXER::keywords )/sizeof( DIALOG_BOM_CFG_LEXER::keywords[0] ) );
23 
24 
26 {
27  const char* ret;
28 
29  if( aTok < 0 )
30  ret = DSNLEXER::Syntax( aTok );
31  else if( (unsigned) aTok < keyword_count )
32  ret = keywords[aTok].name;
33  else
34  ret = "token too big";
35 
36  return ret;
37 }
T
enum T contains all this lexer's tokens.
#define TOKDEF(x)
static const unsigned keyword_count
static const KEYWORD keywords[]
Auto generated lexer keywords table and length:
static const char * TokenName(T_BOMCFG_T::T aTok)
Function TokenName returns the name of the token in ASCII form.
C++ does not put enum values in separate namespaces unless the enum itself is in a separate namespace...
Struct KEYWORD holds a keyword string and its unique integer token.
Definition: dsnlexer.h:40
static const char * Syntax(int aTok)
Definition: dsnlexer.cpp:272