Skip to content

nielsutrecht/antlr-pres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Antlr 4 Presentation Code

This repo contains a small simple grammar and some java code used to demonstrate Antlr 4.

Notes

  • Order of rules matter! A higher matching rule has precedence over lower matching rules.
  • Lexing / parsing are two totally different stages. A lexer turns a character stream into a stream of tokens. The parser then builds an Abstract Syntax Tree from this token stream.
  • Antlr 4 is not backward compatible!

Interesting links

Maven integration

Pom.xml:

<build>
    <plugins>
        <plugin>
            <groupId>org.antlr</groupId>
            <artifactId>antlr4-maven-plugin</artifactId>
            <version>4.2.2</version>
            <configuration>
                <listener>false</listener>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>antlr4</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4-runtime</artifactId>
        <version>4.2.2</version>
    </dependency>
<dependencies>

About

Antlr 4 Presentation Code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published