Skip to content

Simple example of ANTLR4 with usage of semantic actions, Listener and Visitor patterns

License

Notifications You must be signed in to change notification settings

RHarryH/antlr4-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: MIT

ANTLR4 Example

This project contains four examples of simple calculator grammar:

  • Calc.g4 contains just grammar without any actions attached
  • CalcSemantic.g4 contains grammar with semantic actions allowing to compute the result of expression
  • CalcPatters.g4 is a variant of grammar with rules labels for use with Listener and Visitor patterns
    • for Listener pattern please check CalcListenerImpl implementation
    • for Visitor pattern please check CalcVisitorImpl implementation

Each example has its corresponding test in ANTLRExampleTest class

About

Simple example of ANTLR4 with usage of semantic actions, Listener and Visitor patterns

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published