help-flex
[Top][All Lists]
Advanced

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

About YY_INPUT


From: Jesus M. Diaz Hernandez
Subject: About YY_INPUT
Date: Tue, 13 Nov 2001 18:07:30 -0500 (EST)

Hi, i want flex gets its input from a strstream, but the problem is that i
think he is not sending the appropiate chars to bison, my YY_INPUT looks
like this:

#undef YY_INPUT
#define YY_INPUT(buf,result,max_size) { \
        char* aux =  rootClass->getStrLine() \
        strcpy(buf,aux); \
        result = strlen(aux);\
}

where rootClass is and instance of SourceBuffer -a class that contains
the strstream strCode, wich contains the source code i want to parse-, and
getStrLine is:
 
char* SourceBuffer::getStrLine()
{
  char buf[100];
   
  return (srcCode.getline(buf,100)) ? strdup(buf) : NULL;
   
}

so when the parser goes he runs into errors, but if i read the code from
stdin -without modifing YY_INPUT-, there were no problems, so i assume
 that something is messed on the treatment of the stream.

Anybody can help me?

Sorry about not to simplify more the example, but i think is not so
complex. Did he?

BTW: Great list!

-- 
 Jesus Miguel Diaz Hdez
 __________________________________

 Grupo de Redes
 Facultad de Matematica y Cibernetica
 Universidad de la Habana, Cuba

e-mail:
   address@hidden





reply via email to

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