]> granicus.if.org Git - postgresql/blob - src/include/parser/gramparse.h
Move some declarations in the raw-parser header files to create a clearer
[postgresql] / src / include / parser / gramparse.h
1 /*-------------------------------------------------------------------------
2  *
3  * gramparse.h
4  *              Shared definitions for the "raw" parser (flex and bison phases only)
5  *
6  * NOTE: this file is only meant to be included in the core parsing files,
7  * ie, parser.c, gram.y, scan.l, and keywords.c.  Definitions that are needed
8  * outside the core parser should be in parser.h.
9  *
10  *
11  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
12  * Portions Copyright (c) 1994, Regents of the University of California
13  *
14  * $PostgreSQL: pgsql/src/include/parser/gramparse.h,v 1.45 2009/07/12 17:12:34 tgl Exp $
15  *
16  *-------------------------------------------------------------------------
17  */
18
19 #ifndef GRAMPARSE_H
20 #define GRAMPARSE_H
21
22 #include "nodes/parsenodes.h"
23
24 /*
25  * We track token locations in terms of byte offsets from the start of the
26  * source string, not the column number/line number representation that
27  * bison uses by default.  Also, to minimize overhead we track only one
28  * location (usually the first token location) for each construct, not
29  * the beginning and ending locations as bison does by default.  It's
30  * therefore sufficient to make YYLTYPE an int.
31  */
32 #define YYLTYPE  int
33
34 /*
35  * After defining YYLTYPE, it's safe to include gram.h.
36  */
37 #include "parser/gram.h"
38
39
40 /* from parser.c */
41 extern int      filtered_base_yylex(void);
42
43 /* from scan.l */
44 extern void scanner_init(const char *str);
45 extern void scanner_finish(void);
46 extern int      base_yylex(void);
47 extern int      scanner_errposition(int location);
48 extern void base_yyerror(const char *message);
49
50 /* from gram.y */
51 extern void parser_init(void);
52 extern int      base_yyparse(void);
53
54 #endif   /* GRAMPARSE_H */