A issue to LEX/YACC error report

A issue to LEX/YACC error report

Post by Geoff Li » Sat, 28 Jun 2003 20:29:54



Hi:

I tried to print the whole line when there is a grammar error.

I written the following in the LEX

\n   {
    /* Save the next line */
    strcpy(reslinebuf, yytext+1);
    return(NEWLINE);
   }

Then I want to print the contents of reslinebuf with other information in
yyerror in the YACC.  Is there have a way to do it other than making reslinebuf
a global variable?

I'am looking for a straight and easy way in the LEX  to return this value to the
YACC.

Thank you very much

Geoff Liu

--
---------------------------------
IOTA, GDC, Lucent Qingdao(QD)
Tel: (Office)+86-532-8702000x5366

http://gdcsr60.gdc.lucent.com/qdr&d/tm_pe_tools/iota/