diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-02-19 19:40:09 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-02-19 19:40:09 +0000 |
commit | 4b39aa3a7cc51d130016ed8d5e443b436d3ae92d (patch) | |
tree | 0fc8748c9b9f8d2e9112fd6f1806ef4879df60b5 /src/bin/psql/command.h | |
parent | 737f1cd44b674be9148820736b671b279f642c14 (diff) | |
download | postgresql-4b39aa3a7cc51d130016ed8d5e443b436d3ae92d.tar.gz postgresql-4b39aa3a7cc51d130016ed8d5e443b436d3ae92d.zip |
Re-implement psql's input scanning to use a flex-generated lexer, as per
recent discussion. The lexer is used for both SQL command text and
backslash commands. The purpose of this change is to make it easier to
track the behavior of the backend's SQL lexer --- essentially identical
flex rules are now used by psql. Also, this cleans up a lot of very
squirrelly code in mainloop.c and command.c. The flex code is somewhat
bulkier than the removed code, but should be lots easier to maintain.
Diffstat (limited to 'src/bin/psql/command.h')
-rw-r--r-- | src/bin/psql/command.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/bin/psql/command.h b/src/bin/psql/command.h index dca0de82863..62a66ade3f8 100644 --- a/src/bin/psql/command.h +++ b/src/bin/psql/command.h @@ -3,15 +3,14 @@ * * Copyright (c) 2000-2003, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/command.h,v 1.18 2003/11/29 19:52:06 pgsql Exp $ + * $PostgreSQL: pgsql/src/bin/psql/command.h,v 1.19 2004/02/19 19:40:09 tgl Exp $ */ #ifndef COMMAND_H #define COMMAND_H -#include "pqexpbuffer.h" - #include "settings.h" #include "print.h" +#include "psqlscan.h" typedef enum _backslashResult @@ -26,10 +25,8 @@ typedef enum _backslashResult } backslashResult; -extern backslashResult HandleSlashCmds(const char *line, - PQExpBuffer query_buf, - const char **end_of_cmd, - volatile int *paren_level); +extern backslashResult HandleSlashCmds(PsqlScanState scan_state, + PQExpBuffer query_buf); extern int process_file(char *filename); |