8000 Re-committing the whole big_bison tag. · linearregression/postgres@8b5cabd · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b5cabd

Browse files
author
Michael Meskes
committed
Re-committing the whole big_bison tag.
1 parent 090dbb1 commit 8b5cabd

File tree

3 files changed

+40
-20
lines changed

3 files changed

+40
-20
lines changed

src/interfaces/ecpg/lib/execute.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.37 2002/06/12 12:06:53 meskes Exp $ */
1+
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.37.2.1 2002/07/21 08:26:52 meskes Exp $ */
22

33
/*
44
* The aim is to get a simpler inteface to the database routines.
@@ -56,7 +56,7 @@ struct sqlca sqlca =
5656
};
5757

5858
/* This function returns a newly malloced string that has the \
59-
in the argument quoted with \ and the ' quote with ' as SQL92 says.
59+
in the argument quoted with \ and the ' quoted with ' as SQL92 says.
6060
*/
6161
static
6262
char *
@@ -84,13 +84,12 @@ quote_postgres(char *arg, int lineno)
8484
default:
8585
;
8686
}
87-
8887
res[ri] = arg[i];
8988
}
9089

9190
res[ri++] = '\'';
9291
res[ri] = '\0';
93-
92+
9493
return res;
9594
}
9695

src/interfaces/ecpg/preproc/keywords.c

Lines changed: 10 additions & 1 deletion
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.50.2.1 2002/07/01 07:10:10 meskes Exp $
11+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.50.2.2 2002/07/21 08:26:52 meskes Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -44,6 +44,8 @@ static ScanKeyword ScanKeywords[] = {
4444
{"as", AS},
4545
{"asc", ASC},
4646
{"assertion", ASSERTION},
47+
{"assignment", ASSIGNMENT},
48+
{"asymmetric", ASYMMETRIC},
4749
{"at", AT},
4850
{"authorization", AUTHORIZATION},
4951
{"backward", BACKWARD},
@@ -77,6 +79,7 @@ static ScanKeyword ScanKeywords[] = {
7779
{"committed", COMMITTED},
7880
{"constraint", CONSTRAINT},
7981
{"constraints", CONSTRAINTS},
82+
{"conversion", CONVERSION_P},
8083
{"copy", COPY},
8184
{"create", CREATE},
8285
{"createdb", CREATEDB},
@@ -98,6 +101,7 @@ static ScanKeyword ScanKeywords[] = {
98101
{"deferred", DEFERRED},
99102
{"definer", DEFINER},
100103
{"delete", DELETE_P},
104+
{"delimiter", DELIMITER},
101105
{"delimiters", DELIMITERS},
102106
{"desc", DESC},
103107
{"distinct", DISTINCT},
@@ -251,6 +255,8 @@ static ScanKeyword ScanKeywords[] = {
251255
{"setof", SETOF},
252256
{"share", SHARE},
253257
{"show", SHOW},
258+
{"similar", SIMILAR},
259+
{"simple", SIMPLE},
254260
{"smallint", SMALLINT},
255261
{"some", SOME},
256262
{"stable", STABLE},
@@ -262,6 +268,7 @@ static ScanKeyword ScanKeywords[] = {
262268
{"storage", STORAGE},
263269
{"strict", STRICT},
264270
{"substring", SUBSTRING},
271+
{"symmetric", SYMMETRIC},
265272
{"sysid", SYSID},
266273
{"table", TABLE},
267274
{"temp", TEMP},
@@ -274,6 +281,7 @@ static ScanKeyword ScanKeywords[] = {
274281
{"toast", TOAST},
275282
{"trailing", TRAILING},
276283
{"transaction", TRANSACTION},
284+
{"treat", TREAT},
277285
{"trigger", TRIGGER},
278286
{"trim", TRIM},
279287
{"true", TRUE_P},
@@ -304,6 +312,7 @@ static ScanKeyword ScanKeywords[] = {
304312
{"with", WITH},
305313
{"without", WITHOUT},
306314
{"work", WORK},
315+
{"write", WRITE},
307316
{"year", YEAR_P},
308317
{"zone", ZONE},
309318
};

src/interfaces/ecpg/preproc/pgc.l

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*
1414
* IDENTIFICATION
15-
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.94.2.2 2002/07/01 15:01:37 meskes Exp $
15+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.94.2.3 2002/07/21 08:26:52 meskes Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -89,14 +89,14 @@ static struct _if_value
8989
* We use exclusive states for quoted strings, extended comments,
9090
* and to eliminate parsing troubles for numeric strings.
9191
* Exclusive states:
92-
* <xbit> bit string literal
92+
* <xb> bit string literal
9393
* <xc> extended C-style comments - thomas 1997-07-12
9494
* <xd> delimited identifiers (double-quoted identifiers) - thomas 1997-10-27
9595
* <xh> hexadecimal numeric string - thomas 1997-11-16
9696
* <xq> quoted strings - thomas 1997-07-30
9797
*/
9898

99-
%x xbit
99+
%x xb
100100
%x xc
101101
%x xd
102102
%x xdc
@@ -108,10 +108,10 @@ static struct _if_value
108108

109109
/* Bit string
110110
*/
111-
xbitstart [bB]{quote}
112-
xbitstop {quote}
113-
xbitinside [^']*
114-
xbitcat {quote}{whitespace_with_newline}{quote}
111+
xbstart [bB]{quote}
112+
xbstop {quote}
113+
xbinside [^']*
114+
xbcat {quote}{whitespace_with_newline}{quote}
115115

116116
/* Hexadecimal number
117117
*/
@@ -120,6 +120,10 @@ xhstop {quote}
120120
xhinside [^']+
121121
xhcat {quote}{whitespace_with_newline}{quote}
122122

123+
/* National character
124+
*/
125+
xnstart [nN]{quote}
126+
123127
/* C version of hex number
124128
*/
125129
xch 0[xX][0-9A-Fa-f]*
@@ -318,13 +322,13 @@ cppline {space}*#(.*\\{space})*.*
318322

319323
<xc><<EOF>> { mmerror(PARSE_ERROR, ET_ERROR, "Unterminated /* comment"); }
320324

321-
<SQL>{xbitstart} {
325+
<SQL>{xbstart} {
322326
token_start = yytext;
323-
BEGIN(xbit);
327+
BEGIN(xb);
324328
startlit();
325329
addlitchar('b');
326330
}
327-
<xbit>{xbitstop} {
331+
<xb>{xbstop} {
328332
BEGIN(SQL);
329333
if (literalbuf[strspn(literalbuf, "01") + 1] != '\0')
330334
mmerror(PARSE_ERROR, ET_ERROR, "invalid bit string input.");
@@ -333,10 +337,10 @@ cppline {space}*#(.*\\{space})*.*
333337
}
334338

335339
<xh>{xhinside} |
336-
<xbit>{xbitinside} { addlit(yytext, yyleng); }
340+
<xb>{xbinside} { addlit(yytext, yyleng); }
337341
<xh>{xhcat} |
338-
<xbit>{xbitcat} { /* ignore */ }
339-
<xbit><<EOF>> { mmerror(PARSE_ERROR, ET_ERROR, "Unterminated bit string"); }
342+
<xb>{xbcat} { /* ignore */ }
343+
<xb><<EOF>> { mmerror(PARSE_ERROR, ET_ERROR, "Unterminated bit string"); }
340344

341345
<SQL>{xhstart} {
342346
token_start = yytext;
@@ -362,7 +366,15 @@ cppline {space}*#(.*\\{space})*.*
362366
}
363367

364368
<xh><<EOF>> { mmerror(PARSE_ERROR, ET_ERROR, "Unterminated hexadecimal integer"); }
365-
369+
<SQL>{xnstart} {
370+
/* National character.
371+
* Need to remember type info to flow it forward into the parser.
372+
* Not yet implemented. - thomas 2002-06-17
373+
*/
374+
token_start = yytext;
375+
BEGIN(xq);
376+
startlit();
377+
}
366378
<C,SQL>{xqstart} {
367379
token_start = yytext;
368380
state_before = YYSTATE;
@@ -579,7 +591,7 @@ cppline {space}*#(.*\\{space})*.*
579591
*/
580592
if (ptr == NULL)
581593
{
582-
yylval.str = mm_strdup( yytext);
594+
yylval.str = mm_strdup(yytext);
583595
return IDENT;
584596
}
585597
}

0 commit comments

Comments
 (0)
0