A issue to LEX/YACC error report

From: Geoff Liu (geoffl_at_lucent.com)
Date: 06/27/03


Date: Fri, 27 Jun 2003 19:29:54 +0800

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
Email: geoffl@lucent.com
http://gdcsr60.gdc.lucent.com/qdr&d/tm_pe_tools/iota/