git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2633
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2003-05-19 Bernhard Held <bernhard@bernhardheld.de>
+
+ Applied patch from bug 737905 (renamed yylineo to mylineno):
+ * src/altlex.c
+ * src/SDCCast.c
+ * src/SDCglobl.h
+ * src/SDCC.lex
+ * src/SDCCsymt.c
+ * src/SDCCval.c
+
2003-05-19 Scott Dattalo <scott@dattalo.com>
* src/pic16/pcode.c: Cleaned warnings
2003-05-19 Scott Dattalo <scott@dattalo.com>
* src/pic16/pcode.c: Cleaned warnings
what you give them. Help stamp out software-hoarding!
-------------------------------------------------------------------------*/
what you give them. Help stamp out software-hoarding!
-------------------------------------------------------------------------*/
D [0-9]
L [a-zA-Z_]
H [a-fA-F0-9]
D [0-9]
L [a-zA-Z_]
H [a-fA-F0-9]
extern int lineno, column;
extern char *filename ;
extern int lineno, column;
extern char *filename ;
void count() ;
int process_pragma(char *);
#undef yywrap
void count() ;
int process_pragma(char *);
#undef yywrap
+#ifndef YYPROTO
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+#endif
+
int yywrap YY_PROTO((void))
{
return(1);
}
int yywrap YY_PROTO((void))
{
return(1);
}
+
+static void yyunput (int, char *);
+
+static void my_unput(char c)
+{
+ yyunput(c, (yytext_ptr));
+}
+
#define TKEYWORD(token) return (isTargetKeyword(yytext) ? token :\
check_type(yytext))
char *asmbuff=NULL;
#define TKEYWORD(token) return (isTargetKeyword(yytext) ? token :\
check_type(yytext))
char *asmbuff=NULL;
struct optimize save_optimize ;
struct options save_options ;
%}
struct optimize save_optimize ;
struct options save_options ;
%}
if (ch!='\n') {
// that could have been removed by the preprocessor anyway
werror (W_STRAY_BACKSLASH, column);
if (ch!='\n') {
// that could have been removed by the preprocessor anyway
werror (W_STRAY_BACKSLASH, column);
/* set the current line number to */
/* line number if printFlag is on */
if (!*s) {
/* set the current line number to */
/* line number if printFlag is on */
if (!*s) {
- lineno = yylineno = lNum ;
+ lineno = mylineno = lNum ;
/* in c1mode fullSrcFileName is NULL */
if ( fullSrcFileName &&
strncmp(s,fullSrcFileName,strlen(fullSrcFileName)) == 0) {
/* in c1mode fullSrcFileName is NULL */
if ( fullSrcFileName &&
strncmp(s,fullSrcFileName,strlen(fullSrcFileName)) == 0) {
- lineno = yylineno = lNum;
+ lineno = mylineno = lNum;
currFname = fullSrcFileName ;
} else {
char *sb = s;
currFname = fullSrcFileName ;
} else {
char *sb = s;
while (*s != '"') s++;
*s = '\0';
currFname = strdup (sb);
while (*s != '"') s++;
*s = '\0';
currFname = strdup (sb);
- lineno = yylineno = lNum;
+ lineno = mylineno = lNum;
}
filename = currFname ;
return 0;
}
filename = currFname ;
return 0;
for (i = 0; yytext[i] != '\0'; i++) {
if (yytext[i] == '\n') {
column = 0;
for (i = 0; yytext[i] != '\0'; i++) {
if (yytext[i] == '\n') {
column = 0;
}
else
if (yytext[i] == '\t')
}
else
if (yytext[i] == '\t')
ch = input();
if (ch == '\n') {
/* \<newline> is a continuator */
ch = input();
if (ch == '\n') {
/* \<newline> is a continuator */
/* if new line we have a new line break, which is illegal */
werror(W_NEWLINE_IN_STRING);
dbuf_append(&dbuf, "\n", 1);
/* if new line we have a new line break, which is illegal */
werror(W_NEWLINE_IN_STRING);
dbuf_append(&dbuf, "\n", 1);
case '\\':
if ((ch = input()) != '\n') {
werror(W_STRAY_BACKSLASH, column);
case '\\':
if ((ch = input()) != '\n') {
werror(W_STRAY_BACKSLASH, column);
column = 0;
}
break;
case '\n':
column = 0;
}
break;
case '\n':
goto out;
if (ch != '\"') {
goto out;
if (ch != '\"') {
- if (yylineno && filename) {
+ if (mylineno && filename) {
fprintf(stdout,"\n%s:%d: %s: token -> '%s' ; column %d\n",
fprintf(stdout,"\n%s:%d: %s: token -> '%s' ; column %d\n",
s,yytext,column);
fatalError++;
} else {
s,yytext,column);
fatalError++;
} else {
ex = Safe_alloc ( sizeof (ast));
ex->type = type;
ex = Safe_alloc ( sizeof (ast));
ex->type = type;
- ex->lineno = (noLineno ? oldLineno : yylineno);
+ ex->lineno = (noLineno ? oldLineno : mylineno);
ex->filename = currFname;
ex->level = NestLevel;
ex->block = currBlockno;
ex->filename = currFname;
ex->level = NestLevel;
ex->block = currBlockno;
addSymChain (name);
allocVariables (name);
}
addSymChain (name);
allocVariables (name);
}
- name->lastLine = yylineno;
+ name->lastLine = mylineno;
currFunc = name;
/* set the stack pointer */
currFunc = name;
/* set the stack pointer */
extern char *moduleName; /* module name is source file without path and extension */
/* can be NULL while linking without compiling */
extern int currLineno; /* current line number */
extern char *moduleName; /* module name is source file without path and extension */
/* can be NULL while linking without compiling */
extern int currLineno; /* current line number */
-extern int yylineno; /* line number of the current file SDCC.lex */
+extern int mylineno; /* line number of the current file SDCC.lex */
extern FILE *yyin; /* */
extern FILE *asmFile; /* assembly output file */
extern FILE *cdbFile; /* debugger symbol file */
extern FILE *yyin; /* */
extern FILE *asmFile; /* assembly output file */
extern FILE *cdbFile; /* debugger symbol file */
strncpyz (sym->name, name, sizeof(sym->name)); /* copy the name */
sym->level = scope; /* set the level */
sym->block = currBlockno;
strncpyz (sym->name, name, sizeof(sym->name)); /* copy the name */
sym->level = scope; /* set the level */
sym->block = currBlockno;
- sym->lineDef = yylineno; /* set the line number */
+ sym->lineDef = mylineno; /* set the line number */
nilist = Safe_alloc (sizeof (initList));
nilist->type = type;
nilist = Safe_alloc (sizeof (initList));
nilist->type = type;
- nilist->lineno = yylineno;
+ nilist->lineno = mylineno;
char *currFname;
char *yytext;
char *currFname;
char *yytext;
if (line[0] == '\0')
error ("Error in number in #line");
/* This is weird but cpp seems to add an extra three to the line no */
if (line[0] == '\0')
error ("Error in number in #line");
/* This is weird but cpp seems to add an extra three to the line no */
- yylineno = atoi (line) - 3;
- lineno = yylineno;
+ mylineno = atoi (line) - 3;
+ lineno = mylineno;
/* Fetch the filename if there is one */
while (c == '\t' || c == ' ')
c = GETC ();
/* Fetch the filename if there is one */
while (c == '\t' || c == ' ')
c = GETC ();
check_newline (void)
{
int c;
check_newline (void)
{
int c;
- yylineno++;
- lineno = yylineno;
+ mylineno++;
+ lineno = mylineno;
/* Skip any leading white space */
c = GETC ();
/* Skip any leading white space */
c = GETC ();