diff options
| author | Peter Eisentraut | 2002-04-20 21:56:15 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2002-04-20 21:56:15 +0000 |
| commit | 32c6c99e0b0172e13dd761f3378b328d1e6a6dab (patch) | |
| tree | 15614b13dcb3235008eadc7c52879892fe34a1cb /src/include/parser | |
| parent | ff4281472a973e8610a5f8455e14dec9ea85936d (diff) | |
Scanner performance improvements
Use flex flags -CF. Pass the to-be-scanned string around as StringInfo
type, to avoid querying the length repeatedly. Clean up some code and
remove lex-compatibility cruft. Escape backslash sequences inline. Use
flex-provided yy_scan_buffer() function to set up input, rather than using
myinput().
Diffstat (limited to 'src/include/parser')
| -rw-r--r-- | src/include/parser/gramparse.h | 7 | ||||
| -rw-r--r-- | src/include/parser/parser.h | 5 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/include/parser/gramparse.h b/src/include/parser/gramparse.h index 42ae42d9e63..3a1c9353bbf 100644 --- a/src/include/parser/gramparse.h +++ b/src/include/parser/gramparse.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: gramparse.h,v 1.20 2002/04/09 20:35:55 tgl Exp $ + * $Id: gramparse.h,v 1.21 2002/04/20 21:56:15 petere Exp $ * *------------------------------------------------------------------------- */ @@ -15,11 +15,14 @@ #ifndef GRAMPARSE_H #define GRAMPARSE_H +#include "lib/stringinfo.h" + /* from parser.c */ extern int yylex(void); /* from scan.l */ -extern void scanner_init(void); +extern void scanner_init(StringInfo str); +extern void scanner_finish(void); extern int base_yylex(void); extern void yyerror(const char *message); diff --git a/src/include/parser/parser.h b/src/include/parser/parser.h index 8547a66cc14..30d9a11fe46 100644 --- a/src/include/parser/parser.h +++ b/src/include/parser/parser.h @@ -7,15 +7,16 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: parser.h,v 1.11 2001/11/05 17:46:35 momjian Exp $ + * $Id: parser.h,v 1.12 2002/04/20 21:56:15 petere Exp $ * *------------------------------------------------------------------------- */ #ifndef PARSER_H #define PARSER_H +#include "lib/stringinfo.h" #include "parser/parse_node.h" -extern List *parser(char *str, Oid *typev, int nargs); +extern List *parser(StringInfo str, Oid *typev, int nargs); #endif /* PARSER_H */ |
