1 - Changed the defintion of a local 's' into 'Sym' to avoid naming conflict.
2 - Added .integer, .Sptr and .cptr at appropiate places to uses of yylval. 3 - Removed unnecessary casts. 4 - Added a few /*NOSTRICT*/ comments to indicate awareness of lint complaints.
This commit is contained in:
parent
dbb0d46ac2
commit
ff46181ae0
1 changed files with 19 additions and 19 deletions
|
@ -224,7 +224,7 @@ char name[SIGNIFICANT+1];
|
||||||
lookup()
|
lookup()
|
||||||
{
|
{
|
||||||
Key *k;
|
Key *k;
|
||||||
Symbol *s;
|
Symbol *Sym;
|
||||||
char *c;
|
char *c;
|
||||||
int i, typech;
|
int i, typech;
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@ lookup()
|
||||||
if( isalnum( *(cptr+k->length) ) &&
|
if( isalnum( *(cptr+k->length) ) &&
|
||||||
k->token==FUNCTION) continue;
|
k->token==FUNCTION) continue;
|
||||||
cptr += k->length;
|
cptr += k->length;
|
||||||
yylval= k->classvalue;
|
yylval.integer= k->classvalue;
|
||||||
if(debug) printf("lookup:%d %d\n",
|
if(debug) printf("lookup:%d %d\n",
|
||||||
k->classvalue,k->token);
|
k->classvalue,k->token);
|
||||||
if( k->token == FUNCTION)
|
if( k->token == FUNCTION)
|
||||||
|
@ -261,17 +261,17 @@ lookup()
|
||||||
if( i<SIGNIFICANT) name[i++]= *c++;
|
if( i<SIGNIFICANT) name[i++]= *c++;
|
||||||
name[i]=0;
|
name[i]=0;
|
||||||
cptr=c;
|
cptr=c;
|
||||||
s= (Symbol *) srchsymbol(name);
|
Sym= srchsymbol(name);
|
||||||
yylval = (YYSTYPE) s;
|
yylval.Sptr = Sym;
|
||||||
typech= typechar();
|
typech= typechar();
|
||||||
if(s->symtype!=DEFAULTTYPE)
|
if(Sym->symtype!=DEFAULTTYPE)
|
||||||
{
|
{
|
||||||
if(typech && typech!=s->symtype && wflag)
|
if(typech && typech!=Sym->symtype && wflag)
|
||||||
warning("type re-declared,ignored");
|
warning("type re-declared,ignored");
|
||||||
}
|
}
|
||||||
if( typech)
|
if( typech)
|
||||||
s->symtype=typech;
|
Sym->symtype=typech;
|
||||||
if(debug) printf("lookup:%d Identifier\n",s);
|
if(debug) printf("lookup:%d Identifier\n",Sym);
|
||||||
if( (name[0]=='f' || name[0]=='F') &&
|
if( (name[0]=='f' || name[0]=='F') &&
|
||||||
(name[1]=='n' || name[1]=='N') )
|
(name[1]=='n' || name[1]=='N') )
|
||||||
return(FUNCTID);
|
return(FUNCTID);
|
||||||
|
@ -322,16 +322,17 @@ number()
|
||||||
cptr=c;
|
cptr=c;
|
||||||
if( *c != '.'){
|
if( *c != '.'){
|
||||||
if( i1> MAXINT || i1<MININT) {
|
if( i1> MAXINT || i1<MININT) {
|
||||||
dval= i1;
|
/*NOSTRICT*/ dval= i1;
|
||||||
return(FLTVALUE);
|
return(FLTVALUE);
|
||||||
}
|
}
|
||||||
ival= i1;
|
/*NOSTRICT*/ ival= i1;
|
||||||
#ifdef YYDEBUG
|
#ifdef YYDEBUG
|
||||||
if(yydebug) printf("number:INTVALUE %d",i1);
|
if(yydebug) printf("number:INTVALUE %d",i1);
|
||||||
#endif
|
#endif
|
||||||
return(INTVALUE);
|
return(INTVALUE);
|
||||||
}
|
}
|
||||||
/* handle floats */
|
/* handle floats */
|
||||||
|
/*NOSTRICT*/
|
||||||
f= i1; dec=0.1;
|
f= i1; dec=0.1;
|
||||||
c++;
|
c++;
|
||||||
while( isdigit(*c)){
|
while( isdigit(*c)){
|
||||||
|
@ -365,7 +366,7 @@ scanstring()
|
||||||
the EM file as well, because it is not used internally
|
the EM file as well, because it is not used internally
|
||||||
*/
|
*/
|
||||||
/* generate label here */
|
/* generate label here */
|
||||||
yylval= genrom();
|
yylval.integer= genrom();
|
||||||
length=0;
|
length=0;
|
||||||
if( fputc('"',emfile) == EOF) fatal("scanstring");
|
if( fputc('"',emfile) == EOF) fatal("scanstring");
|
||||||
sval= cptr;
|
sval= cptr;
|
||||||
|
@ -392,8 +393,8 @@ scanstring()
|
||||||
*cptr=0;
|
*cptr=0;
|
||||||
cptr++;
|
cptr++;
|
||||||
fprintf(emfile,"\\000\"\n");
|
fprintf(emfile,"\\000\"\n");
|
||||||
i=yylval;
|
i=yylval.integer;
|
||||||
yylval= genrom();
|
yylval.integer= genrom();
|
||||||
fprintf(emfile,"l%d,1,%d\n",i,length);
|
fprintf(emfile,"l%d,1,%d\n",i,length);
|
||||||
#ifdef YYDEBUG
|
#ifdef YYDEBUG
|
||||||
if(yydebug) printf("STRVALUE found\n");
|
if(yydebug) printf("STRVALUE found\n");
|
||||||
|
@ -447,20 +448,19 @@ yylex()
|
||||||
case '?': return(PRINTSYM);
|
case '?': return(PRINTSYM);
|
||||||
case '>':
|
case '>':
|
||||||
if( *(c+1)=='='){
|
if( *(c+1)=='='){
|
||||||
c++;c++;cptr=c; yylval= GESYM;return(RELOP);
|
c++;c++;cptr=c; yylval.integer= GESYM;return(RELOP);
|
||||||
}
|
}
|
||||||
yylval= '>';
|
yylval.integer= '>';
|
||||||
cptr++;
|
cptr++;
|
||||||
return(RELOP);
|
return(RELOP);
|
||||||
break;
|
|
||||||
case '<':
|
case '<':
|
||||||
if( *(c+1)=='='){
|
if( *(c+1)=='='){
|
||||||
c++; c++; cptr=c; yylval=LESYM; return(RELOP);
|
c++; c++; cptr=c; yylval.integer=LESYM; return(RELOP);
|
||||||
} else
|
} else
|
||||||
if( *(c+1)=='>'){
|
if( *(c+1)=='>'){
|
||||||
c++; c++; cptr=c; yylval=NESYM; return(RELOP);
|
c++; c++; cptr=c; yylval.integer=NESYM; return(RELOP);
|
||||||
}
|
}
|
||||||
yylval= '<';
|
yylval.integer= '<';
|
||||||
cptr++;
|
cptr++;
|
||||||
return(RELOP);
|
return(RELOP);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue