aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/genksyms/lex.l
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/genksyms/lex.l')
-rw-r--r--scripts/genksyms/lex.l12
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/genksyms/lex.l b/scripts/genksyms/lex.l
index e4ddd49..f770071 100644
--- a/scripts/genksyms/lex.l
+++ b/scripts/genksyms/lex.l
@@ -29,7 +29,7 @@
#include <ctype.h>
#include "genksyms.h"
-#include "parse.h"
+#include "parse.tab.h"
/* We've got a two-level lexer here. We let flex do basic tokenization
and then we categorize those basic tokens in the second stage. */
@@ -94,7 +94,7 @@ MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>)
/* Bring in the keyword recognizer. */
-#include "keywords.c"
+#include "keywords.hash.c"
/* Macros to append to our phrase collection list. */
@@ -116,6 +116,7 @@ MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>)
cur_node->tag = \
find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\
SYM_ENUM_CONST : SYM_NORMAL ; \
+ cur_node->in_source_file = in_source_file; \
} while (0)
#define APP _APP(yytext, yyleng)
@@ -166,6 +167,13 @@ repeat:
cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1);
cur_line = atoi(yytext+2);
+ if (!source_file) {
+ source_file = xstrdup(cur_filename);
+ in_source_file = 1;
+ } else {
+ in_source_file = (strcmp(cur_filename, source_file) == 0);
+ }
+
goto repeat;
}