|What is correct way to describe this in BNF for an LL(1) parser email@example.com (don) (2005-11-02)|
|Re: What is correct way to describe this in BNF for an LL(1) parser firstname.lastname@example.org (Dmitry A. Kazakov) (2005-11-04)|
|What is correct way to describe this in BNF for an LL(1) parser email@example.com (Rici Lake) (2005-11-04)|
|Re: What is correct way to describe this in BNF for an LL(1) parser firstname.lastname@example.org (don) (2005-11-08)|
|Re: What is correct way to describe this in BNF for an LL(1) parser email@example.com (2005-11-12)|
|Date:||2 Nov 2005 22:13:51 -0500|
|Posted-Date:||02 Nov 2005 22:13:50 EST|
I'm trying to write a parser for mathematical equations (yes I know
other are a lot around but - as always - I feel none meet my
requirements; and anyway its a bit of fun!). The tool I'm using uses
BNF notation and is a LL(1) parser.
I can do everything I've needed to so far except for the absolute value
function (eg | expression |). The problem is that the expression can
expand back to this definition and, as it is simply stated now, the
parser does not appear to tell the difference between closing '|' and
the start of a nested expression. If I change the trailing "|" to
something like '@' then the whole thing works OK.
Is there a 'proper' way in BNF form to express this?
I know that there are several 'tricks' that are routinely used in this
sort of thing to allow the parser to maintain its strict LL(1) status
for other constructs, but how about this one?
BTW, I also have the more standard " ABS ( expression ) " version and
that gets me by for now, but I really would like the |...| notation as
Return to the
Search the comp.compilers archives again.