Skip to content

Commit

Permalink
Move the parser options into the .jj file and add a javacc
Browse files Browse the repository at this point in the history
compliation plugin to the pom.

Signed-off-by: Chris Larsen <[email protected]>
  • Loading branch information
manolama committed Nov 3, 2015
1 parent 8c74b89 commit d9c61a5
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions pom.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,28 @@
</configuration>
</plugin>

<plugin>
<groupId>com.helger.maven</groupId>
<artifactId>ph-javacc-maven-plugin</artifactId>
<version>2.8.0</version>
<executions>
<execution>
<id>jjc</id>
<phase>generate-sources</phase>
<goals>
<goal>javacc</goal>
</goals>
<configuration>
<jdkVersion>1.6</jdkVersion>
<javadocFriendlyComments>true</javadocFriendlyComments>
<packageName>net.opentsdb.query.expression.parser</packageName>
<sourceDirectory>${basedir}/src/</sourceDirectory>
<outputDirectory>${project.build.directory}/generated-sources/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>

Expand Down
6 changes: 6 additions & 0 deletions src/parser.jj
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/** Options required by Maven */
options {
STATIC = false;
LOOKAHEAD = 5;
}

PARSER_BEGIN(SyntaxChecker)
package net.opentsdb.query.expression.parser;

Expand Down

0 comments on commit d9c61a5

Please sign in to comment.