#define LL_assert(x) /* nothing */
#endif
-#include <stdio.h>
-#include <string.h>
-
extern int LLsymb;
#define LL_SAFE(x) /* Nothing */
# line 20 "tokens.g"
+#include <stdio.h>
+#include <string.h>
+
# include "types.h"
# include "io.h"
# include "extern.h"
#include "LLgen.h"
-/* Here are defined : */
static int nparams;
-# line 75 "tokens.g"
+# line 63 "tokens.g"
/*
/*
* Low level input routine, used by all other input routines
*/
- register c;
+ int c;
if ((c = backupc)) {
/* Last char was "unput()". Deliver it again
return c;
}
-void unput(int c) {
+void unput(c) {
/*
* "unread" c
*/
backupc = c;
}
-void skipcomment(int flag) {
+void skipcomment(flag) {
/*
* Skip comment. If flag != 0, the comment is inside a fragment
* of C-code, so keep it.
ch = input();
} while (ch != '\n' && c_class[ch] != ISDIG);
if (ch == '\n') {
- error(linecount, s_error, NULL, NULL);
+ error(linecount,s_error, NULL, NULL);
return;
}
i = 0;
*c++ = ch = input();
} while (ch != '"' && ch != '\n');
if (ch == '\n') {
- error(linecount, s_error, NULL, NULL);
+ error(linecount,s_error, NULL, NULL);
return;
}
*--c = '\0';
}
# endif
-STATIC string vallookup(int s) {
+STATIC string vallookup(s) {
/*
* Look up the keyword that has token number s
*/
return 0;
}
-STATIC string cpy(int s, char *p, int inserted) {
+STATIC string cpy(int s,string p, int inserted) {
/*
* Create a piece of error message for token s and put it at p.
* inserted = 0 if the token s was deleted (in which case we have
*/
{
+#include <stdio.h>
+#include <string.h>
+
# include "types.h"
# include "io.h"
# include "extern.h"
# include "assert.h"
# include "cclass.h"
+#include "LLgen.h"
+
static int nparams;
}
/* Classes */
case ')':
case '}':
case ']':
- error(linecount,"Parentheses mismatch");
+ error(linecount,"Parentheses mismatch", NULL, NULL);
break;
case '(':
text_seen = 1;
text_seen = 0;
nparams++;
if (ch == ',' && (flag & 2)) {
- warning(linecount, "Parameters may not be separated with a ','");
+ warning(linecount, "Parameters may not be separated with a ','", NULL, NULL);
ch = ';';
}
}
ch = input();
}
if (ch == '\n') {
- error(linecount,"Newline in string");
+ error(linecount,"Newline in string", NULL, NULL);
unput(match);
}
putc(ch,f);
if (ch == match) break;
/* Fall through */
case EOF :
- if (!level) error(saved,"Action does not terminate");
+ if (!level) error(saved,"Action does not terminate", NULL, NULL);
strip_grammar = sav_strip;
return;
default:
for (;;) {
ch = input();
if (ch == '\n' || ch == EOF) {
- error(linecount,"Missing '");
+ error(linecount,"Missing '", NULL, NULL);
break;
}
if (ch == '\'') break;
}
w++;
}
- error(linecount,"Illegal reserved word");
+ error(linecount,"Illegal reserved word", NULL, NULL);
}
lextoken.t_string = ltext;
return C_IDENT;
*/
int c;
- if (c = backupc) {
+ if ((c = backupc)) {
/* Last char was "unput()". Deliver it again
*/
backupc = 0;
int saved; /* line count on which comment starts */
saved = linecount;
- if (input() != '*') error(linecount,"Illegal comment");
+ if (input() != '*') error(linecount,"Illegal comment", NULL, NULL);
if (flag) putc('*', fact);
do {
ch = input();
if (ch == '/') return;
}
} while (ch != EOF);
- error(saved,"Comment does not terminate");
+ error(saved,"Comment does not terminate", NULL, NULL);
}
# ifdef LINE_DIRECTIVE
ch = input();
} while (ch != '\n' && c_class[ch] != ISDIG);
if (ch == '\n') {
- error(linecount,s_error);
+ error(linecount,s_error, NULL, NULL);
return;
}
i = 0;
*c++ = ch = input();
} while (ch != '"' && ch != '\n');
if (ch == '\n') {
- error(linecount,s_error);
+ error(linecount,s_error, NULL, NULL);
return;
}
*--c = '\0';
#ifdef LLNONCORR
else
#endif
- error(linecount, "%s", buf);
+ error(linecount, "%s", buf, NULL);
/* Don't change this line to
* error(linecount, buf).
* The string in "buf" might contain '%' ...