Makefile.in (keyword.h): Generate using gperf language 'C'...

* Makefile.in (keyword.h): Generate using gperf language 'C', not
        'KR-C', so gperf uses the `const' keyword on strings.
        * keyword.gperf (java_keyword): Const-ify a char*.

From-SVN: r26082
This commit is contained in:
Kaveh R. Ghazi 1999-03-31 08:05:08 +00:00 committed by Kaveh Ghazi
parent 8e6befc1df
commit 6a28cabc20
4 changed files with 15 additions and 8 deletions

View File

@ -1,3 +1,10 @@
Wed Mar 31 11:00:32 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (keyword.h): Generate using gperf language 'C', not
'KR-C', so gperf uses the `const' keyword on strings.
* keyword.gperf (java_keyword): Const-ify a char*.
Tue Mar 30 11:31:53 1999 Alexandre Petit-Bianco <apbianco@cygnus.com> Tue Mar 30 11:31:53 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (patch_bc_statement): Fixed identation and a bogus * parse.y (patch_bc_statement): Fixed identation and a bogus

View File

@ -247,7 +247,7 @@ lex.c: keyword.h lex.h
lang.o: $(srcdir)/java-tree.def lang.o: $(srcdir)/java-tree.def
keyword.h: keyword.gperf keyword.h: keyword.gperf
gperf -L KR-C -F ', 0' -p -t -j1 -i 1 -g -o -N java_keyword -k1,3,$$ \ gperf -L C -F ', 0' -p -t -j1 -i 1 -g -o -N java_keyword -k1,3,$$ \
keyword.gperf > keyword.h keyword.gperf > keyword.h
jcf-path.o : jcf-path.c $(CONFIG_H) $(srcdir)/../system.h jcf.h jcf-path.o : jcf-path.c $(CONFIG_H) $(srcdir)/../system.h jcf.h

View File

@ -25,7 +25,7 @@ of Sun Microsystems, Inc. in the United States and other countries.
The Free Software Foundation is independent of Sun Microsystems, Inc. */ The Free Software Foundation is independent of Sun Microsystems, Inc. */
%} %}
struct java_keyword { char *name; int token; }; struct java_keyword { const char *name; int token; };
%% %%
abstract, ABSTRACT_TK abstract, ABSTRACT_TK
default, DEFAULT_TK default, DEFAULT_TK

View File

@ -1,5 +1,5 @@
/* KR-C code produced by gperf version 2.7.1 (19981006 egcs) */ /* C code produced by gperf version 2.7.1 (19981006 egcs) */
/* Command-line: gperf -L KR-C -F , 0 -p -t -j1 -i 1 -g -o -N java_keyword -k1,3,$ keyword.gperf */ /* Command-line: gperf -L C -F , 0 -p -t -j1 -i 1 -g -o -N java_keyword -k1,3,$ keyword.gperf */
/* Keyword definition for the GNU compiler for the Java(TM) language. /* Keyword definition for the GNU compiler for the Java(TM) language.
Copyright (C) 1997, 1998 Free Software Foundation, Inc. Copyright (C) 1997, 1998 Free Software Foundation, Inc.
Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com) Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
@ -25,7 +25,7 @@ Java and all Java-based marks are trademarks or registered trademarks
of Sun Microsystems, Inc. in the United States and other countries. of Sun Microsystems, Inc. in the United States and other countries.
The Free Software Foundation is independent of Sun Microsystems, Inc. */ The Free Software Foundation is independent of Sun Microsystems, Inc. */
struct java_keyword { char *name; int token; }; struct java_keyword { const char *name; int token; };
#define TOTAL_KEYWORDS 50 #define TOTAL_KEYWORDS 50
#define MIN_WORD_LENGTH 2 #define MIN_WORD_LENGTH 2
@ -39,7 +39,7 @@ __inline
#endif #endif
static unsigned int static unsigned int
hash (str, len) hash (str, len)
register char *str; register const char *str;
register unsigned int len; register unsigned int len;
{ {
static unsigned char asso_values[] = static unsigned char asso_values[] =
@ -91,7 +91,7 @@ __inline
#endif #endif
struct java_keyword * struct java_keyword *
java_keyword (str, len) java_keyword (str, len)
register char *str; register const char *str;
register unsigned int len; register unsigned int len;
{ {
static struct java_keyword wordlist[] = static struct java_keyword wordlist[] =
@ -168,7 +168,7 @@ java_keyword (str, len)
if (key <= MAX_HASH_VALUE && key >= 0) if (key <= MAX_HASH_VALUE && key >= 0)
{ {
register char *s = wordlist[key].name; register const char *s = wordlist[key].name;
if (*str == *s && !strcmp (str + 1, s + 1)) if (*str == *s && !strcmp (str + 1, s + 1))
return &wordlist[key]; return &wordlist[key];