diff --git a/dic/Makefile.am b/dic/Makefile.am index f8aed94..2567778 100644 --- a/dic/Makefile.am +++ b/dic/Makefile.am @@ -21,10 +21,11 @@ noinst_LIBRARIES = libdic.a INCLUDES = -I$(top_srcdir) libdic_a_CFLAGS=$(DEBUGFLAGS) -libdic_a_YFLAGS=-d -libdic_a_SOURCES = \ - er.y \ - er.l \ +libdic_a_YFLAGS= +libdic_a_LFLAGS= +libdic_a_SOURCES= \ + ery.y \ + erl.l \ dic_internals.h \ dic_search.c dic_search.h \ dic.c dic.h \ @@ -33,21 +34,30 @@ libdic_a_SOURCES = \ regexp.c regexp.h \ alist.h alist.c +BUILT_SOURCES= \ + libdic_a-erl.c \ + libdic_a-erl.h \ + libdic_a-ery.c \ + libdic_a-ery.h + nodist_libdic_a_SOURCES= \ - er.c \ - scanner.h \ - libdic_a-er.c \ - libdic_a-er.h + libdic_a-erl.c \ + libdic_a-erl.h \ + libdic_a-ery.c \ + libdic_a-ery.h -BUILT_SOURCES=er.c \ - scanner.h \ - libdic_a-er.c \ - libdic_a-er.h +CLEANFILES= \ + libdic_a-erl.c \ + libdic_a-erl.h \ + libdic_a-ery.c \ + libdic_a-ery.h -CLEANFILES=er.c \ - scanner.h \ - libdic_a-er.c \ - libdic_a-er.h + +## automake workaround to generate .h file +libdic_a-erl.h: erl.l + ${LEX} ${srcdir}/erl.l + +##################################### ##################################### if BUILD_DICTOOLS @@ -67,8 +77,8 @@ listdic_SOURCES= \ dic.c dic.h \ listdic.c -regexp_SOURCES= regexpmain.c #regexp_CFLAGS=-DDEBUG_RE +regexp_SOURCES=regexpmain.c regexp_LDADD=libdic.a endif diff --git a/dic/er.l b/dic/erl.l similarity index 97% rename from dic/er.l rename to dic/erl.l index b4a20bc..207ce9f 100644 --- a/dic/er.l +++ b/dic/erl.l @@ -20,14 +20,14 @@ #include "dic.h" #include "regexp.h" -#include "libdic_a-er.h" +#include "libdic_a-ery.h" #define MASK_TO_REMOVE 0x1F %} %option prefix="regexp" %option outfile="lex.yy.c" -%option header-file="scanner.h" +%option header-file="libdic_a-erl.h" %option reentrant bison-bridge %option bison-locations %option noyywrap nounput diff --git a/dic/er.y b/dic/ery.y similarity index 92% rename from dic/er.y rename to dic/ery.y index e9eb119..6b4ce4d 100644 --- a/dic/er.y +++ b/dic/ery.y @@ -25,9 +25,12 @@ #include "dic.h" #include "regexp.h" -#include "libdic_a-er.h" -#include "scanner.h" +#include "libdic_a-ery.h" +#include "libdic_a-erl.h" +/* ************************************************** */ +/* ************************************************** */ +/* ************************************************** */ /** * function prototype for parser generated by bison @@ -35,6 +38,7 @@ int regexpparse(yyscan_t scanner, NODE** root, struct search_RegE_list_t *list, struct regexp_error_report_t *err); + /** * function prototype for error reporting */ @@ -43,6 +47,9 @@ void regexperror(YYLTYPE *llocp, yyscan_t scanner, NODE** root, struct regexp_error_report_t *err, char const *msg); +/* ************************************************** */ +/* ************************************************** */ +/* ************************************************** */ %} %union { @@ -270,8 +277,10 @@ vardis: LEX_CHAR %% -void regexperror(YYLTYPE *llocp, yyscan_t yyscanner, NODE** root, - struct search_RegE_list_t *list, +#define UNUSED __attribute__((unused)) + +void regexperror(YYLTYPE *llocp, yyscan_t UNUSED yyscanner, NODE UNUSED **root, + struct search_RegE_list_t UNUSED *list, struct regexp_error_report_t *err, char const *msg) { err->pos1 = llocp->first_column; @@ -282,8 +291,4 @@ void regexperror(YYLTYPE *llocp, yyscan_t yyscanner, NODE** root, /* * shut down the compiler */ -static int yy_init_globals (yyscan_t yyscanner ) -{ - yy_init_globals(yyscanner); - return 0; -} +//int yy_init_globals (yyscan_t yyscanner);