KiCad PCB EDA Suite
page_layout_reader_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 
10 
11 using namespace TB_READER_T;
12 
13 #define TOKDEF(x) { #x, T_##x }
14 
16  TOKDEF( bitmap ),
17  TOKDEF( bold ),
18  TOKDEF( bottom ),
19  TOKDEF( bottom_margin ),
20  TOKDEF( center ),
21  TOKDEF( comment ),
22  TOKDEF( data ),
23  TOKDEF( end ),
24  TOKDEF( font ),
25  TOKDEF( incrlabel ),
26  TOKDEF( incrx ),
27  TOKDEF( incry ),
28  TOKDEF( italic ),
29  TOKDEF( justify ),
30  TOKDEF( lbcorner ),
31  TOKDEF( left ),
32  TOKDEF( left_margin ),
33  TOKDEF( line ),
34  TOKDEF( linewidth ),
35  TOKDEF( ltcorner ),
36  TOKDEF( maxheight ),
37  TOKDEF( maxlen ),
38  TOKDEF( name ),
39  TOKDEF( notonpage1 ),
40  TOKDEF( option ),
41  TOKDEF( page1only ),
42  TOKDEF( page_layout ),
43  TOKDEF( pngdata ),
44  TOKDEF( polygon ),
45  TOKDEF( pos ),
46  TOKDEF( pts ),
47  TOKDEF( rbcorner ),
48  TOKDEF( rect ),
49  TOKDEF( repeat ),
50  TOKDEF( right ),
51  TOKDEF( right_margin ),
52  TOKDEF( rotate ),
53  TOKDEF( rtcorner ),
54  TOKDEF( scale ),
55  TOKDEF( setup ),
56  TOKDEF( size ),
57  TOKDEF( start ),
58  TOKDEF( tbtext ),
59  TOKDEF( textlinewidth ),
60  TOKDEF( textsize ),
61  TOKDEF( top ),
62  TOKDEF( top_margin ),
63  TOKDEF( xy )
64 };
65 
66 const unsigned PAGE_LAYOUT_READER_LEXER::keyword_count = unsigned( sizeof( PAGE_LAYOUT_READER_LEXER::keywords )/sizeof( PAGE_LAYOUT_READER_LEXER::keywords[0] ) );
67 
68 
70 {
71  const char* ret;
72 
73  if( aTok < 0 )
74  ret = DSNLEXER::Syntax( aTok );
75  else if( (unsigned) aTok < keyword_count )
76  ret = keywords[aTok].name;
77  else
78  ret = "token too big";
79 
80  return ret;
81 }
static const KEYWORD keywords[]
Auto generated lexer keywords table and length:
static const unsigned keyword_count
C++ does not put enum values in separate namespaces unless the enum itself is in a separate namespace...
static const char * TokenName(TB_READER_T::T aTok)
Function TokenName returns the name of the token in ASCII form.
#define TOKDEF(x)
const int scale
T
enum T contains all this lexer's tokens.
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