Back to Blog
January 17, 2014·Tracey Welson-Rossman

ANTLR4 Grammar

Charioteer John Shepard recently wrote about ANTLR4 Grammar on his blog. Read more inside.

John Shepard recently wrote about ANTLR4 grammar on his blog.

"In Terrence Parr's delightfully clear book on ANTLR4, he has an example calculator that uses visitors. I, of course, wondered what a calculator would look like if it used listeners. This is the result.

Here is the grammar. There no longer needs to be recursion for the expression (which was required in earlier version of ANTLR). The priority is now based on the order. Note the comments. These are not optional, and are used for the names of the generated methods."

[Read more...]

Comments

Ready to transform your business?

We solve complex business problems with technology. Let's discuss how we can help you build, modernize, and grow.

Start A Conversation