38 |
#include "reader.h" |
#include "reader.h" |
39 |
#include "conflicts.h" |
#include "conflicts.h" |
40 |
|
|
41 |
|
/* Produce verbose parse errors. */ |
42 |
#define YYERROR_VERBOSE 1 |
#define YYERROR_VERBOSE 1 |
43 |
|
|
44 |
/* Pass the control structure to YYPARSE and YYLEX. */ |
/* Pass the control structure to YYPARSE and YYLEX. */ |
58 |
of the tokens. */ |
of the tokens. */ |
59 |
#define YYPRINT(File, Type, Value) \ |
#define YYPRINT(File, Type, Value) \ |
60 |
yyprint (File, &yylloc, Type, &Value) |
yyprint (File, &yylloc, Type, &Value) |
61 |
static void yyprint (FILE *file, const yyltype *loc, |
static void yyprint (FILE *file, const location_t *loc, |
62 |
int type, const yystype *value); |
int type, const yystype *value); |
63 |
|
|
64 |
symbol_class current_class = unknown_sym; |
symbol_class current_class = unknown_sym; |
133 |
directives "%%" gram epilogue.opt |
directives "%%" gram epilogue.opt |
134 |
{ |
{ |
135 |
yycontrol->errcode = 0; |
yycontrol->errcode = 0; |
136 |
epilogue_set ($5, @5.first_line); |
epilogue_set ($5, @5); |
137 |
} |
} |
138 |
; |
; |
139 |
|
|
146 |
grammar_directives |
grammar_directives |
147 |
| PROLOGUE |
| PROLOGUE |
148 |
{ |
{ |
149 |
prologue_augment ($1, @1.first_line); |
prologue_augment ($1, @1); |
150 |
} |
} |
151 |
| "%debug" { debug_flag = 1; } |
| "%debug" { debug_flag = 1; } |
152 |
| "%define" string_content string_content { muscle_insert ($2, $3); } |
| "%define" string_content string_content { muscle_insert ($2, $3); } |
349 |
|
|
350 |
static void |
static void |
351 |
yyprint (FILE *file, |
yyprint (FILE *file, |
352 |
const yyltype *loc, int type, const yystype *value) |
const location_t *loc, int type, const yystype *value) |
353 |
{ |
{ |
354 |
fputs (" (", file); |
fputs (" (", file); |
355 |
LOCATION_PRINT (file, *loc); |
LOCATION_PRINT (file, *loc); |
386 |
|
|
387 |
void |
void |
388 |
gram_error (gram_control_t *control ATTRIBUTE_UNUSED, |
gram_error (gram_control_t *control ATTRIBUTE_UNUSED, |
389 |
yyltype *yylloc, const char *msg) |
location_t *yylloc, const char *msg) |
390 |
{ |
{ |
391 |
LOCATION_PRINT (stderr, *yylloc); |
LOCATION_PRINT (stderr, *yylloc); |
392 |
fprintf (stderr, ": %s\n", msg); |
fprintf (stderr, ": %s\n", msg); |