KiCad PCB EDA Suite
pcb_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 <pcb_lexer.h>
10 
11 using namespace PCB_KEYS_T;
12 
13 #define TOKDEF(x) { #x, T_##x }
14 
15 const KEYWORD PCB_LEXER::keywords[] = {
16  TOKDEF( add_net ),
17  TOKDEF( allowed ),
18  TOKDEF( angle ),
19  TOKDEF( arc ),
20  TOKDEF( arc_segments ),
21  TOKDEF( area ),
22  TOKDEF( arrow1a ),
23  TOKDEF( arrow1b ),
24  TOKDEF( arrow2a ),
25  TOKDEF( arrow2b ),
26  TOKDEF( at ),
27  TOKDEF( attr ),
28  TOKDEF( autoplace_cost180 ),
29  TOKDEF( autoplace_cost90 ),
30  TOKDEF( aux_axis_origin ),
31  TOKDEF( blind ),
32  TOKDEF( blind_buried_vias_allowed ),
33  TOKDEF( bold ),
34  TOKDEF( bottom ),
35  TOKDEF( center ),
36  TOKDEF( chamfer ),
37  TOKDEF( circle ),
38  TOKDEF( clearance ),
39  TOKDEF( comment ),
40  TOKDEF( company ),
41  TOKDEF( connect ),
42  TOKDEF( connect_pads ),
43  TOKDEF( copperpour ),
44  TOKDEF( crossbar ),
45  TOKDEF( date ),
46  TOKDEF( descr ),
47  TOKDEF( die_length ),
48  TOKDEF( diff_pair_gap ),
49  TOKDEF( diff_pair_width ),
50  TOKDEF( dimension ),
51  TOKDEF( drawings ),
52  TOKDEF( drill ),
53  TOKDEF( edge ),
54  TOKDEF( edge_width ),
55  TOKDEF( effects ),
56  TOKDEF( end ),
57  TOKDEF( feature1 ),
58  TOKDEF( feature2 ),
59  TOKDEF( fill ),
60  TOKDEF( fill_segments ),
61  TOKDEF( filled_polygon ),
62  TOKDEF( fillet ),
63  TOKDEF( font ),
64  TOKDEF( fp_arc ),
65  TOKDEF( fp_circle ),
66  TOKDEF( fp_curve ),
67  TOKDEF( fp_line ),
68  TOKDEF( fp_poly ),
69  TOKDEF( fp_text ),
70  TOKDEF( full ),
71  TOKDEF( general ),
72  TOKDEF( gr_arc ),
73  TOKDEF( gr_circle ),
74  TOKDEF( gr_curve ),
75  TOKDEF( gr_line ),
76  TOKDEF( gr_poly ),
77  TOKDEF( gr_text ),
78  TOKDEF( grid_origin ),
79  TOKDEF( hatch ),
80  TOKDEF( hide ),
81  TOKDEF( italic ),
82  TOKDEF( justify ),
83  TOKDEF( keepout ),
84  TOKDEF( kicad_pcb ),
85  TOKDEF( last_trace_width ),
86  TOKDEF( layer ),
87  TOKDEF( layers ),
88  TOKDEF( left ),
89  TOKDEF( links ),
90  TOKDEF( locked ),
91  TOKDEF( micro ),
92  TOKDEF( min_thickness ),
93  TOKDEF( mirror ),
94  TOKDEF( mod_edge_width ),
95  TOKDEF( mod_text_size ),
96  TOKDEF( mod_text_width ),
97  TOKDEF( mode ),
98  TOKDEF( model ),
99  TOKDEF( module ),
100  TOKDEF( net ),
101  TOKDEF( net_class ),
102  TOKDEF( net_name ),
103  TOKDEF( nets ),
104  TOKDEF( no ),
105  TOKDEF( no_connects ),
106  TOKDEF( none ),
107  TOKDEF( not_allowed ),
108  TOKDEF( np_thru_hole ),
109  TOKDEF( offset ),
110  TOKDEF( oval ),
111  TOKDEF( pad ),
112  TOKDEF( pad_drill ),
113  TOKDEF( pad_size ),
114  TOKDEF( pad_to_mask_clearance ),
115  TOKDEF( pad_to_paste_clearance ),
116  TOKDEF( pad_to_paste_clearance_ratio ),
117  TOKDEF( pads ),
118  TOKDEF( page ),
119  TOKDEF( path ),
120  TOKDEF( pcb_text_size ),
121  TOKDEF( pcb_text_width ),
122  TOKDEF( pcbplotparams ),
123  TOKDEF( placed ),
124  TOKDEF( plus ),
125  TOKDEF( polygon ),
126  TOKDEF( portrait ),
127  TOKDEF( priority ),
128  TOKDEF( pts ),
129  TOKDEF( radius ),
130  TOKDEF( rect ),
131  TOKDEF( rect_delta ),
132  TOKDEF( reference ),
133  TOKDEF( rev ),
134  TOKDEF( right ),
135  TOKDEF( rotate ),
136  TOKDEF( roundrect ),
137  TOKDEF( roundrect_rratio ),
138  TOKDEF( scale ),
139  TOKDEF( segment ),
140  TOKDEF( segment_width ),
141  TOKDEF( setup ),
142  TOKDEF( size ),
143  TOKDEF( smd ),
144  TOKDEF( smoothing ),
145  TOKDEF( solder_mask_margin ),
146  TOKDEF( solder_mask_min_width ),
147  TOKDEF( solder_paste_margin ),
148  TOKDEF( solder_paste_margin_ratio ),
149  TOKDEF( solder_paste_ratio ),
150  TOKDEF( start ),
151  TOKDEF( status ),
152  TOKDEF( tags ),
153  TOKDEF( target ),
154  TOKDEF( tedit ),
155  TOKDEF( thermal_bridge_width ),
156  TOKDEF( thermal_gap ),
157  TOKDEF( thermal_width ),
158  TOKDEF( thickness ),
159  TOKDEF( thru ),
160  TOKDEF( thru_hole ),
161  TOKDEF( thru_hole_only ),
162  TOKDEF( title ),
163  TOKDEF( title_block ),
164  TOKDEF( top ),
165  TOKDEF( trace_clearance ),
166  TOKDEF( trace_min ),
167  TOKDEF( trace_width ),
168  TOKDEF( tracks ),
169  TOKDEF( trapezoid ),
170  TOKDEF( tstamp ),
171  TOKDEF( user ),
172  TOKDEF( user_trace_width ),
173  TOKDEF( user_via ),
174  TOKDEF( uvia_dia ),
175  TOKDEF( uvia_drill ),
176  TOKDEF( uvia_min_drill ),
177  TOKDEF( uvia_min_size ),
178  TOKDEF( uvia_size ),
179  TOKDEF( uvias_allowed ),
180  TOKDEF( value ),
181  TOKDEF( version ),
182  TOKDEF( via ),
183  TOKDEF( via_dia ),
184  TOKDEF( via_drill ),
185  TOKDEF( via_min_drill ),
186  TOKDEF( via_min_size ),
187  TOKDEF( via_size ),
188  TOKDEF( vias ),
189  TOKDEF( virtual ),
190  TOKDEF( visible_elements ),
191  TOKDEF( width ),
192  TOKDEF( x ),
193  TOKDEF( xy ),
194  TOKDEF( xyz ),
195  TOKDEF( yes ),
196  TOKDEF( zone ),
197  TOKDEF( zone_45_only ),
198  TOKDEF( zone_clearance ),
199  TOKDEF( zone_connect ),
200  TOKDEF( zone_type ),
201  TOKDEF( zones )
202 };
203 
204 const unsigned PCB_LEXER::keyword_count = unsigned( sizeof( PCB_LEXER::keywords )/sizeof( PCB_LEXER::keywords[0] ) );
205 
206 
207 const char* PCB_LEXER::TokenName( T aTok )
208 {
209  const char* ret;
210 
211  if( aTok < 0 )
212  ret = DSNLEXER::Syntax( aTok );
213  else if( (unsigned) aTok < keyword_count )
214  ret = keywords[aTok].name;
215  else
216  ret = "token too big";
217 
218  return ret;
219 }
static const KEYWORD keywords[]
Auto generated lexer keywords table and length:
Definition: pcb_lexer.h:241
static const char * TokenName(PCB_KEYS_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...
Definition: pcb_lexer.h:23
#define TOKDEF(x)
T
enum T contains all this lexer's tokens.
Definition: pcb_lexer.h:26
const int scale
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
static const unsigned keyword_count
Definition: pcb_lexer.h:242
Struct KEYWORD holds a keyword string and its unique integer token.
Definition: dsnlexer.h:40
static const char * Syntax(int aTok)
Definition: dsnlexer.cpp:271