Hi All,
I am trying to redirect the standard input of flex to a character
pointer, I do not want to read a file for my input but want to
tokenize and parse a character string I have.
Also I can not want to store the character string in a file and then
read it from there.
So please can anyone tell me any mechanism to do this? I tried
changing yyin to char* but it failed miserably. or I will have to play
with machine generated code?
I am putting the problem of Flex in this list due to lack of knowledge
about Flex's mailing list and they are because normaly used in tandem
with each other!
Regards,
Atul.
On Wed, 23 Mar 2005 08:45:50 -0800 (PST), [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Send Help-bison mailing list submissions to
>help-bison@gnu.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>http://lists.gnu.org/mailman/listinfo/help-bison
> or, via email, send a message with subject or body 'help' to
>[EMAIL PROTECTED]
>
> You can reach the person managing the list at
>[EMAIL PROTECTED]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Help-bison digest..."
>
> Today's Topics:
>
> 1. Re: Grammar definition problem. (Hans Aberg)
> 2. Re: %union errors that shouldn't be there (Hans Aberg)
> 3. Update Your Account (Service)
> 4. Re: %union errors that shouldn't be there (Laurence Finston)
>
> --
>
> Message: 1
> Date: Tue, 22 Mar 2005 14:36:27 +0100
> From: Hans Aberg <[EMAIL PROTECTED]>
> Subject: Re: Grammar definition problem.
> To: Atul Kulkarni <[EMAIL PROTECTED]>
> Cc: help-bison@gnu.org
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset="us-ascii" ; format="flowed"
>
> Please continue to cc the Help-Bison list, so that more can help.
>
> Often one is using a program like Flex to generate a lexer, a program
> that tokenizes the input. Then the Bison generated parser gets token
> number to parse. This kind of setup is described, for example, in the
> book by Aho, Sethi & Ullman, "Compilers..." (the "Dragon Book").
>
> At 10:12 +0530 2005/03/22, Atul Kulkarni wrote:
> >hi,
> >Read your reply on the Bison mailing list, but failed to under stand
> >your point. Can you please explain?
> >
> >Regards,
> >Atul.
> >
> >
> >On Mon, 21 Mar 2005 19:18:28 +0100, Hans Aberg <[EMAIL PROTECTED]> wrote:
> >> In addition, note that most wold put this stuff in the lexer
> >> (generated say by Flex).
> >>
> >> At 14:55 +0530 2005/03/21, Atul Kulkarni wrote:
> >> >Hi All,
> >> >I am facing problem in defining the following grammar for Bison.
> >> >
> >> >X -> letter { letter | digit }.
> >> > here letter and digit are terminals and X is the non terminal symbol.
> >> >
> >> >I am not able to put this rule in the bison grammar form hence need
> >> >some advice on this.
> >> >
> >> >in particular I am not able to express the
> >> >
> >> >letter AND {letter OR digit } rule in the Bison grammar.
> >> >
> >> >how do I put the OR part of the rule inconsideration of the fact that
> >> >that scentence has to start with the "letter" and later have any
> >> >number of of digit?
> >> >
> >> >
> >> >Regards,
> >> >Atul.
> >> >
> >> >
> >> >___
> >> >Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
> >>
> >>
>
> --
>
> Message: 2
> Date: Tue, 22 Mar 2005 14:38:56 +0100
> From: Hans Aberg <[EMAIL PROTECTED]>
> Subject: Re: %union errors that shouldn't be there
> To: Laurence Finston <[EMAIL PROTECTED]>
> Cc: help-bison@gnu.org, DYP <[EMAIL PROTECTED]>
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset="us-ascii" ; format="flowed"
>
> At 10:39 +0100 2005/03/22, Laurence Finston wrote:
> >On Mon, 21 Mar 2005, Hans Aberg wrote:
> >
> >> They should be OK in C++, as pointers do not have non-trival
> >> con-/de-structors. The compiler needs to see a declaration of the
> >> name as a type, though, before it sees the pointer.
> >
> >If I remember correctly, it has to do with the size of the objects not
> >being known at the time the `union' declaration is compiled. I'm not
> >sure, but I think I tested this once and discovered, somewhat to my
> >surprise, that using pointers in the `union' didn't work, either. When I
> >get a chance, I'll check this carefully.
>
> With unions, the problem is, if con-/de-structors are non-trivial,
> that it is impossible to know which ones to apply and when. The union
> does not contain any type information which field is selected. If one
> adds that, unions with non-trivial con-/de-Structors would be
> possible.
> --
> Hans Aberg
>
> --
>
> Message: 3
> Date: Tue, 22 Mar 2005 14:35:12 -0800
> From: Service <[EMAIL PROTECTED]>
> Subject: Update Your Account
> To: help-bison@gnu.org
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: t