help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: x + (y) + z


From: Derek M Jones
Subject: Re: x + (y) + z
Date: Fri, 04 Mar 2005 12:59:34 +0000

Frank,

>> The statement (y)+z can be parsed as casting
>> +z to the type y, or as adding y to z.  A couple of
>> %dprecs solve this problem (I think the cast is the
>> common case for - and a binary expression for +).
>
>What the "common case" is doesn't really matter since a correct
>parser should be able to recognize all valid inputs, not only the
>most common ones. So if I understand right what you plan, this would
>all be just heuristics which don't really solve the problem.

Since both parses will recognise the input one has to be
selected.  Picking the common case means that there is
less work which has to be undone later in the semantics phase.


derek

--
Derek M Jones                                     tel: +44 (0) 1252 520 667
Knowledge Software Ltd                         mailto:address@hidden
Applications Standards Conformance Testing   http://www.knosof.co.uk






reply via email to

[Prev in Thread] Current Thread [Next in Thread]