Re: semantic predicate hoisting
- View SourceDear Tom,
> > Even though I was very unhappy about the missing predicate hoistingOf course, this is obvious! But have you never had the problem of
> > feature first, meanwhile I think I wouldn't use this feature even if it
> > were available. The reason: Syntactic predicates should be as short as
> > possible in order to reduce the amount of guessing of rules.
> Of course syntax predicates should be as short as possible.
> Why look ahead 10 tokens if you can make a decision with 5
> tokens ?
finding out what the shortest correct syntactic predicate is? I have
written a parser for SDL-2000 comprising more than 450 rules and more
than 100 syntatic predicates (most of them are unevitable, some others
had to be introduced in order to keep the original rules as published in
the SDL standard). I can tell you that it was a non-trivial task to find
the right predicates in all ambiguous alternatives!!!
>From this point on we are discussing only semantic predicates.Ah, that's the problem. I continued discussion of syntactic predicates.
I thought that predicate hoisting can also be applied for syntactic
> Furthermore, hoisting does not "move" the predicate to an earlierI fully agree. There must have been a misunderstanding.
> point in the parse. Whether hoisted or not hoisted the semantic
> predicate is evaluated at the same token position. However
> with hoisting the predicate is evaluated in a higher level rule.
Nevertheless, if predicate hoisting also applies for syntactic
predicates, it may be possible that a predicate is hoisted several
times. In this case the predicate must be such general that it correctly
disambiguates in all places, potentially resulting in some inefficiency.
Michael Schmitt phone: +49 451 500 3725
Institute for Telematics secretary: +49 451 500 3721
Medical University of Luebeck fax: +49 451 500 3722
Ratzeburger Allee 160 eMail: schmitt@...-luebeck.de
D-23538 Luebeck, Germany WWW: http://www.itm.mu-luebeck.de