21 |
#ifndef SKELETON_H_ |
#ifndef SKELETON_H_ |
22 |
# define SKELETON_H_ |
# define SKELETON_H_ |
23 |
|
|
24 |
/* From parse-skel.y. */ |
# include "parse-skel.h" |
25 |
|
|
26 |
|
/* Initialize LOC. */ |
27 |
|
# define LOCATION_RESET(Loc) \ |
28 |
|
(Loc).first_column = (Loc).first_line = 1; \ |
29 |
|
(Loc).last_column = (Loc).last_line = 1; |
30 |
|
|
31 |
|
/* Advance of NUM lines. */ |
32 |
|
# define LOCATION_LINES(Loc, Num) \ |
33 |
|
(Loc).last_column = 1; \ |
34 |
|
(Loc).last_line += Num; |
35 |
|
|
36 |
|
/* Restart: move the first cursor to the last position. */ |
37 |
|
# define LOCATION_STEP(Loc) \ |
38 |
|
(Loc).first_column = (Loc).last_column; \ |
39 |
|
(Loc).first_line = (Loc).last_line; |
40 |
|
|
41 |
|
/* Output LOC on the stream OUT. */ |
42 |
|
# define LOCATION_PRINT(Out, Loc) \ |
43 |
|
if ((Loc).first_line != (Loc).last_line) \ |
44 |
|
fprintf (Out, "%d.%d-%d.%d", \ |
45 |
|
(Loc).first_line, (Loc).first_column, \ |
46 |
|
(Loc).last_line, (Loc).last_column - 1); \ |
47 |
|
else if ((Loc).first_column < (Loc).last_column - 1) \ |
48 |
|
fprintf (Out, "%d.%d-%d", (Loc).first_line, \ |
49 |
|
(Loc).first_column, (Loc).last_column - 1); \ |
50 |
|
else \ |
51 |
|
fprintf (Out, "%d.%d", (Loc).first_line, (Loc).first_column) |
52 |
|
|
53 |
|
|
54 |
|
/* Pure parsers need to pass arguments to yyparse. */ |
55 |
|
typedef struct skel_control_s |
56 |
|
{ |
57 |
|
/* For the time being, nothing. */ |
58 |
|
} skel_control_t; |
59 |
|
|
60 |
|
/* From parse-skel.y. */ |
61 |
|
extern int skel_debug; |
62 |
|
void skel_error PARAMS ((skel_control_t *control, |
63 |
|
const yyltype *loc, const char *msg)); |
64 |
void process_skeleton PARAMS ((const char* skel)); |
void process_skeleton PARAMS ((const char* skel)); |
65 |
|
|
66 |
/* From scan-skel.l. */ |
/* From scan-skel.l. */ |
67 |
|
extern int skel__flex_debug; |
68 |
|
|
69 |
|
/* Renamed yyin. */ |
70 |
|
extern FILE* skel_in; |
71 |
|
|
72 |
# define YY_DECL \ |
# define YY_DECL \ |
73 |
int yylex PARAMS ((void)) |
int skel_lex PARAMS ((yystype *yylval, yyltype *yylloc)) |
74 |
YY_DECL; |
YY_DECL; |
75 |
|
|
76 |
#endif SKELETON_H_ |
#endif SKELETON_H_ |