Skip to content

Instantly share code, notes, and snippets.

@asaushkin
Created March 24, 2018 17:47
Show Gist options
  • Save asaushkin/aaadb3935e4aeeadf383f1895d3160d5 to your computer and use it in GitHub Desktop.
Save asaushkin/aaadb3935e4aeeadf383f1895d3160d5 to your computer and use it in GitHub Desktop.
ANTLR4 pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.asaushkin</groupId>
<artifactId>AntlrParser</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.7.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr4-maven-plugin</artifactId>
<version>4.7.1</version>
<executions>
<execution>
<goals>
<goal>antlr4</goal>
</goals>
<configuration>
<visitor>true</visitor>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@asaushkin
Copy link
Author

All grammar files must be placed in the src/main/antlr4[/my/package/name]

@asaushkin
Copy link
Author

mvn package generates source files for the grammar files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment