|[3 earlier articles]|
|Re: bison and/or antlr ? cfc@shell01.TheWorld.com (Chris F Clark) (2007-07-02)|
|Re: bison and/or antlr ? firstname.lastname@example.org (Tom Copeland) (2007-07-03)|
|Re: bison and/or antlr ? email@example.com (George Neuner) (2007-07-04)|
|Re: bison and/or antlr ? cfc@shell01.TheWorld.com (Chris F Clark) (2007-07-07)|
|Re: bison and/or antlr ? firstname.lastname@example.org (George Neuner) (2007-07-09)|
|Re: bison and/or antlr ? cfc@shell01.TheWorld.com (Chris F Clark) (2007-07-13)|
|Re: bison and/or antlr ? email@example.com (George Neuner) (2007-07-16)|
|From:||George Neuner <firstname.lastname@example.org>|
|Date:||Mon, 16 Jul 2007 21:43:16 -0400|
|References:||07-06-071 07-07-008 07-07-013 07-07-031 07-07-036 07-07-052|
|Posted-Date:||18 Jul 2007 20:02:38 EDT|
On Fri, 13 Jul 2007 11:20:29 -0400, Chris F Clark
>George Neuner <email@example.com> writes:
>> Just to be sure, you are referring to _semantic_ predicates? ...
>> I do find _syntactic_ predicates to be indispensable, ...
>No, I was actually referring to syntactic predicates. I agree that
>they are sometimes indispensable, but they also put little loop-holes
>in your grammar, where something in one context parses one way (means
>one thing) and in a different context parses (means) another.
I actually make use of syntactic predicates to deliberately restrict
reuse of subgrammars where there is a possibility of semantic
>problem is (particularly with PEG's, which are syntactic predicates on
>steroids) is that there is no check to verify that you haven't
>introduced some corner case you didn't intend to. I don't think that
>there are any PEG generators that even warn you if some rule is
>unreachable. That scares me.
It would scare me also. But I don't use PEGs and that may be why I
like syntax predicates more than you do - I find them indispensable
for CFG. I have rarely written grammars so complex that I couldn't
analyze them with moderate effort - though a DICOM parser I once wrote
pushed the limits.
>By the way, I do feel the same about the precedence and associativity
>declarations in LR parsing. They are great tools, but not for use
>with abandon. They also drop you off the cliff where your tool can't
>tell you that you have mis-specified what you want. Used with care
>that's okay. However, it is too easy to program carelessly.
Which is why I don't use declarations. Although it's more cumbersome
to code precedence hierarchies into the grammar, it's portable and it
makes the grammar easier (IMO) to analyze.
Return to the
Search the comp.compilers archives again.