Category Archives: antlr

Resolve ambiguities in antlr v3

When there is ambiguities in writing antlr grammar, there are different ways to solve it. 1. Simply avoid them. This is the ideal way when it’s possible. 2. Turn on backtracking, which is most inefficient way. 3. Use left factoring. … Continue reading

Posted in antlr | Leave a comment

ANTLR v3 Tutorials Aggregation

Here are some tutorial links for learning antlr v3: The Getting Started Tutorial from Official Site is Damn Good! ANTLR Works is a damn good tool! The Definitive Antlr Reference is a good book ANTLR 3.X Tutorials are good video … Continue reading

Posted in antlr, DSL, eclipse | Tagged , , | Leave a comment

Retrieve Line Numbers and Column Numbers in your ANTLR AST

We know that you can easily get the line numbers and column numbers information from the lexer token, via the properties: line & pos. When facing an Abstract Syntax Tree (AST), the rules may be rewritten so that the tree … Continue reading

Posted in antlr | Leave a comment

Very nice video for Eclipse & ANTLR v3 development

If you are doing antlr v3 for Java, you can be very interested in this series of video tutorials. It demos how to develop with antlr3 IDE, and also the process of a small language. It credits to Marcel for … Continue reading

Posted in antlr, java | Tagged , , , | Leave a comment