Re: Multitype support in bison

2007-10-14 Thread Ilyes Gouta
Hi, Laurence: Thanks for extensive explanation! It's really great! :) So to summarize , I have two choices: 1. An extensive type checking in the actions, i.e for my case (JIT mode, native x86 instructions will be generated by the parser) emit the right arithmetic operation by testing the type of

Re: Multitype support in bison

2007-10-14 Thread Laurence Finston
On Sun, 14 Oct 2007, Laurence Finston wrote: > point p; > p := (1, 2, 3); > > When `p' is read, the rule "variable: tag suffix"' is eventually > reduced. I meant the `p' in the second line. The first line is a `declaration'. Laurence > > ___ >

Re: Multitype support in bison

2007-10-14 Thread Laurence Finston
On Sun, 14 Oct 2007, Ilyes Gouta wrote: > Well the problem is that the generic token IDENTIFIER can refer to a > variable which can hold an integer as well as a float (depending on > its type). This is the source of my worries. How can I have a separate > set of rules for ints and floats knowing t

Re: Multitype support in bison

2007-10-14 Thread Ilyes Gouta
Hi, Well the problem is that the generic token IDENTIFIER can refer to a variable which can hold an integer as well as a float (depending on its type). This is the source of my worries. How can I have a separate set of rules for ints and floats knowing that only one set would handle IDENTIFIER. It

Re: Multitype support in bison

2007-10-14 Thread Ilyes Gouta
Thank you, Laurence, for your answer! I'm going to experiment a bit with all this and I'll keep you posted. BR, Ilyes Gouta. On 10/14/07, Laurence Finston <[EMAIL PROTECTED]> wrote: > On Sat, 13 Oct 2007, Claudio Saavedra wrote: > > > > > El sáb, 13-10-2007 a las 11:06 +0200, [EMAIL PROTECTED] es

Re: Multitype support in bison

2007-10-14 Thread Laurence Finston
On Sat, 13 Oct 2007, Claudio Saavedra wrote: > > El s??b, 13-10-2007 a las 11:06 +0200, [EMAIL PROTECTED] escribi??: > > It's a typical homework assignment for people > > studying computer science. > > Hm, and maybe he is actually doing such a homework? :-) More's the pity if he were. That's

Re: Multitype support in bison

2007-10-14 Thread Hans Aberg
On 13 Oct 2007, at 01:10, Ilyes Gouta wrote: I'm new to Bison. I'm writing an interpreter for a lightweight C-like language using flex and bison. My language has to support the *two* types *int* and *float* used by the identifiers. You might look into the "Grammar Summary" of C++/C. Standards