From: Hans-Bernhard B. <br...@us...> - 2001-06-01 12:43:28
|
Update of /cvsroot/cscope/cscope/src In directory usw-pr-cvs1:/tmp/cvs-serv21501 Modified Files: command.c constants.h crossref.c display.c find.c fscanner.l global.h invlib.h library.h lookup.c main.c scanner.l Added Files: lookup.h scanner.h Log Message: New version of flex scanner, plus supporting changes --- NEW FILE --- /*=========================================================================== Copyright (c) 2001, The Santa Cruz Operation All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: *Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. *Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. *Neither name of The Santa Cruz Operation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =========================================================================*/ /* $Id: lookup.h,v 1.1 2001/06/01 12:43:24 broeker Exp $ */ #ifndef CSCOPE_LOOKUP_H #define CSCOPE_LOOKUP_H /* declarations for objects defined in lookup.c */ /* keyword text for fast testing of keywords in the scanner */ extern char enumtext[]; extern char externtext[]; extern char structtext[]; extern char typedeftext[]; extern char uniontext[]; #endif /* CSCOPE_LOOKUP_H */ --- NEW FILE --- /*=========================================================================== Copyright (c) 2001, The Santa Cruz Operation All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: *Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. *Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. *Neither name of The Santa Cruz Operation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =========================================================================*/ /* $Id: scanner.h,v 1.1 2001/06/01 12:43:24 broeker Exp $ */ #ifndef CSCOPE_SCANNER_H #define CSCOPE_SCANNER_H #include <stdio.h> #undef YYLMAX #define YYLMAX STMTMAX + PATLEN + 1 /* scanner line buffer size */ /* cross-reference database mark characters (when new ones are added, * update the cscope.out format description in cscope.1) */ #define CLASSDEF 'c' #define DEFINE '#' #define DEFINEEND ')' #define ENUMDEF 'e' #define FCNCALL '`' #define FCNDEF '$' #define FCNEND '}' #define GLOBALDEF 'g' #define INCLUDE '~' #define MEMBERDEF 'm' #define NEWFILE '@' #define STRUCTDEF 's' #define TYPEDEF 't' #define UNIONDEF 'u' /* other scanner token types */ #define LEXEOF 0 #define IDENT 1 #define NEWLINE 2 /* scanner.l global data */ extern int first; /* buffer index for first char of symbol */ extern int last; /* buffer index for last char of symbol */ extern int lineno; /* symbol line number */ extern FILE *yyin; /* input file descriptor */ extern FILE *yyout; /* output file */ extern int myylineno; /* input line number */ #ifdef USING_LEX /* HBB 20010430: if lex is used instead of flex, have to simulate the * private copies of yytext and yytext for the world outside scanner.l: */ #ifdef __OSF1__ /* FIXME: there should be a feature test for this! */ extern char yytext[]; #else extern unsigned char yytext[]; #endif extern int yyleng; # define my_yytext yytext # define my_yyleng yyleng #else extern char *my_yytext; /* private copy of input line */ extern size_t my_yyleng; /* ... and current length of it */ #endif /* The master function exported by scanner.l */ int yylex(void); void initscanner(char *srcfile); #endif /* CSCOPE_SCANNER_H ends */ Index: command.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/command.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** command.c 2001/03/27 14:09:19 1.11 --- command.c 2001/06/01 12:43:24 1.12 *************** *** 856,860 **** numlen = 0; while ((i = fscanf(refsfound, "%250s%250s%6s %5000[^\n]", file, ! function, linenum, yytext)) != EOF) { if (i != 4 || !isgraph((unsigned char)*file) || --- 856,860 ---- numlen = 0; while ((i = fscanf(refsfound, "%250s%250s%6s %5000[^\n]", file, ! function, linenum, tempstring)) != EOF) { if (i != 4 || !isgraph((unsigned char)*file) || Index: constants.h =================================================================== RCS file: /cvsroot/cscope/cscope/src/constants.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** constants.h 2001/04/24 17:42:23 1.6 --- constants.h 2001/06/01 12:43:24 1.7 *************** *** 38,42 **** */ ! #include <config.h> /* Get OS defines */ #define ctrl(x) (x & 037) /* control character macro */ --- 38,42 ---- */ ! #include "config.h" /* Get OS defines */ #define ctrl(x) (x & 037) /* control character macro */ *************** *** 81,110 **** #define READ 4 /* access(2) parameter */ #define WRITE 2 /* access(2) parameter */ - #undef YYLMAX - #define YYLMAX STMTMAX + PATLEN + 1 /* scanner line buffer size */ - - /* cross-reference database mark characters (when new ones are added, - * update the cscope.out format description in cscope.1) - */ - #define CLASSDEF 'c' - #define DEFINE '#' - #define DEFINEEND ')' - #define ENUMDEF 'e' - #define FCNCALL '`' - #define FCNDEF '$' - #define FCNEND '}' - #define GLOBALDEF 'g' - #define INCLUDE '~' - #define MEMBERDEF 'm' - #define NEWFILE '@' - #define STRUCTDEF 's' - #define TYPEDEF 't' - #define UNIONDEF 'u' - - /* other scanner token types */ - #define LEXEOF 0 - #define IDENT 1 - #define NEWLINE 2 - /* screen lines */ #define FLDLINE (LINES - FIELDS - 1) /* first input field line */ --- 81,84 ---- Index: crossref.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/crossref.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** crossref.c 2001/04/30 15:45:40 1.7 --- crossref.c 2001/06/01 12:43:24 1.8 *************** *** 38,41 **** --- 38,43 ---- #include "global.h" + #include "scanner.h" + #include <stdlib.h> *************** *** 63,68 **** long lineoffset; /* source line database offset */ long npostings; /* number of postings */ ! int nsrcoffset; /* number of file name database offsets */ ! long *srcoffset; /* source file name database offsets */ int symbols; /* number of symbols */ --- 65,70 ---- long lineoffset; /* source line database offset */ long npostings; /* number of postings */ ! int nsrcoffset; /* number of file name database offsets */ ! long *srcoffset; /* source file name database offsets */ int symbols; /* number of symbols */ *************** *** 133,141 **** /* see if the symbol is already in the list */ for (i = 0; i < symbols; ++i) { ! if (length == symbol[i].length && ! strncmp(yytext + first, yytext + ! symbol[i].first, length) == 0 && ! entry_no == symbol[i].fcn_level && ! token == symbol[i].type) { /* could be a::a() */ break; } --- 135,145 ---- /* see if the symbol is already in the list */ for (i = 0; i < symbols; ++i) { ! if (length == symbol[i].length ! && strncmp(my_yytext + first, ! my_yytext + symbol[i].first, ! length) == 0 ! && entry_no == symbol[i].fcn_level ! && token == symbol[i].type ! ) { /* could be a::a() */ break; } *************** *** 148,154 **** case NEWLINE: /* end of line containing symbols */ entry_no = 0; /* reset entry_no for each line */ ! --yyleng; /* remove the newline */ putcrossref(); /* output the symbols and source line */ lineno = myylineno; /* save the symbol line number */ break; --- 152,166 ---- case NEWLINE: /* end of line containing symbols */ entry_no = 0; /* reset entry_no for each line */ ! #ifdef USING_LEX ! --yyleng; /* remove the newline */ ! #endif putcrossref(); /* output the symbols and source line */ lineno = myylineno; /* save the symbol line number */ + #ifndef USING_LEX + /* HBB 20010425: replaced yyleng-- by this chunk: */ + if (my_yytext) + *my_yytext = '\0'; + my_yyleng = 0; + #endif break; *************** *** 224,232 **** dboffset = ftell(newrefs); /* fprintf doesn't return chars written */ #endif blank = NO; ! for (i = 0; i < yyleng; ++i) { /* change a tab to a blank and compress blanks */ ! if ((c = yytext[i]) == ' ' || c == '\t') { blank = YES; } --- 236,248 ---- dboffset = ftell(newrefs); /* fprintf doesn't return chars written */ #endif + + /* HBB 20010425: added this line: */ + my_yytext[my_yyleng] = '\0'; + blank = NO; ! for (i = 0; i < my_yyleng; ++i) { /* change a tab to a blank and compress blanks */ ! if ((c = my_yytext[i]) == ' ' || c == '\t') { blank = YES; } *************** *** 251,267 **** /* output the symbol */ j = symbol[symput].last; ! c = yytext[j]; ! yytext[j] = '\0'; if (invertedindex == YES) { ! putposting(yytext + i, type); } ! writestring(yytext + i); dbputc('\n'); ! yytext[j] = c; i = j - 1; ++symput; } else { ! /* check for compressed blanks */ if (blank == YES) { if (dicode2[c]) { --- 267,303 ---- /* output the symbol */ j = symbol[symput].last; ! c = my_yytext[j]; ! my_yytext[j] = '\0'; if (invertedindex == YES) { ! putposting(my_yytext + i, type); } ! writestring(my_yytext + i); dbputc('\n'); ! my_yytext[j] = c; i = j - 1; ++symput; } else { ! /* HBB: try to save some time by early-out handling of ! * non-compressed mode */ ! if (compress == NO) { ! if (blank == YES) { ! dbputc(' '); ! blank = NO; ! } ! j = i + strcspn(my_yytext+i, "\t "); ! if (symput < symbols ! && j >= symbol[symput].first) ! j = symbol[symput].first; ! c = my_yytext[j]; ! my_yytext[j] = '\0'; ! writestring(my_yytext + i); ! my_yytext[j] = c; ! i = j - 1; ! /* finished this 'i', continue with the blank */ ! continue; ! } ! ! /* check for compressed blanks */ if (blank == YES) { if (dicode2[c]) { *************** *** 273,281 **** } /* compress digraphs */ ! else if (IS_A_DICODE(c, yytext[i + 1]) && symput < symbols && i + 1 != symbol[symput].first ) { ! c = DICODE_COMPRESS(c, yytext[i + 1]); ++i; } --- 309,317 ---- } /* compress digraphs */ ! else if (IS_A_DICODE(c, my_yytext[i + 1]) && symput < symbols && i + 1 != symbol[symput].first ) { ! c = DICODE_COMPRESS(c, my_yytext[i + 1]); ++i; } *************** *** 290,314 **** /* note: don't use isspace() because \f and \v are used for keywords */ ! while ((j = yytext[i]) == ' ' || j == '\t') { ++i; } /* skip the rest of the keyword */ ! while (isalpha((unsigned char)yytext[i])) { ++i; } /* skip space after certain keywords */ if (keyword[c].delim != '\0') { ! while ((j = yytext[i]) == ' ' || j == '\t') { ++i; } } /* skip a '(' after certain keywords */ ! if (keyword[c].delim == '(' && yytext[i] == '(') { ++i; } --i; /* compensate for ++i in for() */ ! } ! } ! } /* ignore trailing blanks */ dbputc('\n'); --- 326,352 ---- /* note: don't use isspace() because \f and \v are used for keywords */ ! while ((j = my_yytext[i]) == ' ' || j == '\t') { ++i; } /* skip the rest of the keyword */ ! while (isalpha((unsigned char)my_yytext[i])) { ++i; } /* skip space after certain keywords */ if (keyword[c].delim != '\0') { ! while ((j = my_yytext[i]) == ' ' || j == '\t') { ++i; } } /* skip a '(' after certain keywords */ ! if (keyword[c].delim == '(' ! && my_yytext[i] == '(') { ++i; } --i; /* compensate for ++i in for() */ ! } /* if compressed char */ ! } /* else: not a symbol */ ! } /* for(i) */ ! /* ignore trailing blanks */ dbputc('\n'); *************** *** 420,423 **** --- 458,466 ---- int i; + if (compress == NO) { + /* Save some I/O overhead by using puts() instead of putc(): */ + dbfputs(s); + return; + } /* compress digraphs */ for (i = 0; (c = s[i]) != '\0'; ++i) { Index: display.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/display.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** display.c 2001/04/26 18:26:26 1.14 --- display.c 2001/06/01 12:43:24 1.15 *************** *** 215,219 **** /* read the reference line */ if (fscanf(refsfound, "%s%s%s %[^\n]", file, function, ! linenum, yytext) < 4) { break; } --- 215,219 ---- /* read the reference line */ if (fscanf(refsfound, "%s%s%s %[^\n]", file, function, ! linenum, tempstring) < 4) { break; } *************** *** 265,273 **** /* there may be tabs in egrep output */ ! while ((s = strchr(yytext, '\t')) != NULL) { *s = ' '; } /* display the source line */ ! s = yytext; for (;;) { --- 265,273 ---- /* there may be tabs in egrep output */ ! while ((s = strchr(tempstring, '\t')) != NULL) { *s = ' '; } /* display the source line */ ! s = tempstring; for (;;) { Index: find.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/find.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** find.c 2001/04/30 15:45:40 1.11 --- find.c 2001/06/01 12:43:24 1.12 *************** *** 37,40 **** --- 37,41 ---- #include "global.h" + #include "scanner.h" /* for token definitions */ #if defined(USE_NCURSES) && !defined(RENAMED_NCURSES) #include <ncurses.h> Index: fscanner.l =================================================================== RCS file: /cvsroot/cscope/cscope/src/fscanner.l,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** fscanner.l 2001/03/29 15:01:57 1.1 --- fscanner.l 2001/06/01 12:43:24 1.2 *************** *** 37,56 **** */ #include "global.h" /* the line counting has been moved from character reading for speed */ /* comments are discarded */ #define IFLEVELINC 5 /* #if nesting level size increment */ static char const rcsid[] = "$Id$"; [...1251 lines suppressed...] ! } ! ! #endif /* !COMMENTS_BY_FLEX */ ! ! #define MY_YY_ALLOCSTEP 1000 ! static void ! my_yymore(void) ! { ! static size_t yytext_size = 0; ! ! /* my_yytext is an ever-growing buffer. It will not ever ! * shrink, nor will it be freed at end of program, for now */ ! while (my_yyleng + yyleng + 1 >= yytext_size) { ! my_yytext = myrealloc(my_yytext, ! yytext_size += MY_YY_ALLOCSTEP); ! } ! ! strncpy (my_yytext + my_yyleng, yytext, yyleng+1); ! my_yyleng += yyleng; } Index: global.h =================================================================== RCS file: /cvsroot/cscope/cscope/src/global.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** global.h 2001/04/30 15:45:40 1.14 --- global.h 2001/06/01 12:43:24 1.15 *************** *** 135,140 **** extern long totalterms; /* total inverted index terms */ extern BOOL trun_syms; /* truncate symbols to 8 characters */ - /* command.c global data */ extern BOOL caseless; /* ignore letter case when searching */ --- 135,140 ---- extern long totalterms; /* total inverted index terms */ extern BOOL trun_syms; /* truncate symbols to 8 characters */ + extern char tempstring[8192]; /* global dummy string buffer */ /* command.c global data */ extern BOOL caseless; /* ignore letter case when searching */ *************** *** 204,217 **** #endif - /* scanner.l global data */ - extern int first; /* buffer index for first char of symbol */ - extern int last; /* buffer index for last char of symbol */ - extern int lineno; /* symbol line number */ - extern FILE *yyin; /* input file descriptor */ - extern FILE *yyout; /* output file */ - extern int yyleng; /* input line length */ - extern int myylineno; /* input line number */ - extern char yytext[]; /* input line text */ - /* cscope functions called from more than one function or between files */ --- 204,207 ---- *************** *** 259,263 **** void incfile(char *file, char *type); void includedir(char *dirname); - void initscanner(char *srcfile); void initsymtab(void); void makefilelist(void); --- 249,252 ---- *************** *** 305,314 **** int hash(char *ss); int execute(char *a, ...); - int yylex(void); long dbseek(long offset); - /* - extern int atoi(const char *nptr); - extern int access(const char *pathname, int mode); - */ --- 294,298 ---- Index: invlib.h =================================================================== RCS file: /cvsroot/cscope/cscope/src/invlib.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** invlib.h 2000/05/09 13:34:35 1.2 --- invlib.h 2001/06/01 12:43:24 1.3 *************** *** 42,50 **** /* FIXME HBB: where would these definitions come from ? */ #if u3b || u3b2 || u3b5 || u3b15 || uts ! #define BASE 223 /* 255 - ' ' */ ! #define PRECISION 4 /* maximum digits after converting a long */ #else /* assume sign-extension of a char when converted to an int */ ! #define BASE 95 /* 127 - ' ' */ ! #define PRECISION 5 /* maximum digits after converting a long */ #endif --- 42,50 ---- /* FIXME HBB: where would these definitions come from ? */ #if u3b || u3b2 || u3b5 || u3b15 || uts ! # define BASE 223 /* 255 - ' ' */ ! # define PRECISION 4 /* maximum digits after converting a long */ #else /* assume sign-extension of a char when converted to an int */ ! # define BASE 95 /* 127 - ' ' */ ! # define PRECISION 5 /* maximum digits after converting a long */ #endif *************** *** 81,89 **** } INVCONTROL; ! typedef struct { ! short offset; /* offset in this logical block */ ! unsigned char size; /* size of term */ ! unsigned char space; /* number of longs of growth space */ ! long post; /* number of postings for this entry */ } ENTRY; --- 81,89 ---- } INVCONTROL; ! typedef struct { ! short offset; /* offset in this logical block */ ! unsigned char size; /* size of term */ ! unsigned char space; /* number of longs of growth space */ ! long post; /* number of postings for this entry */ } ENTRY; *************** *** 97,107 **** extern long *srcoffset; /* source file name database offsets */ extern int nsrcoffset; /* number of file name database offsets */ ! /* ! POSTING *boolinfo(); ! POSTING *boolmem(); ! POSTING *boolsave(); ! */ ! extern void boolclear(void); POSTING *boolfile(INVCONTROL *invcntl, long *num, int boolarg); void invclose(INVCONTROL *invcntl); --- 97,104 ---- extern long *srcoffset; /* source file name database offsets */ extern int nsrcoffset; /* number of file name database offsets */ + extern INVCONTROL invcontrol; /* inverted file control structure */ + ! void boolclear(void); POSTING *boolfile(INVCONTROL *invcntl, long *num, int boolarg); void invclose(INVCONTROL *invcntl); *************** *** 112,116 **** long invmake(char *invname, char *invpost, FILE *infile); long invterm(INVCONTROL *invcntl, char *term); - INVCONTROL invcontrol; /* inverted file control structured */ #endif /* CSCOPE_INVLIB_H */ --- 109,112 ---- Index: library.h =================================================================== RCS file: /cvsroot/cscope/cscope/src/library.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** library.h 2001/03/27 14:09:19 1.4 --- library.h 2001/06/01 12:43:24 1.5 *************** *** 35,38 **** --- 35,41 ---- /* library function return value declarations */ + #ifndef CSCOPE_LIBRARY_H + #define CSCOPE_LIBRARY_H + #if BSD #define strchr index *************** *** 59,60 **** --- 62,65 ---- /* Programmer's Workbench library (-lPW) */ char *regcmp(), *regex(); + + #endif /* CSCOPE_LIBRARY_H */ Index: lookup.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/lookup.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** lookup.c 2000/05/03 19:07:09 1.2 --- lookup.c 2001/06/01 12:43:24 1.3 *************** *** 37,40 **** --- 37,41 ---- #include "global.h" + #include "lookup.h" static char const rcsid[] = "$Id$"; Index: main.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/main.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** main.c 2001/04/30 15:45:40 1.19 --- main.c 2001/06/01 12:43:24 1.20 *************** *** 40,43 **** --- 40,44 ---- #include "vp.h" #include "version.h" /* FILEVERSION and FIXVERSION */ + #include "scanner.h" #include <stdlib.h> /* atoi */ #if defined(USE_NCURSES) && !defined(RENAMED_NCURSES) *************** *** 104,107 **** --- 105,110 ---- long totalterms; /* total inverted index terms */ BOOL trun_syms; /* truncate symbols to 8 characters */ + char tempstring[8192]; /* use this as a buffer, instead of 'yytext', + * which had better be left alone */ static BOOL buildonly = NO; /* only build the database */ Index: scanner.l =================================================================== RCS file: /cvsroot/cscope/cscope/src/scanner.l,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** scanner.l 2000/05/05 17:35:00 1.4 --- scanner.l 2001/06/01 12:43:24 1.5 *************** *** 37,40 **** --- 37,42 ---- */ #include "global.h" + #include "scanner.h" + #include "lookup.h" /* the line counting has been moved from character reading for speed */ *************** *** 45,55 **** static char const rcsid[] = "$Id$"; - /* keyword text for fast testing of keywords in the scanner */ - extern char enumtext[]; - extern char externtext[]; - extern char structtext[]; - extern char typedeftext[]; - extern char uniontext[]; - int first; /* buffer index for first char of symbol */ int last; /* buffer index for last char of symbol */ --- 47,50 ---- *************** *** 568,572 **** s = strpbrk(yytext, "\"<"); incfile(s + 1, s); ! first = s - yytext; last = yyleng; if (compress == YES) { --- 563,569 ---- s = strpbrk(yytext, "\"<"); incfile(s + 1, s); ! /* HBB: avoid pointer mismatch if yytext is ! * unsigned, or a pointer */ ! first = s - (char *)&(yytext[0]); last = yyleng; if (compress == YES) { |