help-bison
[Top][All Lists]
Advanced

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

Re: Conditional execution rules


From: James Buchanan
Subject: Re: Conditional execution rules
Date: Tue, 7 Aug 2001 03:15:33 +1000

No, the grammar part is fairly much OK. What I really meant was how to
translate it into something useful, like how the action code emits labels or
whatever so the flow of control can go to an else-if part if the if part
evaluated false and so on.

James


----- Original Message -----
From: "Hans Aberg" <address@hidden>
To: "James Buchanan" <address@hidden>
Cc: <address@hidden>
Sent: Monday, August 06, 2001 7:25 PM
Subject: Re: Conditional execution rules


> At 02:32 +1000 2001/08/06, James Buchanan wrote:
> >I have always tried to figure out how to make a type of conditional
control
> >statement.
>
> I find it confusing to read your post, because it is not clear to me
> exactly what you want:
>
> The Bison manual section 5.2 has examples of how to do "if .. then ...
else
> ..." statements. This includes how to handle to so called "dangling else",
> which occurs if one also admits "if .. then ..." without the "else" part
> (as in C/C++).
>
> The C++ standard, which is called ISO+IEC+14882-1998 and can be bought
from
> ANSI for $18 (make sure to get the right one, as the one by ISO costs
> $250), has a grammar in it. The part containing the "if" clause looks
like:
>   selection-statement:
>     `if' ( condition ) statement
>     `if' ( condition ) statement `else' statement
>     `switch' ( condition ) statement
> (or rather, it is typeset, so I had to put in `...' by hand).
>
> I use to look into this C++ grammar in order to get ideas in constructing
> my won Bison grammars.
>
>   Hans Aberg
>
>
>




reply via email to

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