From d9c61a5db4a1fc0f92597c63a77b5d5868cf8471 Mon Sep 17 00:00:00 2001 From: Chris Larsen Date: Tue, 3 Nov 2015 12:27:57 -0800 Subject: [PATCH] Move the parser options into the .jj file and add a javacc compliation plugin to the pom. Signed-off-by: Chris Larsen --- Makefile.am | 2 +- pom.xml.in | 22 ++++++++++++++++++++++ src/parser.jj | 6 ++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 7ab7eb5924..acc7c609fa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -687,7 +687,7 @@ $(JAVADOC_DIR)/index.html: $(tsdb_SRC) $? $(builddata_SRC) runjavacc: - $(JAVA) -cp $(JAVACC) javacc -STATIC:false -LOOKAHEAD:5 -OUTPUT_DIRECTORY:$(expr_src_dir) $(abs_srcdir)/src/parser.jj; echo PWD: `pwd`; + $(JAVA) -cp $(JAVACC) javacc -OUTPUT_DIRECTORY:$(expr_src_dir) $(abs_srcdir)/src/parser.jj; echo PWD: `pwd`; dist-hook: $(mkdir_p) $(distdir)/.git diff --git a/pom.xml.in b/pom.xml.in index cf68ef34e6..8e37d22217 100644 --- a/pom.xml.in +++ b/pom.xml.in @@ -314,6 +314,28 @@ + + com.helger.maven + ph-javacc-maven-plugin + 2.8.0 + + + jjc + generate-sources + + javacc + + + 1.6 + true + net.opentsdb.query.expression.parser + ${basedir}/src/ + ${project.build.directory}/generated-sources/ + + + + + diff --git a/src/parser.jj b/src/parser.jj index 8517b29f07..29b00c9e40 100644 --- a/src/parser.jj +++ b/src/parser.jj @@ -1,3 +1,9 @@ +/** Options required by Maven */ +options { + STATIC = false; + LOOKAHEAD = 5; +} + PARSER_BEGIN(SyntaxChecker) package net.opentsdb.query.expression.parser;