[antlr-interest] Excel Like Expression Parser in ANTLR

Robert Stehwien rstehwien at gmail.com
Sun Apr 20 22:06:19 PDT 2008


I posted a blog entry about creating an Excel like expression parser
for Adobe Flex using ANTLR 3.1 and the new ActionScript target:
http://arcanearcade.blogspot.com/2008/04/using-antlr-to-create-excel-like.html

The flex application (linked off the blog post) has source code
enabled (just right click to see) and you can view or download the
source here:
http://www.arcanearcade.com/Flex/FlexFormula/srcview/index.html

I really wanted to reuse the existing FormulaTree object in
callFunction() but couldn't figure out how to get the right token
index to push/pop onto and off the stream so I ended up creating a new
FormulaTree to evaluate expressions inside functions.

Any comments or suggestions are appreciated and feel free to use the
grammar if it helps.

Many thanks to George Scott for fixing the ActionScript target as I
worked on this grammar.

--Robert


More information about the antlr-interest mailing list