[antlr-interest] question about antlr

Bart Kiers bkiers at gmail.com
Thu May 26 08:56:50 PDT 2011


Hi Patrick,

I have a hard time understanding what it is you're trying to do.
Instead of springing the entire grammar on us (or me), could you extract
only those rules that are causing the problem(s)? And could you include some
example input you'd like to match/parse?

Regards,

Bart Kiers.


On Thu, May 26, 2011 at 4:04 PM, Patrick Hofman <
patrick.hofman at invantive.com> wrote:

> And now the grammar
>
> From: Patrick Hofman
> Sent: donderdag 26 mei 2011 15:35
> To: antlr-interest at antlr.org
> Subject: question about antlr
>
> Hi all,
>
> I have bought the ANTLR book in order to learn ANTLR better, but I still
> don't get how to fix one thing. I hope you can help me with that.
>
> I have a grammar that is used to parse our custom formula format to an
> Excel formula. So when filling an Excel worksheet the string entered is
> something like '$C{D,.,.,.+1}' which means 'one cell right from the current
> cell'. You will understand that eventually we will get something like
> '$C{D,.,.,.+1} + $C{D,.,.,.+2}', so add up the value of the first cell right
> and the second cell right (in Excel when we are at A1 this results in '=B1 +
> B2'.
>
> The problem is this: In the grammar I cannot find a way to 'eat up' the
> text between two 'eca_kolom_expressie' strings (the '$C{...}' part).
>
> I already tried 'EXCEL_FRAGMENT' in a hundred ways, but none of them seemed
> to work. ('TILDE (options {greedy=false;} : .) TILDE' seems to work, but
> when removing the TILDEs it stops working)
>
> I have included the grammar. Can you point me in the right direction?
>
> Regards,
>
> Patrick Hofman
> Senior Consultant
> Invantive B.V.
>
>
> 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