help-bison
[Top][All Lists]
Advanced

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

Re: Problem in Input from buffer and File


From: Hans Aberg
Subject: Re: Problem in Input from buffer and File
Date: Sat, 12 Jul 2003 13:00:00 +0200

The question on how to switch Flex lexer input is a question for:
  Help-flex mailing list
  address@hidden
  http://mail.gnu.org/mailman/listinfo/help-flex

If your grammar need mild changes depending whether you read from a file or
buffer, you might combine the grammars and set a context variable
(file/buffer) that triggers YYERROR where appropriate in the .y actions.

At 02:50 -0700 2003/07/12, banda bindas wrote:
>Hi,
>   I am having problem with Flex/Bison in getting input. I am designing an
>application which will take input from File and from Buffer(at diferent
>instances). To read the buffer, I defined a class like this public:
> LexChild(){}
> void lexRestart(YY_Lexer_IFILE *input_file ){ yyrestart(input_file);}
> void lex_switch_to_buffer( ){
>  if(YY_CURRENT_BUFFER)
>  {
>   yy_delete_buffer(YY_CURRENT_BUFFER);
>  }   yy_switch_to_buffer( yy_create_buffer( NULL, YY_BUF_SIZE) );
> } }; Parser has two different functions for working in two conditions..in
>case of buffer and in case of File. Now, I am not able to parse through
>file, although the buffer part works just fine. I was able to parse the
>file before adding the buffer part.. Please help in this regard. Thanking
>you all,
>praveen
>
> Do you Yahoo!?
>
><http://pa.yahoo.com/*http://rd.yahoo.com/evt=1207/*http://promo.yahoo.com/sbc/>
>SBC Yahoo! DSL - Now only $29.95 per month!
>_______________________________________________
>address@hidden http://mail.gnu.org/mailman/listinfo/help-bison







reply via email to

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