This project contains four examples of simple calculator grammar:
Calc.g4contains just grammar without any actions attachedCalcSemantic.g4contains grammar with semantic actions allowing to compute the result of expressionCalcPatters.g4is a variant of grammar with rules labels for use with Listener and Visitor patterns- for Listener pattern please check
CalcListenerImplimplementation - for Visitor pattern please check
CalcVisitorImplimplementation
- for Listener pattern please check
Each example has its corresponding test in ANTLRExampleTest class