Home

Awesome

tulipcc-maven-plugin

An updated version of the javacc-maven-plugin. Originally it was JavaCC 6.1.3, than updated to JavaCC 7.0 but in the meantime the underlying code is the ParserGeneratorCC project which is a fork of JavaCC 7.0.3 but with slightly improved code and output quality. The main difference is the removed code compatibility for generating code below Java 1.5 - respective options where removed.
For the rest, the parameters etc. where basically not touched, so it should be a drop-in replacement for the old javacc-maven-plugin 2.6. It requires Java 1.8 or higher and Apache Maven 3.x or higher.

It is licensed under the Apache 2 license.

I'm using it e.g. in ph-css for CSS parsing.

Upgrading from the original plugin

The following list is member-gathered when they update to this plugin and is not comprehensive

Maven usage

Example with 3 executions (two javacc and one jjtree-javacc), try with mvn clean process-resources:

    <build>
      ...
      <plugin>
        <groupId>io.github.tulipcc</groupId>
        <artifactId>tulipcc-maven-plugin</artifactId>
        <version>4.1.4</version>
        <executions>
          <execution>
            <id>jjc1</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>javacc</goal>
            </goals>
            <configuration>
              <jdkVersion>1.5</jdkVersion>
              <javadocFriendlyComments>true</javadocFriendlyComments>
              <packageName>org.javacc.parser</packageName>
              <sourceDirectory>src/main/java/org/javacc/parser</sourceDirectory>
              <outputDirectory>${project.build.directory}/generated-sources/javacc1</outputDirectory>
            </configuration>
          </execution>
          <execution>
            <id>jjt2</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>javacc</goal>
            </goals>
            <configuration>
              <jdkVersion>1.5</jdkVersion>
              <javadocFriendlyComments>true</javadocFriendlyComments>
              <packageName>org.javacc.utils</packageName>
              <sourceDirectory>src/main/java/org/javacc/utils</sourceDirectory>
              <outputDirectory>${project.build.directory}/generated-sources/javacc2</outputDirectory>
            </configuration>
          </execution>
          <execution>
            <id>jjt1</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>jjtree-javacc</goal>
            </goals>
            <configuration>
              <jdkVersion>1.5</jdkVersion>
              <javadocFriendlyComments>true</javadocFriendlyComments>
              <packageName>org.javacc.parser</packageName>
              <sourceDirectory>src/main/java/org/javacc/jjtree</sourceDirectory>
              <excludes>
                <exclude>**/parser/**</exclude>
              </excludes>
              <outputDirectory>${project.build.directory}/generated-sources/jjtree1</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      ...
    </build>

Supported goals with the respective parameters are:

Integration tests

External links

News and noteworthy


My personal Coding Styleguide | It is appreciated if you star the GitHub project if you like it.