Commit c72857f4 authored by dickelbeck's avatar dickelbeck

more specctra dsn work

parent f5f6bb6f
......@@ -46,11 +46,13 @@ namespace DSN {
struct KEYWORD
{
const char* name;
int token;
// int token;
};
#define TOKDEF(x) { #x, T_##x }
//#define TOKDEF(x) { #x, T_##x }
#define TOKDEF(x) { #x }
// This MUST be sorted alphabetically, and also so MUST enum DSN_T {} be alphabetized.
// These MUST all be lower case because of the conversion to lowercase in findToken().
......@@ -123,6 +125,7 @@ const static KEYWORD tokens[] = {
TOKDEF(diagonal),
TOKDEF(direction),
TOKDEF(directory),
TOKDEF(discrete),
TOKDEF(effective_via_length),
TOKDEF(exclude),
TOKDEF(expose),
......@@ -163,6 +166,7 @@ const static KEYWORD tokens[] = {
TOKDEF(image_image),
TOKDEF(image_image_spacing),
TOKDEF(image_outline_clearance),
TOKDEF(image_set),
TOKDEF(image_type),
TOKDEF(inch),
TOKDEF(include),
......@@ -310,6 +314,7 @@ const static KEYWORD tokens[] = {
TOKDEF(reorder),
TOKDEF(reroute_order_viols),
TOKDEF(resistance_resolution),
TOKDEF(resistor),
TOKDEF(resolution),
TOKDEF(restricted_layer_length_factor),
TOKDEF(room),
......@@ -341,6 +346,7 @@ const static KEYWORD tokens[] = {
TOKDEF(side),
TOKDEF(signal),
TOKDEF(site),
TOKDEF(small),
TOKDEF(smd),
TOKDEF(snap),
TOKDEF(snap_angle),
......@@ -420,6 +426,7 @@ const static KEYWORD tokens[] = {
TOKDEF(wiring),
TOKDEF(write_resolution),
TOKDEF(x),
TOKDEF(xy),
TOKDEF(y),
};
......@@ -513,7 +520,8 @@ int LEXER::findToken( const std::string& tok )
tokens, sizeof(tokens)/sizeof(tokens[0]),
sizeof(KEYWORD), compare );
if( findings )
return findings->token;
// return findings->token;
return findings - tokens;
else
return -1;
}
......
......@@ -42,6 +42,7 @@ namespace DSN {
enum DSN_T {
// the first few are special (the uppercase ones)
T_NONE = -9,
T_QUOTE_DEF = -8,
T_DASH = -7,
T_SYMBOL = -6,
......@@ -123,6 +124,7 @@ enum DSN_T {
T_diagonal,
T_direction,
T_directory,
T_discrete,
T_effective_via_length,
T_exclude,
T_expose,
......@@ -163,6 +165,7 @@ enum DSN_T {
T_image_image,
T_image_image_spacing,
T_image_outline_clearance,
T_image_set,
T_image_type,
T_inch,
T_include,
......@@ -310,6 +313,7 @@ enum DSN_T {
T_reorder,
T_reroute_order_viols,
T_resistance_resolution,
T_resistor,
T_resolution,
T_restricted_layer_length_factor,
T_room,
......@@ -341,6 +345,7 @@ enum DSN_T {
T_side,
T_signal,
T_site,
T_small,
T_smd,
T_snap,
T_snap_angle,
......@@ -420,6 +425,7 @@ enum DSN_T {
T_wiring,
T_write_resolution,
T_x,
T_xy,
T_y,
T_END // just a sentinel, not a token
};
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment