[antlr-interest] Problem with '.' character
Jim Idle
jimi at temporal-wave.com
Wed Jan 23 08:23:51 PST 2008
However, don’t use any kind of backtracking solution unless the parser
is quick and dirty.
Jim
From: Bertalan Fodor (LilyPondTool) [mailto:lilypondtool at organum.hu]
Sent: Wednesday, January 23, 2008 8:03 AM
To: Daniels, Troy \(US SSA\)
Cc: antlr-interest at antlr.org
Subject: Re: [antlr-interest] Problem with '.' character
Isn't it possible to write this:
var1=var2.var3=myTable.myField
With ANTLR 3, in this case I think LL(*) with backtracking should find
its way, because the '=' sign will guide it.
Bert
Daniels, Troy (US SSA) wrote:
Why is var2.var3 not a field expression? Is it because they are on
different lines? If so, you need to exclude newlines from your ignored
whitespace, and write the line-based rules as something like:
assignment: expr EQ expr NL;
rather than what I assume your current rule is:
assignment: expr EQ expr;
where NL matches whatever is allowed for newlines.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080123/f2af2fdc/attachment-0001.html
More information about the antlr-interest
mailing list