I like processing code for several purposes, like static analysis or automated refactoring. The interesting part to me is to reason on the models you build from the Abstract Syntax Tree (AST). To get there you need a way to get the AST from your source files. This can be done easily using ANTLR and the collection of complete grammars available ...
Read More »Playing with ANTLR4, Primefaces extensions for Code Mirror and web-based DSLs
DSLs are cool things, but it wasn’t clear to me what they were good for. Then I realized they are good for: get rid of complex UIs which means faster way to do things That’s it. I’ve came to this conclusion when I read this blog. If your user is techie and are not afraid of a SQL-like syntax way ...
Read More »Creating External DSLs using ANTLR and Java
In my previous post quite sometime back I had written about Internal DSLs using Java. In the book Domain Specific Languages by Martin Fowler, he discusses about another type of DSL called external DSLs in which the DSL is written in another language which is then parsed by the host language to populate the semantic model. In the previous example ...
Read More »ANTLR: Getting Started
This post drives you towards the basics of ANTLR. Previously, we had learnt about setting up of ANTLR as an external tool.RECAP! It’s here: ANTLR External Tool :) So, here we go…. What is ANTLR? • ANother Tool for Language Recognition, is a language tool that provides a framework for constructing recognizers, interpreters, compilers, and translators from grammatical descriptions containing ...
Read More »ANTLR Tutorial – Hello Word
Antlr stands for ANother Tool for Language Recognition. The tool is able to generate compiler or interpreter for any computer language. Besides obvious use, e.g. need to parse a real ‘big’ programming language such as Java, PHP or SQL, it can help with smaller, more common tasks. It is useful any time you need to evaluate expressions unknown at compile-time ...
Read More »