[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] set up reserved word table before using isCpp
From: |
Hideki IWAMOTO |
Subject: |
[PATCH] set up reserved word table before using isCpp |
Date: |
Wed, 26 Mar 2003 21:51:37 +0900 |
Since isCpp is called before inittable, isCpp does not work correctly.
I also moved setup of other languages for consistency.
Index: gctags/C.c
===================================================================
RCS file: /cvsroot/global/global/gctags/C.c,v
retrieving revision 1.34
diff -u -r1.34 C.c
--- gctags/C.c 25 Mar 2003 13:01:47 -0000 1.34
+++ gctags/C.c 26 Mar 2003 12:32:16 -0000
@@ -47,7 +47,6 @@
static int function_definition(int);
static void condition_macro(int, int);
static int seems_datatype(const char *);
-static void inittable();
static int reserved(char *);
/*
@@ -97,10 +96,6 @@
crflag = 1; /* require '\n' as a token */
if (yacc)
ymode = 1; /* allow token like '%xxx' */
- /*
- * set up reserved word table.
- */
- inittable();
while ((cc = nexttoken(interested, reserved)) != EOF) {
switch (cc) {
@@ -694,8 +689,8 @@
{"while", C_WHILE},
};
-static void
-inittable()
+void
+C_inittable()
{
qsort(words, sizeof(words)/sizeof(struct words), sizeof(struct words),
cmp);
}
Index: gctags/Cpp.c
===================================================================
RCS file: /cvsroot/global/global/gctags/Cpp.c,v
retrieving revision 1.31
diff -u -r1.31 Cpp.c
--- gctags/Cpp.c 25 Mar 2003 13:01:47 -0000 1.31
+++ gctags/Cpp.c 26 Mar 2003 12:32:16 -0000
@@ -48,7 +48,6 @@
static int function_definition(int);
static int seems_datatype(const char *);
static void condition_macro(int, int);
-static void inittable();
static int reserved(char *);
/*
@@ -97,11 +96,6 @@
crflag = 1; /* require '\n' as a token */
cppmode = 1; /* treat '::' as a token */
- /*
- * set up reserved word table.
- */
- inittable();
-
while ((cc = nexttoken(interested, reserved)) != EOF) {
if (cc == '~' && level == stack[classlevel].level)
continue;
@@ -756,8 +750,8 @@
{"while", CPP_WHILE},
};
-static void
-inittable()
+void
+Cpp_inittable()
{
qsort(words, sizeof(words)/sizeof(struct words), sizeof(struct words),
cmp);
}
Index: gctags/gctags.c
===================================================================
RCS file: /cvsroot/global/global/gctags/gctags.c,v
retrieving revision 1.17
diff -u -r1.17 gctags.c
--- gctags/gctags.c 26 Feb 2003 01:11:41 -0000 1.17
+++ gctags/gctags.c 26 Mar 2003 12:32:16 -0000
@@ -240,6 +240,13 @@
}
/*
+ * set up reserved word table.
+ */
+ C_inittable();
+ Cpp_inittable();
+ java_inittable();
+
+ /*
* pick up files and parse them.
*/
for (; argc > 0; argv++, argc--) {
Index: gctags/gctags.h
===================================================================
RCS file: /cvsroot/global/global/gctags/gctags.h,v
retrieving revision 1.7
diff -u -r1.7 gctags.h
--- gctags/gctags.h 11 Aug 2002 07:05:54 -0000 1.7
+++ gctags/gctags.h 26 Mar 2003 12:32:16 -0000
@@ -62,7 +62,10 @@
int isnotfunction(char *);
int cmp(const void *, const void *);
void C(int);
+void C_inittable();
void Cpp(void);
+void Cpp_inittable();
int isCpp(void);
void assembler(void);
void java(void);
+void java_inittable();
Index: gctags/java.c
===================================================================
RCS file: /cvsroot/global/global/gctags/java.c,v
retrieving revision 1.6
diff -u -r1.6 java.c
--- gctags/java.c 23 Feb 2003 13:02:02 -0000 1.6
+++ gctags/java.c 26 Mar 2003 12:32:16 -0000
@@ -40,7 +40,6 @@
#include "strlimcpy.h"
#include "token.h"
-static void inittable();
static int reserved(char *);
/*
@@ -69,11 +68,6 @@
target = (sflag) ? SYM : ((rflag) ? REF : DEF);
startclass = startthrows = startequal = 0;
- /*
- * set up reserved word table.
- */
- inittable();
-
while ((c = nexttoken(interested, reserved)) != EOF) {
switch (c) {
case SYMBOL: /* symbol */
@@ -232,8 +226,8 @@
{"widefp", J_WIDEFP},
};
-static void
-inittable()
+void
+java_inittable()
{
qsort(words, sizeof(words)/sizeof(struct words), sizeof(struct words),
cmp);
}
----
Hideki IWAMOTO address@hidden
- [PATCH] set up reserved word table before using isCpp,
Hideki IWAMOTO <=