Re: Predicates

Sylvain Schmitz <schmitz@i3s.unice.fr>
6 Oct 2005 15:02:20 -0400

          From comp.compilers

Related articles
Re: Parsing Expression Grammar cfc@world.std.com (Chris F Clark) (2005-09-25)
Predicates (was: Parsing Expression Grammar) quinn-j@shaw.ca (Quinn Tyler Jackson) (2005-10-02)
Re: Predicates schmitz@i3s.unice.fr (Sylvain Schmitz) (2005-10-04)
Re: Predicates cfc@shell01.TheWorld.com (Chris F Clark) (2005-10-05)
Re: Predicates schmitz@i3s.unice.fr (Sylvain Schmitz) (2005-10-06)
| List of all articles for this month |
From: Sylvain Schmitz <schmitz@i3s.unice.fr>
Newsgroups: comp.compilers
Date: 6 Oct 2005 15:02:20 -0400
Organization: Compilers Central
References: 05-09-124 05-10-019 05-10-036 05-10-039
Keywords: parse
Posted-Date: 06 Oct 2005 15:02:20 EDT

Chris F Clark wrote:
> Sylvain Schmitz wrote:
>>they are highly convenient and utterly dangerous, allowing more or
>>less arbitrary code to be run during the parsing phase, possibly
> ^^^^^^^^^
>>unrelated to the language at hand and possibly introducing an
>>exponential overhead.
>
> I'm not sure what you mean by the underlined word.


The choice of word was poor indeed. I meant "arbitrary recognition
code", such as regular expressions, and thus syntactic predicates by this.


We seem to agree; I'll just throw a few more lines in favor of boolean
grammars instead of syntactic predicates. I feel the difference is
indeed in the formal way boolean grammars are treated, which means that
the boolean operations have very clear consequences on the generated
language. We can thus expect them to be used by the language designer,
for instance to express a non CF but still syntactic requirement, like
naming scopes.
      Syntactic predicates on the other hand are tools of the language
implementor, not of the language designer. They are used to solve an
implementation problem. The language implementor might then recognize a
slightly different language than the intended one when he interferes
with the parser by adding syntactic predicates.


--
Regards,


      Sylvain


Post a followup to this message

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