diff --git a/Makefile.in b/Makefile.in index acef67ec7..2304cda5b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -267,7 +267,7 @@ lexor.cc: $(srcdir)/lexor.lex lexor_keyword.o: lexor_keyword.cc parse.h lexor_keyword.cc: $(srcdir)/lexor_keyword.gperf - gperf -o -i 7 -C -k 1-4,6,9,$$ -L ANSI-C -H keyword_hash -N check_identifier -t $(srcdir)/lexor_keyword.gperf > lexor_keyword.cc || (rm -f lexor_keyword.cc ; false) + gperf -o -i 7 -C -k 1-4,6,9,$$ -H keyword_hash -N check_identifier -t $(srcdir)/lexor_keyword.gperf > lexor_keyword.cc || (rm -f lexor_keyword.cc ; false) iverilog-vpi.man: $(srcdir)/iverilog-vpi.man.in version.exe ./version.exe `head -1 $(srcdir)/iverilog-vpi.man.in`'\n' > $@ diff --git a/autoconf.sh b/autoconf.sh index 0840ac287..8eee0af8e 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -10,7 +10,7 @@ echo "Autoconf in root..." autoconf -f echo "Precompiling lexor_keyword.gperf" -gperf -o -i 7 -C -k 1-4,6,9,\$ -L ANSI-C -H keyword_hash -N check_identifier -t ./lexor_keyword.gperf > lexor_keyword.cc +gperf -o -i 7 -C -k 1-4,6,9,\$ -H keyword_hash -N check_identifier -t ./lexor_keyword.gperf > lexor_keyword.cc echo "Precompiling vhdlpp/lexor_keyword.gperf" -(cd vhdlpp ; gperf -o -i 7 --ignore-case -C -k 1-4,6,9,\$ -L ANSI-C -H keyword_hash -N check_identifier -t ./lexor_keyword.gperf > lexor_keyword.cc ) +(cd vhdlpp ; gperf -o -i 7 --ignore-case -C -k 1-4,6,9,\$ -H keyword_hash -N check_identifier -t ./lexor_keyword.gperf > lexor_keyword.cc ) diff --git a/lexor_keyword.gperf b/lexor_keyword.gperf index 34e994e4a..4bb8d0629 100644 --- a/lexor_keyword.gperf +++ b/lexor_keyword.gperf @@ -3,9 +3,11 @@ * tokenType values are not initialized for the empty table entries. */ %define initializer-suffix ,0,0 +%language=C++ +%define class-name Lkwd %{ -/* Command-line: gperf -o -i 1 -C -k 1-3,$ -L C -H keyword_hash -N check_identifier -tT lexor_keyword.gperf */ +/* Command-line: gperf -o -i 7 -C -k '1-4,6,9,$' -H keyword_hash -N check_identifier -t ./lexor_keyword.gperf */ #include "config.h" #include "parse_misc.h" @@ -362,7 +364,7 @@ int lexor_keyword_mask = 0; int lexor_keyword_code(const char*str, unsigned nstr) { - const struct lexor_keyword*rc = check_identifier(str, nstr); + const struct lexor_keyword*rc = Lkwd::check_identifier(str, nstr); if (rc == 0) return IDENTIFIER; else if ((rc->mask & lexor_keyword_mask) == 0) diff --git a/vhdlpp/Makefile.in b/vhdlpp/Makefile.in index e3622a7c3..ce796c588 100644 --- a/vhdlpp/Makefile.in +++ b/vhdlpp/Makefile.in @@ -124,7 +124,7 @@ parse.h: parse.cc lexor_keyword.o: lexor_keyword.cc parse.h lexor_keyword.cc: $(srcdir)/lexor_keyword.gperf - gperf -o -i 7 --ignore-case -C -k 1-4,6,9,$$ -L ANSI-C -H keyword_hash -N check_identifier -t $(srcdir)/lexor_keyword.gperf > lexor_keyword.cc || (rm -f lexor_keyword.cc ; false) + gperf -o -i 7 --ignore-case -C -k 1-4,6,9,$$ -H keyword_hash -N check_identifier -t $(srcdir)/lexor_keyword.gperf > lexor_keyword.cc || (rm -f lexor_keyword.cc ; false) install: all installdirs $(libdir)/ivl$(suffix)/vhdlpp@EXEEXT@ diff --git a/vhdlpp/lexor_keyword.gperf b/vhdlpp/lexor_keyword.gperf index 647798f27..42fd1bc0d 100644 --- a/vhdlpp/lexor_keyword.gperf +++ b/vhdlpp/lexor_keyword.gperf @@ -3,9 +3,10 @@ * tokenType values are not initialized for the empty table entries. */ %define initializer-suffix ,0,0 - +%language=C++ +%define class-name Lkwd %{ -/* Command-line: gperf -o -i 1 --ignore-case -C -k 1-3,$ -L C -H keyword_hash -N check_identifier -tT lexor_keyword.gperf */ +/* Command-line: gperf -o -i 7 --ignore-case -C -k '1-4,6,9,$' -H keyword_hash -N check_identifier -t lexor_keyword.gperf */ #include "vhdlpp_config.h" #include @@ -134,7 +135,7 @@ int lexor_keyword_mask = GN_KEYWORD_2008; int lexor_keyword_code(const char*str, unsigned nstr) { - const struct lexor_keyword*rc = check_identifier(str, nstr); + const struct lexor_keyword*rc = Lkwd::check_identifier(str, nstr); if (rc == 0) return IDENTIFIER; else if ((rc->mask & lexor_keyword_mask) == 0)