LL Parser problem

jdlessl@yahoo.com (Jared Lessl)
9 Aug 2004 00:31:09 -0400

          From comp.compilers

Related articles
LL Parser problem jdlessl@yahoo.com (2004-08-09)
Re: LL Parser problem jdlessl@yahoo.com (2004-08-10)
Re: LL Parser problem wyrmwif@tsoft.org (SM Ryan) (2004-08-11)
Re: LL Parser problem nick.roberts@acm.org (Nick Roberts) (2004-08-13)
Re: LL Parser problem cfc@shell01.TheWorld.com (Chris F Clark) (2004-08-15)
Re: LL Parser problem nick.roberts@acm.org (Nick Roberts) (2004-08-23)
Re: LL Parser problem rich@pennware.com (Richard Pennington) (2004-08-25)
[2 later articles]
| List of all articles for this month |
From: jdlessl@yahoo.com (Jared Lessl)
Newsgroups: comp.compilers
Date: 9 Aug 2004 00:31:09 -0400
Organization: http://groups.google.com
Keywords: parse, LL(1), question, comment
Posted-Date: 09 Aug 2004 00:31:09 EDT

I'm working on a parser (using Grammatica
http://www.nongnu.org/grammatica/) for AREV R/BASIC and have got just
about everything pinned down except for the usage of the '<'
character. In R/BASIC, it can be used both as a less-than comparison,
but also to index an array, e.g. "array<1,2>".


Obviously the array should be resolved before any comparisons (and
comparisons cannot be used as expressions within the array index), but
I find that it's doing so to the exclusion of comparisons. I.e., when
parsing "IF X < 2 THEN", it breaks, asking to know where the '>' is,
when all it has to do is work back up the tree and see that there's
another way for the '<' to be used, one that does not require a
closing '>'.


I would have thought an LL(k) parser generator would be able to handle
that sort of ombiguity. Any ideas?
[Special case the lexer to return a mutant < token after an array
name. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.