]>
git.saurik.com Git - bison.git/blob - src/skeleton.h
1 /* Parse Bison Skeletons.
2 Copyright (C) 2001 Free Software Foundation, Inc.
4 This file is part of Bison, the GNU Compiler Compiler.
6 Bison is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 Bison is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Bison; see the file COPYING. If not, write to the Free
18 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24 # include "parse-skel.h"
27 # define LOCATION_RESET(Loc) \
28 (Loc).first_column = (Loc).first_line = 1; \
29 (Loc).last_column = (Loc).last_line = 1;
31 /* Advance of NUM lines. */
32 # define LOCATION_LINES(Loc, Num) \
33 (Loc).last_column = 1; \
34 (Loc).last_line += Num;
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;
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); \
51 fprintf (Out, "%d.%d", (Loc).first_line, (Loc).first_column)
54 /* Pure parsers need to pass arguments to yyparse. */
55 typedef struct skel_control_s
57 /* For the time being, nothing. */
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
));
66 /* From scan-skel.l. */
67 extern int skel__flex_debug
;
73 int skel_lex PARAMS ((yystype *yylval, yyltype *yylloc))