Overlapping functionality: IFTI, templates, is-expressions

BCS BCS at pathlink.com
Thu Mar 20 14:10:17 PDT 2008


Russell Lewis wrote:
> BCS wrote:
> 
>>> So: can you handle arbitrary lookahead?  Or do you, like Bison, make 
>>> a one-time choice of "reduce or shift" and then you're stuck with it?
>>
>>
>> Mine is a recursive decent LL parser that works by way of "assume this 
>> is one of those and if not back-out and try again". So it is LL(*).
> 
> 
> Cool!  Though that leads me to another question: when do the actions 
> run?  Inline, while you're attempting paths that might fail, or only 
> after you know they can't fail?

In-line. That plays hell with side effects as you can't trigger on 
dropped paths for back out. Also there's a time penalty, but given that 
efficiency is so bad to begin with it's not much of an issue. If a user 
needed to have side effects then building a lambda tree might work. In 
2.0 this would be easy with the non-broken closers.

One thing I've bean thinking of is trying to build in a memoizer: "we 
tried to parse a foo at location 294 before and got this, lets use it" 
I'm not sure how or how well it will work but I've got some ideas.



More information about the Digitalmars-d mailing list