And now the grammar

From: Patrick Hofman
Sent: donderdag 26 mei 2011 15:35
To: [email protected]
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

Attachment: eca_column_expressions.g
Description: eca_column_expressions.g

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to