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}
120120xhinside [^ ' ]+
121121xhcat {quote }{whitespace_with_newline }{quote }
122122
123+ /* National character
124+ */
125+ xnstart [nN ]{quote }
126+
123127/* C version of hex number
124128 */
125129xch 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