Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdf8789b

Browse files
author
Michael Meskes
committed
Third try. Sorry, I had a wrong path in my copy statement.
1 parentc823b1e commitdf8789b

File tree

5 files changed

+26
-8
lines changed

5 files changed

+26
-8
lines changed

‎src/interfaces/ecpg/preproc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ PATCHLEVEL=0
99
overrideCPPFLAGS+=-I$(srcdir)/../include -DMAJOR_VERSION=$(MAJOR_VERSION)\
1010
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL)\
1111
-DINCLUDE_PATH=\"$(includedir)\"
12+
# -DYYDEBUG -g
1213

1314
OBJS=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o\
1415
keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o

‎src/interfaces/ecpg/preproc/ecpg.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ static void
2222
usage(char*progname)
2323
{
2424
fprintf(stderr,"ecpg - the postgresql preprocessor, version: %d.%d.%d\n",MAJOR_VERSION,MINOR_VERSION,PATCHLEVEL);
25-
fprintf(stderr,"Usage: %s: [-v] [-t] [-I include path] [ -o output file name] [-D define name] file1 [file2] ...\n",progname);
25+
fprintf(stderr,"Usage: %s: "
26+
#ifdefYYDEBUG
27+
"[-d]"
28+
#endif
29+
" [-v] [-t] [-I include path] [ -o output file name] [-D define name] file1 [file2] ...\n",progname);
2630
}
2731

2832
staticvoid
@@ -61,7 +65,7 @@ main(int argc, char *const argv[])
6165
add_include_path("/usr/local/include");
6266
add_include_path(".");
6367

64-
while ((c=getopt(argc,argv,"vo:I:tD:"))!=EOF)
68+
while ((c=getopt(argc,argv,"vo:I:tD:d"))!=EOF)
6569
{
6670
switch (c)
6771
{
@@ -84,6 +88,11 @@ main(int argc, char *const argv[])
8488
case'D':
8589
add_preprocessor_define(optarg);
8690
break;
91+
#ifdefYYDEBUG
92+
case'd':
93+
yydebug=1;
94+
break;
95+
#endif
8796
default:
8897
usage(argv[0]);
8998
returnILLEGAL_OPTION;

‎src/interfaces/ecpg/preproc/extern.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ extern char *connection;
1919
externchar*input_filename;
2020
externchar*yytext,
2121
errortext[128];
22+
#ifdefYYDEBUG
23+
externintyydebug;
24+
#endif
2225
externintyylineno,
2326
yyleng;
2427
externFILE*yyin,

‎src/interfaces/ecpg/preproc/keywords.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.30 2000/09/26 11:41:44 meskes Exp $
11+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.31 2000/11/07 08:46:27 meskes Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -191,12 +191,12 @@ static ScanKeyword ScanKeywords[] = {
191191
{"only",ONLY},
192192
{"operator",OPERATOR},
193193
{"option",OPTION},
194-
{"overlaps",OVERLAPS},
195-
{"owner",OWNER},
196194
{"or",OR},
197195
{"order",ORDER},
198196
{"out",OUT},
199197
{"outer",OUTER_P},
198+
{"overlaps",OVERLAPS},
199+
{"owner",OWNER},
200200
{"partial",PARTIAL},
201201
{"password",PASSWORD},
202202
{"path",PATH_P},

‎src/interfaces/ecpg/preproc/preproc.y

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ make_name(void)
375375
%type<index>opt_array_boundsopt_type_array_bounds
376376

377377
%type<ival>Iresult
378+
379+
%tokenYYERROR_VERBOSE
378380
%%
379381
prog:statements;
380382

@@ -5272,6 +5274,7 @@ c_anything: IDENT { $$ = $1; }
52725274
|S_LSHIFT{$$ = make_str("<<"); }
52735275
|S_MEMBER{$$ = make_str("->"); }
52745276
|S_MEMPOINT{$$ = make_str("->*"); }
5277+
|S_MOD{$$ = make_str("%="); }
52755278
|S_MUL{$$ = make_str("*="); }
52765279
|S_NEQUAL{$$ = make_str("!="); }
52775280
|S_OR{$$ = make_str("||"); }
@@ -5311,7 +5314,9 @@ blockend : '}'
53115314

53125315
%%
53135316

5314-
voidyyerror(char * error)
5315-
{
5316-
mmerror(ET_ERROR, error);
5317+
voidyyerror(char * error)
5318+
{char buf[1024];
5319+
snprintf(buf,sizeof buf,"%s at or near\"%s\"",error,yytext);
5320+
buf[sizeof(buf)-1]=0;
5321+
mmerror(ET_ERROR, buf);
53175322
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp