diff --git a/configure.in b/configure.in index d9c7f27..3894424 100644 --- a/configure.in +++ b/configure.in @@ -19,6 +19,8 @@ AC_PROG_MAKE_SET AC_PROG_LIBTOOL AC_PROG_AWK AC_PROG_RANLIB +AC_PROG_YACC +AC_PROG_LEX # Checks for libraries. # For SWIG & Python diff --git a/src/apps/referential/Makefile.am b/src/apps/referential/Makefile.am index 7c64bd0..d61063b 100644 --- a/src/apps/referential/Makefile.am +++ b/src/apps/referential/Makefile.am @@ -1,4 +1,5 @@ LDADD=$(top_builddir)/src/stasis/libstasis.la $(top_builddir)/src/libdfa/librw.la -toplevel_SOURCES=toplevel.c algebra.c dml.c -noinst_PROGRAMS=toplevel +## TODO: Get lex + yacc to work w/ automake +#toplevel_SOURCES=toplevel.c algebra.c dml.c ddl.c tuple.c lang/ast.c lang/lexer.l lang/parse.y +#noinst_PROGRAMS=toplevel AM_CFLAGS=-g -Wall -pedantic -std=gnu99 diff --git a/src/apps/referential/lang/CMakeLists.txt b/src/apps/referential/lang/CMakeLists.txt index a8bfe3a..d4d2dd9 100644 --- a/src/apps/referential/lang/CMakeLists.txt +++ b/src/apps/referential/lang/CMakeLists.txt @@ -1,10 +1,10 @@ BISON_TARGET(RefParser ${CMAKE_CURRENT_SOURCE_DIR}/parse.y ${CMAKE_CURRENT_BINARY_DIR}/y.tab.c) -FLEX_TARGET(RefParser ${CMAKE_CURRENT_SOURCE_DIR}/lexer.lex ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c) +FLEX_TARGET(RefParser ${CMAKE_CURRENT_SOURCE_DIR}/lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c) #SET(INCLUDE_DIR ${INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) #COPY_FILE(${CMAKE_CURRENT_SOURCE_DIR}/ast.h ${CMAKE_CURRENT_BINARY_DIR}/ast.h) ADD_LIBRARY(refparse ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c ${CMAKE_CURRENT_BINARY_DIR}/y.tab.c ${CMAKE_CURRENT_SOURCE_DIR}/ast.c) -ADD_EXECUTABLE(parser ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c ${CMAKE_CURRENT_BINARY_DIR}/y.tab.c ${CMAKE_CURRENT_SOURCE_DIR}/ast.c ${CMAKE_CURRENT_SOURCE_DIR}/parse.c) +ADD_EXECUTABLE(parse_test ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c ${CMAKE_CURRENT_BINARY_DIR}/y.tab.c ${CMAKE_CURRENT_SOURCE_DIR}/ast.c ${CMAKE_CURRENT_SOURCE_DIR}/parse_test.c) SET_TARGET_PROPERTIES(refparse PROPERTIES COMPILE_FLAGS "-Wno-implicit -Wno-unused -I ${CMAKE_CURRENT_SOURCE_DIR}") -SET_TARGET_PROPERTIES(parser PROPERTIES COMPILE_FLAGS "-Wno-implicit -Wno-unused -I ${CMAKE_CURRENT_SOURCE_DIR}") +SET_TARGET_PROPERTIES(parse_test PROPERTIES COMPILE_FLAGS "-Wno-implicit -Wno-unused -I ${CMAKE_CURRENT_SOURCE_DIR}") ADD_TEST(test_parser ${CMAKE_CURRENT_SOURCE_DIR}/test_parser.pl) diff --git a/src/apps/referential/lang/lexer.lex b/src/apps/referential/lang/lexer.l similarity index 98% rename from src/apps/referential/lang/lexer.lex rename to src/apps/referential/lang/lexer.l index 99754f5..0fdc9e8 100644 --- a/src/apps/referential/lang/lexer.lex +++ b/src/apps/referential/lang/lexer.l @@ -3,7 +3,7 @@ #include #include "ast.h" #include "y.tab.h" -#include "parser_private.h" +#include "src/apps/referential/lang/parser_private.h" //#define DBG(x) printf("%s\t",x); ECHO #define DBG(x) diff --git a/src/apps/referential/lang/parse.y b/src/apps/referential/lang/parse.y index 579cdd4..a58150f 100644 --- a/src/apps/referential/lang/parse.y +++ b/src/apps/referential/lang/parse.y @@ -4,9 +4,9 @@ #include #include -#include "ast.h" +#include "src/apps/referential/lang/ast.h" -#include "/home/sears/stasis/src/apps/referential/lang/parser_private.h" +#include "src/apps/referential/lang/parser_private.h" void parse(char *buf, expr_list **result) diff --git a/src/apps/referential/lang/parse.c b/src/apps/referential/lang/parse_test.c similarity index 100% rename from src/apps/referential/lang/parse.c rename to src/apps/referential/lang/parse_test.c diff --git a/utilities/swig/Makefile.am b/utilities/swig/Makefile.am index 27e9889..2597e18 100644 --- a/utilities/swig/Makefile.am +++ b/utilities/swig/Makefile.am @@ -1,13 +1,15 @@ +## XXX fix swig! -BUILT_SOURCES = stasis_wrap.cc -all: $(BUILD_SOURCES) -python_PYTHON = stasis.py -pyexec_LTLIBRARIES = _stasis.la -_stasis_la_SOURCES = stasis_wrap.cc -_stasis_la_CPPFLAGS = $(SWIG_PYTHON_CPPFLAGS) -I$(top_srcdir) -I$(top_srcdir)/src -_stasis_la_LDFLAGS = -module -_stasis_la_LIBADD = $(top_srcdir)/src/stasis/libstasis.la $(top_srcdir)/src/libdfa/librw.la - -stasis_wrap.cc : lladd.i - $(SWIG) $(SWIG_PYTHON_OPT) -I$(top_srcdir)/src -I$(top_srcdir) -o $@ $< +#BUILT_SOURCES = stasis_wrap.cc +# +#all: $(BUILD_SOURCES) +#python_PYTHON = stasis.py +#pyexec_LTLIBRARIES = _stasis.la +#_stasis_la_SOURCES = stasis_wrap.cc +#_stasis_la_CPPFLAGS = $(SWIG_PYTHON_CPPFLAGS) -I$(top_srcdir) -I$(top_srcdir)/src +#_stasis_la_LDFLAGS = -module +#_stasis_la_LIBADD = $(top_srcdir)/src/stasis/libstasis.la $(top_srcdir)/src/libdfa/librw.la +# +#stasis_wrap.cc : lladd.i +# $(SWIG) $(SWIG_PYTHON_OPT) -I$(top_srcdir)/src -I$(top_srcdir) -o $@ $<