12
12
*
13
13
*
14
14
* 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 $
16
16
*
17
17
*-------------------------------------------------------------------------
18
18
*/
@@ -89,14 +89,14 @@ static struct _if_value
89
89
* We use exclusive states for quoted strings, extended comments,
90
90
* and to eliminate parsing troubles for numeric strings.
91
91
* Exclusive states:
92
- * <xbit > bit string literal
92
+ * <xb > bit string literal
93
93
* <xc> extended C-style comments - thomas 1997-07-12
94
94
* <xd> delimited identifiers (double-quoted identifiers) - thomas 1997-10-27
95
95
* <xh> hexadecimal numeric string - thomas 1997-11-16
96
96
* <xq> quoted strings - thomas 1997-07-30
97
97
*/
98
98
99
- %x xbit
99
+ %x xb
100
100
%x xc
101
101
%x xd
102
102
%x xdc
@@ -108,10 +108,10 @@ static struct _if_value
108
108
109
109
/* Bit string
110
110
*/
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 }
115
115
116
116
/* Hexadecimal number
117
117
*/
@@ -120,6 +120,10 @@ xhstop {quote}
120
120
xhinside [^ ' ]+
121
121
xhcat {quote }{whitespace_with_newline }{quote }
122
122
123
+ /* National character
124
+ */
125
+ xnstart [nN ]{quote }
126
+
123
127
/* C version of hex number
124
128
*/
125
129
xch 0[xX ][0 -9A -Fa -f ]*
@@ -318,13 +322,13 @@ cppline {space}*#(.*\\{space})*.*
318
322
319
323
<xc ><<EOF>> { mmerror (PARSE_ERROR, ET_ERROR, " Unterminated /* comment" ); }
320
324
321
- <SQL >{xbitstart } {
325
+ <SQL >{xbstart } {
322
326
token_start = yytext;
323
- BEGIN (xbit );
327
+ BEGIN (xb );
324
328
startlit ();
325
329
addlitchar (' b' );
326
330
}
327
- <xbit >{ xbitstop } {
331
+ <xb >{ xbstop } {
328
332
BEGIN (SQL);
329
333
if (literalbuf[strspn (literalbuf, " 01" ) + 1 ] != ' \0 ' )
330
334
mmerror (PARSE_ERROR, ET_ERROR, " invalid bit string input." );
@@ -333,10 +337,10 @@ cppline {space}*#(.*\\{space})*.*
333
337
}
334
338
335
339
<xh >{xhinside } |
336
- <xbit >{ xbitinside } { addlit (yytext, yyleng); }
340
+ <xb >{ xbinside } { addlit (yytext, yyleng); }
337
341
<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" ); }
340
344
341
345
<SQL >{xhstart } {
342
346
token_start = yytext;
@@ -362,7 +366,15 @@ cppline {space}*#(.*\\{space})*.*
362
366
}
363
367
364
368
<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
+ }
366
378
<C ,SQL >{xqstart } {
367
379
token_start = yytext;
368
380
state_before = YYSTATE;
@@ -579,7 +591,7 @@ cppline {space}*#(.*\\{space})*.*
579
591
*/
580
592
if (ptr == NULL )
581
593
{
582
- yylval.str = mm_strdup ( yytext);
594
+ yylval.str = mm_strdup (yytext);
583
595
return IDENT;
584
596
}
585
597
}
0 commit comments