Mark it as expected to fail.
Cast result of malloc; problem reported by twlevo@xs4all.nl.
* tests/actions.at, tests/calc.at, tests/glr-regression.at:
Don't start user-code symbols with "yy", to avoid name space problems.
+2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ * tests/glr-regression.at (Duplicated user destructor for lookahead):
+ Mark it as expected to fail.
+ Cast result of malloc; problem reported by twlevo@xs4all.nl.
+ * tests/actions.at, tests/calc.at, tests/glr-regression.at:
+ Don't start user-code symbols with "yy", to avoid name space problems.
+
2005-09-19 Akim Demaille <akim@epita.fr>
Remove the traits, failed experiment.
2005-09-19 Akim Demaille <akim@epita.fr>
Remove the traits, failed experiment.
;
%%
/* Alias to ARGV[1]. */
;
%%
/* Alias to ARGV[1]. */
-const char *yysource = 0;
static int
yylex (]AT_LEX_FORMALS[)
static int
yylex (]AT_LEX_FORMALS[)
AT_LOC.last_line = AT_LOC.last_column = AT_LOC.first_line + 9;
])[
AT_LOC.last_line = AT_LOC.last_column = AT_LOC.first_line + 9;
])[
- if (yysource[c])
- printf ("sending: '%c'", yysource[c]);
+ if (source[c])
+ printf ("sending: '%c'", source[c]);
else
printf ("sending: EOF");
printf (" (%d@%d-%d)\n", c, RANGE (]AT_LOC[));
else
printf ("sending: EOF");
printf (" (%d@%d-%d)\n", c, RANGE (]AT_LOC[));
int status;
yydebug = !!getenv ("YYDEBUG");
assert (argc == 2);
int status;
yydebug = !!getenv ("YYDEBUG");
assert (argc == 2);
status = yyparse ();
switch (status)
{
status = yyparse ();
switch (status)
{
const char *s
);])[
static int yylex (]AT_LEX_FORMALS[);
const char *s
);])[
static int yylex (]AT_LEX_FORMALS[);
-static int yygetc (]AT_LEX_FORMALS[);
-static void yyungetc (]AT_LEX_PRE_FORMALS[ int c);
+static int get_char (]AT_LEX_FORMALS[);
+static void unget_char (]AT_LEX_PRE_FORMALS[ int c);
%}
/* Bison Declarations */
%}
/* Bison Declarations */
]AT_LALR1_CC_IF(
[/* A C++ error reporting function. */
]AT_LALR1_CC_IF(
[/* A C++ error reporting function. */
static YYLTYPE last_yylloc;
])[
static int
static YYLTYPE last_yylloc;
])[
static int
-yygetc (]AT_LEX_FORMALS[)
+get_char (]AT_LEX_FORMALS[)
+ int res = getc (input);
]AT_USE_LEX_ARGS[;
]AT_LOCATION_IF([
last_yylloc = AT_LOC;
]AT_USE_LEX_ARGS[;
]AT_LOCATION_IF([
last_yylloc = AT_LOC;
-yyungetc (]AT_LEX_PRE_FORMALS[ int c)
+unget_char (]AT_LEX_PRE_FORMALS[ int c)
{
]AT_USE_LEX_ARGS[;
]AT_LOCATION_IF([
/* Wrong when C == `\n'. */
AT_LOC = last_yylloc;
])[
{
]AT_USE_LEX_ARGS[;
]AT_LOCATION_IF([
/* Wrong when C == `\n'. */
AT_LOC = last_yylloc;
])[
}
static int
read_signed_integer (]AT_LEX_FORMALS[)
{
}
static int
read_signed_integer (]AT_LEX_FORMALS[)
{
- int c = yygetc (]AT_LEX_ARGS[);
+ int c = get_char (]AT_LEX_ARGS[);
int sign = 1;
int n = 0;
]AT_USE_LEX_ARGS[;
if (c == '-')
{
int sign = 1;
int n = 0;
]AT_USE_LEX_ARGS[;
if (c == '-')
{
- c = yygetc (]AT_LEX_ARGS[);
+ c = get_char (]AT_LEX_ARGS[);
sign = -1;
}
while (isdigit (c))
{
n = 10 * n + (c - '0');
sign = -1;
}
while (isdigit (c))
{
n = 10 * n + (c - '0');
- c = yygetc (]AT_LEX_ARGS[);
+ c = get_char (]AT_LEX_ARGS[);
- yyungetc (]AT_LEX_PRE_ARGS[ c);
+ unget_char (]AT_LEX_PRE_ARGS[ c);
])])[
/* Skip white space. */
])])[
/* Skip white space. */
- while ((c = yygetc (]AT_LEX_ARGS[)) == ' ' || c == '\t')
+ while ((c = get_char (]AT_LEX_ARGS[)) == ' ' || c == '\t')
{
]AT_LOCATION_IF([AT_LALR1_CC_IF(
[ AT_LOC.begin = AT_LOC.end;],
{
]AT_LOCATION_IF([AT_LALR1_CC_IF(
[ AT_LOC.begin = AT_LOC.end;],
/* process numbers */
if (c == '.' || isdigit (c))
{
/* process numbers */
if (c == '.' || isdigit (c))
{
- yyungetc (]AT_LEX_PRE_ARGS[ c);
+ unget_char (]AT_LEX_PRE_ARGS[ c);
]AT_VAL[.ival = read_signed_integer (]AT_LEX_ARGS[);
return NUM;
}
]AT_VAL[.ival = read_signed_integer (]AT_LEX_ARGS[);
return NUM;
}
alarm (100);
if (argc == 2)
alarm (100);
if (argc == 2)
- yyin = fopen (argv[1], "r");
+ input = fopen (argv[1], "r");
{
perror (argv[1]);
return 3;
{
perror (argv[1]);
return 3;
%{
#define YYSTYPE char const *
%{
#define YYSTYPE char const *
- #define yyfalse 0
- #define yytrue 1
#include <ctype.h>
#include <stdio.h>
#include <ctype.h>
#include <stdio.h>
int
yylex (void)
{
char buf[50];
char *s;
int
yylex (void)
{
char buf[50];
char *s;
- switch (fscanf (yyin, " %1[a-z,]", buf)) {
+ switch (fscanf (input, " %1[a-z,]", buf)) {
case 1:
return buf[0];
case EOF:
case 1:
return buf[0];
case EOF:
- if (fscanf (yyin, "%49s", buf) != 1)
+ if (fscanf (input, "%49s", buf) != 1)
return 0;
if (sizeof buf - 1 <= strlen (buf))
abort ();
return 0;
if (sizeof buf - 1 <= strlen (buf))
abort ();
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- yyin = stdin;
- if (argc == 2 && !(yyin = fopen (argv[1], "r"))) return 3;
+ input = stdin;
+ if (argc == 2 && !(input = fopen (argv[1], "r"))) return 3;
fprintf(stderr,"error: %s\n",s);
}
fprintf(stderr,"error: %s\n",s);
}
int P[] = { P1, P2 };
int O[] = { O1, O2 };
int P[] = { P1, P2 };
int O[] = { O1, O2 };
int yylex (void)
{
char inp[3];
int yylex (void)
{
char inp[3];
- if (fscanf (yyin, "%2s", inp) == EOF)
+ if (fscanf (input, "%2s", inp) == EOF)
return 0;
switch (inp[0])
{
return 0;
switch (inp[0])
{
}
int main(int argc, char* argv[]) {
}
int main(int argc, char* argv[]) {
- yyin = stdin;
- if (argc == 2 && !(yyin = fopen (argv[1], "r"))) return 3;
+ input = stdin;
+ if (argc == 2 && !(input = fopen (argv[1], "r"))) return 3;
static int
yylex (void)
{
static int
yylex (void)
{
- yylval.count = malloc (sizeof (int));
+ yylval.count = (int *) malloc (sizeof (int));
if (!yylval.count)
{
fprintf (stderr, "Test inconclusive.\n");
if (!yylval.count)
{
fprintf (stderr, "Test inconclusive.\n");
])
AT_COMPILE([glr-regr7])
])
AT_COMPILE([glr-regr7])
-AT_CHECK([[exit 77; ./glr-regr7]], 2, [],
+AT_CHECK([[./glr-regr7]], 2, [],