Add new ANTLR parser for DAAP queries

This commit is contained in:
Julien BLACHE
2009-06-02 15:51:38 +02:00
parent c4cf7c08a4
commit 68db2ae7c2
10 changed files with 741 additions and 3 deletions

View File

@@ -9,8 +9,17 @@ if COND_MUSEPACK
MUSEPACKSRC=scan-mpc.c
endif
ANTLR_GRAMMARS = \
DAAP.g DAAP2SQL.g
ANTLR_SOURCES = \
DAAPLexer.c DAAPLexer.h DAAPParser.c DAAPParser.h \
DAAP2SQL.c DAAP2SQL.h
ANTLR_PRODUCTS =
mt_daapd_CPPFLAGS = -D_GNU_SOURCE @AVAHI_CFLAGS@ @SQLITE3_CFLAGS@ @FFMPEG_CFLAGS@ @CONFUSE_CFLAGS@ @TAGLIB_CFLAGS@ @MINIXML_CFLAGS@
mt_daapd_LDADD = @AVAHI_LIBS@ @SQLITE3_LIBS@ @FFMPEG_LIBS@ @CONFUSE_LIBS@ @FLAC_LIBS@ @TAGLIB_LIBS@ @LIBEVENT_LIBS@ @LIBAVL_LIBS@ @MINIXML_LIBS@
mt_daapd_LDADD = @AVAHI_LIBS@ @SQLITE3_LIBS@ @FFMPEG_LIBS@ @CONFUSE_LIBS@ @FLAC_LIBS@ @TAGLIB_LIBS@ @LIBEVENT_LIBS@ @LIBAVL_LIBS@ @MINIXML_LIBS@ @ANTLR3C_LIBS@
mt_daapd_SOURCES = main.c \
logger.c logger.h \
conffile.c conffile.h \
@@ -24,6 +33,7 @@ mt_daapd_SOURCES = main.c \
httpd_daap.c httpd_daap.h \
transcode.c transcode.h \
misc.c misc.h \
daap_query.c daap_query.h \
db-generic.c db-generic.h \
scan-wma.c \
smart-parser.c smart-parser.h \
@@ -31,6 +41,34 @@ mt_daapd_SOURCES = main.c \
db-sql.c db-sql.h db-sql-sqlite3.c db-sql-sqlite3.h\
$(FLACSRC) $(MUSEPACKSRC)
EXTRA_DIST = scan-mpc.c \
nodist_mt_daapd_SOURCES = \
$(ANTLR_SOURCES)
EXTRA_DIST = \
$(ANTLR_GRAMMARS) \
scan-mpc.c \
scan-flac.c \
ff-dbstruct.h
# Let's help the dependencies a little.
daap_query.c: DAAPLexer.h DAAPParser.h DAAP2SQL.h
SUFFIXES = .g .u
%.tokens %.c %Lexer.c %Parser.c %Lexer.h %Parser.h %.h: %.g
@ANTLR@ $(ANTLR_OPTIONS) $<
%.u: %.g
@ANTLR@ -depend $< > $@
@echo -n "ANTLR_PRODUCTS += " > $@.tmp
@grep : $@ | cut -d : -f 1 | tr -d ' ' | { while read f; do test "$$f" != "$<" && echo -n "$$f "; done } >> $@.tmp
@cat $@.tmp >> $@
rm $@.tmp
clean-local:
-rm $(ANTLR_PRODUCTS)
rm $(ANTLR_GRAMMARS:.g=.u)
-include $(ANTLR_GRAMMARS:.g=.u)