Fernando Meyer

As I promised at CJ2007 I’m uploading my slides and demo code from my ANTLR lecture. I got really surprised about people’s interest in ANTLR, compiler theory and DSL in general.

You can import the demo in both eclipse or Intellij (or use maven to generate your own ide config). to run the code without an ide just unpack and execute the runconsole.sh you can set variable’s values ex:

x=1

y=2

And execute some expression using these predefined variables ex:

3*(x-y)*(x/y)

when you finish to input your expression just press ctrl+D on unix or ctrl+Z on windows ( EOF char ) to execute it
ps: Thanks to Danilo Sato to help me figure out a Grammar ambiguity, my approach wasn’t the optimal solution to resolve the problem.

*Update, Sami Koivu just sent me the pictures from my lecture,

Explaining the compiler process

Explaining the compiler theory

Hands on

Hands On

The antlr grammar as itself

The Antlr Grammar file as itself

Drools DLS sample

Drools Sample DSL

follow me on Twitter

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.