Antlr Lecture at Conexao Java 2007 3

Posted by Fernando Meyer on November 12, 2007

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

Trackbacks

Trackbacks are closed.

Comments

Leave a response

  1. Danilo Sato Tue, 20 Nov 2007 00:23:09 PST

    Great lecture Fernando!

    I think the link to the slides is broken. I was able to download it from: http://fmeyer.org/downloads/antlr-cj-lab.pdf.tar.gz

  2. Fernando Meyer Tue, 20 Nov 2007 13:52:52 PST

    Thanks Danilo :)

    Just updated the slides link, everything working now.

  3. Mister Mon, 28 Jul 2008 13:56:44 PDT

    the link is broken :-(

Comments