KiCad PCB EDA Suite
fp_lib_table_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 <fp_lib_table_lexer.h>
10 
11 using namespace FP_LIB_TABLE_T;
12 
13 #define TOKDEF(x) { #x, T_##x }
14 
16  TOKDEF( descr ),
17  TOKDEF( fp_lib_table ),
18  TOKDEF( lib ),
19  TOKDEF( name ),
20  TOKDEF( options ),
21  TOKDEF( sym_lib_table ),
22  TOKDEF( type ),
23  TOKDEF( uri )
24 };
25 
26 const unsigned FP_LIB_TABLE_LEXER::keyword_count = unsigned( sizeof( FP_LIB_TABLE_LEXER::keywords )/sizeof( FP_LIB_TABLE_LEXER::keywords[0] ) );
27 
28 
29 const char* FP_LIB_TABLE_LEXER::TokenName( T aTok )
30 {
31  const char* ret;
32 
33  if( aTok < 0 )
34  ret = DSNLEXER::Syntax( aTok );
35  else if( (unsigned) aTok < keyword_count )
36  ret = keywords[aTok].name;
37  else
38  ret = "token too big";
39 
40  return ret;
41 }
static const char * TokenName(FP_LIB_TABLE_T::T aTok)
Function TokenName returns the name of the token in ASCII form.
T
enum T contains all this lexer's tokens.
C++ does not put enum values in separate namespaces unless the enum itself is in a separate namespace...
static const KEYWORD keywords[]
Auto generated lexer keywords table and length:
#define TOKDEF(x)
Struct KEYWORD holds a keyword string and its unique integer token.
Definition: dsnlexer.h:40
static const unsigned keyword_count
static const char * Syntax(int aTok)
Definition: dsnlexer.cpp:272