The Artima Developer Community
Sponsored Link

Java Buzz Forum
Mark Volkmann: An Introduction To ANTLR v3

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Weiqi Gao

Posts: 1808
Nickname: weiqigao
Registered: Jun, 2003

Weiqi Gao is a Java programmer.
Mark Volkmann: An Introduction To ANTLR v3 Posted: Feb 18, 2008 8:02 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Weiqi Gao.
Original Post: Mark Volkmann: An Introduction To ANTLR v3
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Latest Java Buzz Posts
Latest Java Buzz Posts by Weiqi Gao
Latest Posts From Weiqi Gao's Weblog

Advertisement

Last Friday, Mark Volkmann presented a tutorial on ANTLR v3 at the OCI internal Java lunch. Since Mark has posted his presentation slides out on the internet, I did not take my usual amount of notes.

For me, ANTLR has been something that I'm aware of for a long time. I may have encountered it before it became ANTLR (PCCTS) when it was C++ based. However, its lack of applicability in everyday programming and the terseness of the documentation meant that I never get to know it well enough to actually use it in production code. The situation changed last year when the Pragmatic Bookshelf published the The Definitive ANTLR Reference book.

I have been staring at my copy of the book for a few months waiting for the time when I would have a big chunk of time to start reading and experimenting with it. Mark's talk gave me enough of a push to start my experimentation with ANTLR v3. Hopefully, this time I can sustain my energy and finish the book.

And one particularly good thing about Mark's talk is that its accompanied by a couple of examples that I can play with. Here's what the example does:

[weiqi@gao Math]$ java -jar build/math.jar 
math> f(x) = x^2 - 3x + 2
math> print f()
f(x) = x^2 - 3x + 2
math> print f'()
f'(x) = 2x - 3
math> print f(3)
2.0
math> help
In the help below
* fn stands for function name
* n stands for a number
* v stands for variable

To define
* a variable: v = n
* a function from a polynomial: fn(v) = polynomial-terms
  (for example, f(x) = 3x^2 - 4x + 1)
* a function from adding or subtracting two others: fn3 = fn1 +|-ghg fn2
  (for example, h = f + g)

To print
* a literal string: print "text"
* a number: print n
* the evaluation of a function: print fn(n | v)
* the defintion of a function: print fn()
* the derivative of a function: print fn'()
* multiple items on the same line: print i1 i2 ... in

To list
* variables defined: list variables
* functions defined: list functions

To get help: help or ?

To exit: exit or quit

If you've been trying to get to know a little bit about ANTLR but never have the right incentive or courage to open the book, give Mark's presentation material a try. And if you are in the St. Louis area, Mark will be giving the same presentation at the NFJS conference in March and the St. Louis Java Users Group in June.

Come!

Read: Mark Volkmann: An Introduction To ANTLR v3

Topic: Deliver On-the-Fly Mapping Services to Your Rich Desktop Java Application, Part 1 Previous Topic   Next Topic Topic: MyEclipse Blue Edition Launched: Low Cost Alternative to RAD for WebSphere Development

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use