Update tokens.g and regenerate tokens.c with it.
This commit is contained in:
parent
498d867bc3
commit
71df09d022
@ -15,9 +15,6 @@
|
|||||||
#define LL_assert(x) /* nothing */
|
#define LL_assert(x) /* nothing */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
extern int LLsymb;
|
extern int LLsymb;
|
||||||
|
|
||||||
#define LL_SAFE(x) /* Nothing */
|
#define LL_SAFE(x) /* Nothing */
|
||||||
@ -80,6 +77,9 @@ extern LLnc_recover();
|
|||||||
|
|
||||||
# line 20 "tokens.g"
|
# line 20 "tokens.g"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
# include "types.h"
|
# include "types.h"
|
||||||
# include "io.h"
|
# include "io.h"
|
||||||
# include "extern.h"
|
# include "extern.h"
|
||||||
@ -88,9 +88,8 @@ extern LLnc_recover();
|
|||||||
|
|
||||||
#include "LLgen.h"
|
#include "LLgen.h"
|
||||||
|
|
||||||
/* Here are defined : */
|
|
||||||
static int nparams;
|
static int nparams;
|
||||||
# line 75 "tokens.g"
|
# line 63 "tokens.g"
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -373,7 +372,7 @@ int input() {
|
|||||||
/*
|
/*
|
||||||
* Low level input routine, used by all other input routines
|
* Low level input routine, used by all other input routines
|
||||||
*/
|
*/
|
||||||
register c;
|
int c;
|
||||||
|
|
||||||
if ((c = backupc)) {
|
if ((c = backupc)) {
|
||||||
/* Last char was "unput()". Deliver it again
|
/* Last char was "unput()". Deliver it again
|
||||||
@ -400,14 +399,14 @@ int input() {
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
void unput(int c) {
|
void unput(c) {
|
||||||
/*
|
/*
|
||||||
* "unread" c
|
* "unread" c
|
||||||
*/
|
*/
|
||||||
backupc = c;
|
backupc = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
void skipcomment(int flag) {
|
void skipcomment(flag) {
|
||||||
/*
|
/*
|
||||||
* Skip comment. If flag != 0, the comment is inside a fragment
|
* Skip comment. If flag != 0, the comment is inside a fragment
|
||||||
* of C-code, so keep it.
|
* of C-code, so keep it.
|
||||||
@ -479,7 +478,7 @@ STATIC void linedirective() {
|
|||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
STATIC string vallookup(int s) {
|
STATIC string vallookup(s) {
|
||||||
/*
|
/*
|
||||||
* Look up the keyword that has token number s
|
* Look up the keyword that has token number s
|
||||||
*/
|
*/
|
||||||
@ -492,7 +491,7 @@ STATIC string vallookup(int s) {
|
|||||||
return 0;
|
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.
|
* 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
|
* inserted = 0 if the token s was deleted (in which case we have
|
||||||
|
|||||||
@ -18,12 +18,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
{
|
{
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
# include "types.h"
|
# include "types.h"
|
||||||
# include "io.h"
|
# include "io.h"
|
||||||
# include "extern.h"
|
# include "extern.h"
|
||||||
# include "assert.h"
|
# include "assert.h"
|
||||||
# include "cclass.h"
|
# include "cclass.h"
|
||||||
|
|
||||||
|
#include "LLgen.h"
|
||||||
|
|
||||||
static int nparams;
|
static int nparams;
|
||||||
}
|
}
|
||||||
/* Classes */
|
/* Classes */
|
||||||
@ -138,7 +143,7 @@ STATIC void copyact(char ch1, char ch2, int flag, int level) {
|
|||||||
case ')':
|
case ')':
|
||||||
case '}':
|
case '}':
|
||||||
case ']':
|
case ']':
|
||||||
error(linecount,"Parentheses mismatch");
|
error(linecount,"Parentheses mismatch", NULL, NULL);
|
||||||
break;
|
break;
|
||||||
case '(':
|
case '(':
|
||||||
text_seen = 1;
|
text_seen = 1;
|
||||||
@ -169,7 +174,7 @@ STATIC void copyact(char ch1, char ch2, int flag, int level) {
|
|||||||
text_seen = 0;
|
text_seen = 0;
|
||||||
nparams++;
|
nparams++;
|
||||||
if (ch == ',' && (flag & 2)) {
|
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 = ';';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -190,7 +195,7 @@ STATIC void copyact(char ch1, char ch2, int flag, int level) {
|
|||||||
ch = input();
|
ch = input();
|
||||||
}
|
}
|
||||||
if (ch == '\n') {
|
if (ch == '\n') {
|
||||||
error(linecount,"Newline in string");
|
error(linecount,"Newline in string", NULL, NULL);
|
||||||
unput(match);
|
unput(match);
|
||||||
}
|
}
|
||||||
putc(ch,f);
|
putc(ch,f);
|
||||||
@ -198,7 +203,7 @@ STATIC void copyact(char ch1, char ch2, int flag, int level) {
|
|||||||
if (ch == match) break;
|
if (ch == match) break;
|
||||||
/* Fall through */
|
/* Fall through */
|
||||||
case EOF :
|
case EOF :
|
||||||
if (!level) error(saved,"Action does not terminate");
|
if (!level) error(saved,"Action does not terminate", NULL, NULL);
|
||||||
strip_grammar = sav_strip;
|
strip_grammar = sav_strip;
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
@ -258,7 +263,7 @@ int scanner() {
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
ch = input();
|
ch = input();
|
||||||
if (ch == '\n' || ch == EOF) {
|
if (ch == '\n' || ch == EOF) {
|
||||||
error(linecount,"Missing '");
|
error(linecount,"Missing '", NULL, NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (ch == '\'') break;
|
if (ch == '\'') break;
|
||||||
@ -322,7 +327,7 @@ int scanner() {
|
|||||||
}
|
}
|
||||||
w++;
|
w++;
|
||||||
}
|
}
|
||||||
error(linecount,"Illegal reserved word");
|
error(linecount,"Illegal reserved word", NULL, NULL);
|
||||||
}
|
}
|
||||||
lextoken.t_string = ltext;
|
lextoken.t_string = ltext;
|
||||||
return C_IDENT;
|
return C_IDENT;
|
||||||
@ -339,7 +344,7 @@ int input() {
|
|||||||
*/
|
*/
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
if (c = backupc) {
|
if ((c = backupc)) {
|
||||||
/* Last char was "unput()". Deliver it again
|
/* Last char was "unput()". Deliver it again
|
||||||
*/
|
*/
|
||||||
backupc = 0;
|
backupc = 0;
|
||||||
@ -380,7 +385,7 @@ void skipcomment(flag) {
|
|||||||
int saved; /* line count on which comment starts */
|
int saved; /* line count on which comment starts */
|
||||||
|
|
||||||
saved = linecount;
|
saved = linecount;
|
||||||
if (input() != '*') error(linecount,"Illegal comment");
|
if (input() != '*') error(linecount,"Illegal comment", NULL, NULL);
|
||||||
if (flag) putc('*', fact);
|
if (flag) putc('*', fact);
|
||||||
do {
|
do {
|
||||||
ch = input();
|
ch = input();
|
||||||
@ -391,7 +396,7 @@ void skipcomment(flag) {
|
|||||||
if (ch == '/') return;
|
if (ch == '/') return;
|
||||||
}
|
}
|
||||||
} while (ch != EOF);
|
} while (ch != EOF);
|
||||||
error(saved,"Comment does not terminate");
|
error(saved,"Comment does not terminate", NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifdef LINE_DIRECTIVE
|
# ifdef LINE_DIRECTIVE
|
||||||
@ -412,7 +417,7 @@ STATIC void linedirective() {
|
|||||||
ch = input();
|
ch = input();
|
||||||
} while (ch != '\n' && c_class[ch] != ISDIG);
|
} while (ch != '\n' && c_class[ch] != ISDIG);
|
||||||
if (ch == '\n') {
|
if (ch == '\n') {
|
||||||
error(linecount,s_error);
|
error(linecount,s_error, NULL, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
i = 0;
|
i = 0;
|
||||||
@ -427,7 +432,7 @@ STATIC void linedirective() {
|
|||||||
*c++ = ch = input();
|
*c++ = ch = input();
|
||||||
} while (ch != '"' && ch != '\n');
|
} while (ch != '"' && ch != '\n');
|
||||||
if (ch == '\n') {
|
if (ch == '\n') {
|
||||||
error(linecount,s_error);
|
error(linecount,s_error, NULL, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
*--c = '\0';
|
*--c = '\0';
|
||||||
@ -568,7 +573,7 @@ void LLmessage(int d) {
|
|||||||
#ifdef LLNONCORR
|
#ifdef LLNONCORR
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
error(linecount, "%s", buf);
|
error(linecount, "%s", buf, NULL);
|
||||||
/* Don't change this line to
|
/* Don't change this line to
|
||||||
* error(linecount, buf).
|
* error(linecount, buf).
|
||||||
* The string in "buf" might contain '%' ...
|
* The string in "buf" might contain '%' ...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user