Commit df8789bb authored by Michael Meskes's avatar Michael Meskes

Third try. Sorry, I had a wrong path in my copy statement.

parent c823b1ee
...@@ -9,6 +9,7 @@ PATCHLEVEL=0 ...@@ -9,6 +9,7 @@ PATCHLEVEL=0
override CPPFLAGS+=-I$(srcdir)/../include -DMAJOR_VERSION=$(MAJOR_VERSION) \ override CPPFLAGS+=-I$(srcdir)/../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \ -DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
-DINCLUDE_PATH=\"$(includedir)\" -DINCLUDE_PATH=\"$(includedir)\"
# -DYYDEBUG -g
OBJS=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o\ OBJS=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o\
keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o
......
...@@ -22,7 +22,11 @@ static void ...@@ -22,7 +22,11 @@ static void
usage(char *progname) usage(char *progname)
{ {
fprintf(stderr, "ecpg - the postgresql preprocessor, version: %d.%d.%d\n", MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL); fprintf(stderr, "ecpg - the postgresql preprocessor, version: %d.%d.%d\n", MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL);
fprintf(stderr, "Usage: %s: [-v] [-t] [-I include path] [ -o output file name] [-D define name] file1 [file2] ...\n", progname); fprintf(stderr, "Usage: %s: "
#ifdef YYDEBUG
"[-d]"
#endif
" [-v] [-t] [-I include path] [ -o output file name] [-D define name] file1 [file2] ...\n", progname);
} }
static void static void
...@@ -61,7 +65,7 @@ main(int argc, char *const argv[]) ...@@ -61,7 +65,7 @@ main(int argc, char *const argv[])
add_include_path("/usr/local/include"); add_include_path("/usr/local/include");
add_include_path("."); add_include_path(".");
while ((c = getopt(argc, argv, "vo:I:tD:")) != EOF) while ((c = getopt(argc, argv, "vo:I:tD:d")) != EOF)
{ {
switch (c) switch (c)
{ {
...@@ -84,6 +88,11 @@ main(int argc, char *const argv[]) ...@@ -84,6 +88,11 @@ main(int argc, char *const argv[])
case 'D': case 'D':
add_preprocessor_define(optarg); add_preprocessor_define(optarg);
break; break;
#ifdef YYDEBUG
case 'd':
yydebug=1;
break;
#endif
default: default:
usage(argv[0]); usage(argv[0]);
return ILLEGAL_OPTION; return ILLEGAL_OPTION;
......
...@@ -19,6 +19,9 @@ extern char *connection; ...@@ -19,6 +19,9 @@ extern char *connection;
extern char *input_filename; extern char *input_filename;
extern char *yytext, extern char *yytext,
errortext[128]; errortext[128];
#ifdef YYDEBUG
extern int yydebug;
#endif
extern int yylineno, extern int yylineno,
yyleng; yyleng;
extern FILE *yyin, extern FILE *yyin,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.30 2000/09/26 11:41:44 meskes Exp $ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.31 2000/11/07 08:46:27 meskes Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -191,12 +191,12 @@ static ScanKeyword ScanKeywords[] = { ...@@ -191,12 +191,12 @@ static ScanKeyword ScanKeywords[] = {
{"only", ONLY}, {"only", ONLY},
{"operator", OPERATOR}, {"operator", OPERATOR},
{"option", OPTION}, {"option", OPTION},
{"overlaps", OVERLAPS},
{"owner", OWNER},
{"or", OR}, {"or", OR},
{"order", ORDER}, {"order", ORDER},
{"out", OUT}, {"out", OUT},
{"outer", OUTER_P}, {"outer", OUTER_P},
{"overlaps", OVERLAPS},
{"owner", OWNER},
{"partial", PARTIAL}, {"partial", PARTIAL},
{"password", PASSWORD}, {"password", PASSWORD},
{"path", PATH_P}, {"path", PATH_P},
......
...@@ -375,6 +375,8 @@ make_name(void) ...@@ -375,6 +375,8 @@ make_name(void)
%type <index> opt_array_bounds opt_type_array_bounds %type <index> opt_array_bounds opt_type_array_bounds
%type <ival> Iresult %type <ival> Iresult
%token YYERROR_VERBOSE
%% %%
prog: statements; prog: statements;
...@@ -5272,6 +5274,7 @@ c_anything: IDENT { $$ = $1; } ...@@ -5272,6 +5274,7 @@ c_anything: IDENT { $$ = $1; }
| S_LSHIFT { $$ = make_str("<<"); } | S_LSHIFT { $$ = make_str("<<"); }
| S_MEMBER { $$ = make_str("->"); } | S_MEMBER { $$ = make_str("->"); }
| S_MEMPOINT { $$ = make_str("->*"); } | S_MEMPOINT { $$ = make_str("->*"); }
| S_MOD { $$ = make_str("%="); }
| S_MUL { $$ = make_str("*="); } | S_MUL { $$ = make_str("*="); }
| S_NEQUAL { $$ = make_str("!="); } | S_NEQUAL { $$ = make_str("!="); }
| S_OR { $$ = make_str("||"); } | S_OR { $$ = make_str("||"); }
...@@ -5311,7 +5314,9 @@ blockend : '}' ...@@ -5311,7 +5314,9 @@ blockend : '}'
%% %%
void yyerror(char * error) void yyerror( char * error)
{ { char buf[1024];
mmerror(ET_ERROR, error); snprintf(buf,sizeof buf,"%s at or near \"%s\"",error,yytext);
buf[sizeof(buf)-1]=0;
mmerror(ET_ERROR, buf);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment