Subject: Re: A question

From: Zheng Gengbing <[email-masked]>
Date: Tue, 28 May 1996 09:15:46 +0800 (EAT)

On Mon, 27 May 1996, Guansong Zhang wrote:

> On May 27,  6:37pm, Zheng Gengbing wrote:
> > Subject: A question
> >
> > Hi,
> >
> > 	I have a prblem when I use bison to compile the yacc file .
> > The first token in hpfparser.tab.h is
> > #define FORMAT 257
> > when using yacc ,
> >
> > while
> > #define FORMAT 258   in bison ,
> >
> > how can I find out which number the first token begin ?
> >
> 
> I remember there seems a command to control on this in yacc, but I can not find
> it now. Maybe it only exist in bison extention. So I saw that someone will
> write his one *.tab.h instead of using the one generated from yacc.
> 
> But I think the default value should always been 257, why 258 in bison?
> 
> 
> > So the code should be changed from
> >
> > 		/* returnValue_m=257+i; */
> > to
> >                 returnValue_m=FORMAT+i;    /* modified by zheng.gb */
> >
> 
> I think we can use your method to deal with this problem, if it work.
> 
> But this raise another question, which I think as the problem with our lexer.
> Right now it seems there is no relation between the *.tab.h generated by yacc
> and the KEY_WORD_G[150][35] defined in keywords.h. But from your way of
> changing the code, the keywords.h should also be a generated file, other wise
> changing the first part of .y file will cause problem. Right?
>

	I don't think so. The only requirement to the KEY_WORD_G is that
they follow the sequence defined in f90.y (tokens) . And it is certainly 
that we must changing the keywords.h correspondingly when changing the 
first part of the f90.y . This is not the result of my changing above , 
it is always the case. 

> > in order to get correct result .
> >
> > and the error.file should also be adjusted .
> >
> >
> 
> I will further discuss this with HIT about this. It seems lexer need to be
> improved a lot.
> 

	In the coming version 1.56 , which is a testing version . I write
some codes in Makefile to produce the error.file automatically . Please try
it and find if there is any problem.

---

From: Zheng Gengbing <[email-masked]>
Date: Tue, 28 May 1996 10:06:46 +0800 (EAT)

Hi,

	everyone ,

	This new version 1.56 is mainly for testing the configuration .

	in this vesion ,
1.  gcc is the first choice if present , otherwise cc is also ok.

2.  bison is prefered if present , otherwise yacc is ok.

3.  since the hpfparser.tab.h is different both in the number but also the 
format of the file produced by yacc and bison , I rewrite the code to 
generate  error.file in both case in Makefile.in .

4.  lex is forced even if flex is found , since we still not solve the 
input & output problem.

5.  add in configure.in the checking of yytext , if yytext is defined as 
unsigned char yytext[] , the IS_UNSIGNED_CHAR is defined in config.h .
In order to perform the checking , I add a conftest.l in config dir .

6.  Makefile.in are adjust accordingly .

So , now please check this package in whatever machine available to you , 
and give me your comments .

***************************************************************************
*     Zheng Gengbin                 *                                     *
*                                   *                                     *
*  Dept. of Computer Science        *  Phone:  86-10-2585088              *
*         & Technology              *  Email:                             *
*                                   *      [email-masked]   *
*  Peking University P.R.China      *  Mail:                              *
*                                   *      Room 1077 ,Building 47,        *
*                                   *      Peking University, P.R.China   *
***************************************************************************