> jdlessl@yahoo.com (Jared Lessl) wrote:> # > [Special case the lexer to return a mutant < token after an array> # > name. -John]> #> # Except that in AREV, any variable or function return value can be an> # array of this type. The only assurance I can have that a '<' is not> # an array index is if it immediately follows a literal or numerical> # value.>> If you have two different derivations>> Z -> X -> A<B>> and Z -> Y -> A<B>> where B has an unbounded expansion, then it isn't LL(k). To be LL(k) you> have to be able choose X or Y by left context + at most k symbols. In> this case you have traverse the entire expansion of B which can be more> than k symbols.

I humbly suggest, if you have the option, that you switch to using a
backtracking parser (as hinted at by your own comment). It may not be
so quick, but I suspect that's not likely to be a problem.

It seems to raise a bigger question, to my mind. Are, perhaps, all
these limited grammar parsers (parser generators) -- LL(1), LL(k),
LALR, and so on -- losing their relevance these days (at least with
regards to programming language compilers and similar tools)?
--
Nick Roberts
[Good question. C++ needs a backtracking parser, but I get the impression
that was a mistake. -John]