[antlr-interest] Pie and simple expression calculator

Kyle Ferrio kferrio at gmail.com
Mon Jan 2 10:10:51 PST 2012


Your language ounds a little like MATLAB. Someone posted an approximate
MATLAB grammar a few months ago for antlr 3.x.

If you are familiar with classic "calculator" examples for flex/bison, then
you might really like how Honey Badger (antlr 4) makes short work of
expression parsing.

If you want to get going quickly, you might want to avoid things like
pythonesque significant whitespace.  And strongly visual scope delimiters
may make it easier to get started.  Your resulting language would not be
the first to be accused of being "noisy."  :)

Kyle
 On Jan 2, 2012 10:45 AM, "goodwin" <goodwin at essence-property.com> wrote:

>
> I am new to ANTLR, and want some capabilities similar to Pie and the
> expression calculator, as extended with functions. I work with floating
> point data, and want to extend the intrinsic functions (e.g. Sin, Cos etc.)
> and all calculations will actually be done on float arrays.
>
>
> I want a simple grammar suitable for engineers - not too sure whether
> Python
> is the best starting point...I myself prefer a few brackets and endif etc.
>
>
> However, the implementations of Pie and the simple expression calculator
> are
> very different.
>
>
> Do you think it is best for me to start with Pie and adapt it for my needs,
> or look at both approaches and learn from them both?
>
>
> My main purpose is to progress rapidly, not to become an expert in ANTLR.
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>


More information about the antlr-interest mailing list