Fix parsing for <identifier>-<number> which was mis-identified as a unary

minus. Example is SELECT f1-2 FROM INT4_TBL;
This commit is contained in:
Thomas G. Lockhart 1998-02-18 07:23:22 +00:00
parent 6c1abf0d3c
commit 5ac4dcaa19
2 changed files with 220 additions and 170 deletions

View File

@ -1,7 +1,7 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.13 1998/02/13 05:09:15 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.14 1998/02/18 07:23:22 thomas Exp $
*/
#define FLEX_SCANNER
@ -284,46 +284,46 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
*yy_cp = '\0'; \
yy_c_buf_p = yy_cp;
#define YY_NUM_RULES 40
#define YY_END_OF_BUFFER 41
static yyconst short int yy_acclist[163] =
#define YY_NUM_RULES 41
#define YY_END_OF_BUFFER 42
static yyconst short int yy_acclist[168] =
{ 0,
10, 10, 6, 6, 24, 24, 9, 9, 25, 25,
18, 18, 41, 39, 40, 38, 39, 40, 38, 40,
31, 39, 40, 22, 39, 40, 29, 31, 39, 40,
15, 39, 40, 29, 39, 40, 29, 31, 39, 40,
29, 31, 39, 40, 29, 31, 39, 40, 35, 39,
40,16417, 29, 31, 39, 40, 37, 39, 40, 37,
39, 40, 37, 39, 40, 10, 40, 8, 40, 3,
6, 40, 3, 6, 40, 3, 40, 6, 40, 24,
40, 23, 40, 9, 40, 14, 40, 40, 25, 40,
26, 40, 18, 40, 16, 40, 40, 31, 31, 31,
18, 18, 42, 40, 41, 39, 40, 41, 39, 41,
31, 40, 41, 22, 40, 41, 29, 31, 40, 41,
15, 40, 41, 29, 40, 41, 29, 31, 40, 41,
29, 31, 40, 41, 29, 31, 40, 41, 36, 40,
41,16418, 29, 31, 40, 41, 38, 40, 41,16417,
38, 40, 41,16417, 38, 40, 41,16417, 10, 41,
8, 41, 3, 6, 41, 3, 6, 41, 3, 41,
6, 41, 24, 41, 23, 41, 9, 41, 14, 41,
41, 25, 41, 26, 41, 18, 41, 16, 41, 41,
32, 31, 31, 35,16417, 4, 31, 31, 27, 31,
37, 7, 13, 10, 6, 6, 5, 24, 9, 25,
18, 17, 20, 19, 20, 30, 28, 30, 28, 30,
32, 28, 1, 31, 31, 28, 30, 4, 31, 4,
31, 4, 31, 8225, 36,16418, 12, 5, 11, 21,
30, 2, 4, 31, 30, 2, 2, 2, 8226, 36,
16418, 2
31, 31, 31, 32, 31, 31, 36,16418, 4, 31,
31, 27, 31, 38,16417, 7, 13, 10, 6, 6,
5, 24, 9, 25, 18, 17, 20, 19, 20, 30,
28, 30, 28, 30, 32, 28, 1, 31, 31, 28,
30, 4, 31, 4, 31, 4, 31, 8226, 37,16419,
8225, 12, 5, 11, 21, 30, 2, 4, 31, 30,
2, 2, 2, 8227, 37,16419, 2
} ;
static yyconst short int yy_accept[125] =
static yyconst short int yy_accept[128] =
{ 0,
1, 1, 1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 16, 19, 21, 24,
27, 31, 34, 37, 41, 45, 49, 53, 57, 60,
63, 66, 68, 70, 73, 76, 78, 80, 82, 84,
86, 88, 89, 91, 93, 95, 97, 98, 99, 100,
101, 102, 102, 103, 104, 106, 108, 109, 109, 109,
109, 111, 112, 113, 114, 115, 115, 115, 116, 117,
117, 117, 118, 119, 120, 120, 120, 121, 122, 122,
122, 123, 124, 126, 127, 129, 132, 133, 133, 134,
135, 136, 138, 138, 140, 142, 144, 145, 147, 147,
27, 31, 34, 37, 41, 45, 49, 53, 57, 61,
65, 69, 71, 73, 76, 79, 81, 83, 85, 87,
89, 91, 92, 94, 96, 98, 100, 101, 102, 103,
104, 105, 105, 106, 107, 109, 111, 112, 112, 112,
112, 114, 114, 114, 116, 117, 118, 119, 119, 119,
120, 121, 121, 121, 122, 123, 124, 124, 124, 125,
126, 126, 126, 127, 128, 130, 131, 133, 136, 137,
137, 138, 139, 140, 142, 142, 144, 146, 148, 149,
147, 148, 149, 149, 149, 150, 150, 150, 151, 152,
152, 155, 156, 156, 156, 156, 157, 158, 159, 160,
160, 162, 163, 163
151, 152, 152, 152, 153, 154, 154, 154, 155, 155,
155, 156, 157, 157, 160, 161, 161, 161, 161, 162,
163, 164, 165, 165, 167, 168, 168
} ;
static yyconst int yy_ec[256] =
@ -360,149 +360,157 @@ static yyconst int yy_ec[256] =
static yyconst int yy_meta[22] =
{ 0,
1, 1, 2, 3, 4, 3, 5, 1, 6, 7,
7, 8, 3, 9, 3, 3, 10, 10, 9, 10,
11
1, 2, 3, 4, 5, 4, 6, 1, 7, 8,
9, 10, 4, 11, 4, 4, 2, 2, 11, 2,
12
} ;
static yyconst short int yy_base[142] =
static yyconst short int yy_base[146] =
{ 0,
0, 0, 355, 344, 18, 31, 334, 328, 325, 318,
46, 48, 18, 31, 313, 396, 396, 396, 293, 396,
12, 396, 292, 203, 42, 49, 61, 21, 0, 199,
196, 0, 52, 0, 72, 52, 0, 0, 396, 0,
64, 396, 66, 396, 0, 77, 192, 181, 78, 31,
169, 79, 165, 93, 0, 111, 104, 126, 0, 156,
135, 0, 396, 396, 0, 68, 128, 0, 0, 110,
129, 130, 0, 0, 138, 140, 142, 0, 146, 148,
396, 396, 396, 396, 396, 111, 396, 152, 396, 165,
122, 0, 77, 178, 64, 140, 396, 193, 170, 183,
0, 0, 332, 325, 18, 31, 325, 324, 321, 320,
46, 48, 18, 31, 326, 435, 435, 435, 309, 435,
12, 435, 308, 213, 42, 49, 61, 21, 63, 74,
209, 0, 52, 0, 82, 58, 0, 0, 435, 0,
66, 435, 76, 435, 0, 80, 206, 198, 88, 31,
188, 82, 179, 102, 0, 120, 113, 135, 0, 175,
169, 137, 0, 149, 435, 435, 0, 87, 140, 0,
0, 71, 132, 142, 0, 0, 147, 150, 152, 0,
156, 158, 435, 435, 435, 435, 435, 114, 435, 162,
435, 175, 120, 0, 92, 188, 57, 150, 435, 203,
396, 157, 195, 198, 396, 206, 208, 396, 0, 144,
214, 65, 216, 0, 210, 220, 223, 228, 396, 16,
214, 232, 396, 235, 246, 257, 268, 279, 290, 299,
298, 308, 319, 328, 335, 346, 357, 367, 378, 383,
386
435, 180, 193, 435, 167, 205, 208, 435, 216, 218,
435, 0, 154, 224, 52, 226, 0, 220, 230, 233,
238, 435, 16, 224, 242, 435, 245, 257, 269, 281,
293, 305, 314, 322, 333, 345, 354, 363, 375, 387,
398, 410, 415, 419, 423
} ;
static yyconst short int yy_def[142] =
static yyconst short int yy_def[146] =
{ 0,
123, 1, 124, 124, 125, 125, 126, 126, 127, 127,
128, 128, 129, 129, 123, 123, 123, 123, 130, 123,
130, 123, 123, 130, 130, 130, 123, 130, 131, 131,
131, 132, 123, 133, 133, 134, 35, 135, 123, 136,
123, 123, 123, 123, 137, 123, 138, 130, 130, 49,
123, 123, 50, 123, 27, 139, 54, 123, 140, 123,
130, 131, 123, 123, 132, 123, 123, 133, 35, 134,
134, 134, 135, 136, 123, 123, 123, 137, 123, 123,
123, 123, 123, 123, 123, 123, 123, 54, 123, 88,
90, 88, 139, 139, 94, 94, 123, 123, 123, 123,
126, 1, 127, 127, 128, 128, 129, 129, 130, 130,
131, 131, 132, 132, 126, 126, 126, 126, 133, 126,
133, 126, 126, 133, 133, 133, 126, 133, 134, 134,
30, 135, 126, 136, 136, 137, 35, 138, 126, 139,
126, 126, 126, 126, 140, 126, 141, 133, 133, 49,
126, 126, 50, 126, 27, 142, 54, 126, 143, 126,
133, 126, 144, 30, 126, 126, 135, 126, 126, 136,
35, 137, 137, 137, 138, 139, 126, 126, 126, 140,
126, 126, 126, 126, 126, 126, 126, 126, 126, 54,
126, 90, 92, 90, 142, 142, 96, 96, 126, 126,
123, 123, 123, 123, 123, 123, 123, 123, 88, 139,
94, 139, 123, 141, 123, 139, 139, 123, 123, 123,
98, 123, 0, 123, 123, 123, 123, 123, 123, 123,
123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
123
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 90, 142, 96, 142, 126, 145, 126, 142, 142,
126, 126, 126, 100, 126, 0, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126
} ;
static yyconst short int yy_nxt[418] =
static yyconst short int yy_nxt[457] =
{ 0,
16, 17, 18, 19, 20, 21, 22, 23, 24, 24,
25, 23, 26, 27, 28, 24, 29, 30, 29, 31,
16, 35, 50, 35, 46, 51, 36, 35, 35, 121,
16, 35, 50, 35, 46, 51, 36, 35, 35, 124,
37, 53, 35, 35, 35, 61, 35, 46, 47, 36,
35, 35, 85, 37, 86, 35, 35, 43, 43, 43,
43, 47, 54, 66, 67, 55, 44, 56, 44, 53,
70, 57, 58, 58, 72, 75, 76, 77, 77, 66,
67, 59, 60, 110, 55, 69, 111, 69, 79, 80,
70, 69, 69, 81, 69, 110, 69, 69, 49, 84,
87, 84, 87, 88, 88, 89, 90, 88, 90, 88,
35, 35, 87, 37, 88, 35, 35, 43, 43, 43,
43, 47, 54, 68, 69, 55, 44, 56, 44, 53,
113, 57, 58, 58, 62, 62, 72, 77, 78, 114,
74, 59, 60, 63, 55, 62, 62, 79, 79, 72,
65, 81, 82, 74, 63, 71, 83, 71, 68, 69,
72, 71, 71, 89, 71, 89, 71, 71, 49, 86,
88, 90, 90, 91, 92, 90, 92, 90, 90, 88,
88, 88, 88, 88, 94, 88, 94, 88, 70, 95,
94, 96, 72, 94, 51, 94, 94, 58, 58, 99,
100, 102, 102, 109, 101, 109, 59, 70, 70, 75,
76, 103, 104, 77, 77, 49, 105, 79, 80, 106,
107, 112, 110, 112, 108, 88, 116, 88, 102, 102,
88, 88, 88, 88, 88, 88, 88, 88, 90, 98,
90, 99, 100, 90, 90, 91, 101, 90, 85, 90,
90, 94, 51, 94, 99, 100, 95, 94, 96, 101,
94, 49, 94, 94, 113, 113, 103, 104, 83, 103,
113, 86, 90, 90, 91, 92, 90, 92, 90, 90,
92, 92, 93, 94, 92, 94, 92, 92, 90, 90,
90, 90, 90, 96, 90, 96, 90, 51, 97, 96,
98, 112, 96, 112, 96, 96, 58, 58, 62, 62,
72, 102, 103, 105, 105, 59, 104, 63, 77, 78,
72, 106, 107, 79, 79, 126, 108, 81, 82, 109,
110, 115, 113, 115, 111, 90, 119, 90, 105, 105,
90, 90, 90, 90, 90, 90, 90, 90, 92, 49,
92, 102, 103, 92, 92, 93, 104, 92, 100, 92,
92, 96, 87, 96, 102, 103, 97, 96, 98, 104,
104, 105, 64, 114, 105, 63, 98, 106, 107, 106,
107, 115, 108, 53, 108, 117, 118, 113, 113, 120,
120, 117, 118, 121, 117, 118, 114, 121, 110, 122,
118, 110, 123, 122, 118, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 34, 34, 34, 34,
34, 34, 34, 34, 34, 34, 34, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 40, 40,
40, 40, 40, 40, 40, 40, 40, 40, 40, 42,
42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
96, 51, 96, 96, 116, 116, 106, 107, 49, 106,
107, 108, 85, 117, 108, 66, 100, 109, 110, 109,
110, 118, 111, 53, 111, 120, 121, 116, 116, 123,
123, 120, 121, 124, 120, 121, 117, 124, 113, 125,
121, 113, 126, 125, 121, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 34, 34, 34,
34, 34, 34, 34, 34, 34, 34, 34, 34, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 40, 40, 40, 40, 40, 40, 40, 40, 40,
40, 40, 40, 42, 42, 42, 42, 42, 42, 42,
45, 48, 52, 49, 48, 48, 62, 62, 65, 65,
65, 65, 123, 65, 65, 65, 65, 65, 65, 68,
68, 68, 68, 68, 41, 68, 68, 68, 68, 68,
71, 41, 39, 71, 71, 73, 73, 73, 39, 73,
73, 73, 73, 73, 73, 73, 74, 74, 74, 74,
33, 74, 74, 74, 74, 74, 74, 78, 78, 78,
78, 33, 78, 78, 78, 78, 78, 82, 82, 82,
82, 82, 82, 82, 82, 82, 82, 82, 93, 123,
93, 93, 93, 93, 93, 93, 93, 93, 93, 97,
97, 97, 119, 119, 119, 15, 123, 123, 123, 123,
42, 42, 42, 42, 42, 45, 45, 45, 45, 45,
45, 45, 45, 45, 45, 45, 45, 48, 52, 49,
48, 48, 48, 64, 64, 126, 41, 41, 39, 39,
64, 33, 64, 67, 67, 67, 67, 67, 33, 67,
67, 67, 67, 67, 67, 70, 70, 70, 70, 70,
70, 126, 70, 70, 70, 70, 70, 73, 126, 126,
73, 73, 73, 75, 75, 75, 75, 126, 75, 75,
75, 75, 75, 75, 75, 76, 76, 76, 76, 76,
126, 76, 76, 76, 76, 76, 76, 80, 80, 80,
80, 80, 126, 80, 80, 80, 80, 80, 84, 84,
123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
123, 123, 123, 123, 123, 123, 123
84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
95, 95, 126, 95, 95, 95, 95, 95, 95, 95,
95, 95, 99, 99, 99, 99, 101, 101, 101, 101,
122, 122, 122, 122, 15, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126
} ;
static yyconst short int yy_chk[418] =
static yyconst short int yy_chk[457] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 5, 21, 5, 13, 21, 5, 5, 5, 120,
1, 5, 21, 5, 13, 21, 5, 5, 5, 123,
5, 28, 5, 5, 6, 28, 6, 14, 13, 6,
6, 6, 50, 6, 50, 6, 6, 11, 11, 12,
12, 14, 25, 33, 33, 25, 11, 26, 12, 26,
36, 26, 27, 27, 36, 41, 41, 43, 43, 66,
66, 27, 27, 112, 27, 35, 95, 35, 46, 46,
35, 35, 35, 46, 35, 93, 35, 35, 49, 49,
52, 49, 52, 54, 54, 54, 54, 54, 54, 54,
115, 26, 27, 27, 29, 29, 36, 41, 41, 97,
36, 27, 27, 29, 27, 30, 30, 43, 43, 72,
30, 46, 46, 72, 30, 35, 46, 35, 68, 68,
35, 35, 35, 52, 35, 52, 35, 35, 49, 49,
95, 49, 54, 54, 54, 54, 54, 54, 54, 54,
54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
54, 54, 54, 54, 56, 57, 56, 57, 70, 56,
56, 56, 70, 56, 86, 56, 56, 58, 58, 67,
67, 72, 72, 91, 67, 91, 58, 71, 72, 75,
75, 76, 76, 77, 77, 61, 76, 79, 79, 80,
80, 96, 110, 96, 80, 88, 110, 88, 102, 102,
88, 88, 88, 88, 88, 88, 88, 88, 90, 60,
90, 99, 99, 90, 90, 90, 99, 90, 53, 90,
90, 94, 51, 94, 100, 100, 94, 94, 94, 100,
94, 48, 94, 94, 98, 98, 103, 103, 47, 104,
54, 54, 54, 56, 57, 56, 57, 88, 56, 56,
56, 93, 56, 93, 56, 56, 58, 58, 62, 62,
73, 69, 69, 74, 74, 58, 69, 62, 77, 77,
74, 78, 78, 79, 79, 64, 78, 81, 81, 82,
82, 98, 113, 98, 82, 90, 113, 90, 105, 105,
90, 90, 90, 90, 90, 90, 90, 90, 92, 61,
92, 102, 102, 92, 92, 92, 102, 92, 60, 92,
92, 96, 53, 96, 103, 103, 96, 96, 96, 103,
104, 103, 31, 98, 104, 30, 98, 106, 106, 107,
107, 98, 106, 24, 107, 111, 111, 113, 113, 115,
115, 116, 116, 115, 117, 117, 113, 121, 116, 118,
118, 117, 121, 122, 122, 124, 124, 124, 124, 124,
124, 124, 124, 124, 124, 124, 125, 125, 125, 125,
125, 125, 125, 125, 125, 125, 125, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 127, 127,
127, 127, 127, 127, 127, 127, 127, 127, 127, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
96, 51, 96, 96, 100, 100, 106, 106, 48, 107,
107, 106, 47, 100, 107, 31, 100, 109, 109, 110,
110, 100, 109, 24, 110, 114, 114, 116, 116, 118,
118, 119, 119, 118, 120, 120, 116, 124, 119, 121,
121, 120, 124, 125, 125, 127, 127, 127, 127, 127,
127, 127, 127, 127, 127, 127, 127, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 129,
129, 129, 129, 129, 129, 129, 129, 129, 129, 129,
129, 130, 130, 130, 130, 130, 130, 130, 130, 130,
130, 130, 130, 131, 131, 131, 131, 131, 131, 131,
129, 130, 23, 19, 130, 130, 131, 131, 132, 132,
132, 132, 15, 132, 132, 132, 132, 132, 132, 133,
133, 133, 133, 133, 10, 133, 133, 133, 133, 133,
134, 9, 8, 134, 134, 135, 135, 135, 7, 135,
135, 135, 135, 135, 135, 135, 136, 136, 136, 136,
4, 136, 136, 136, 136, 136, 136, 137, 137, 137,
137, 3, 137, 137, 137, 137, 137, 138, 138, 138,
138, 138, 138, 138, 138, 138, 138, 138, 139, 0,
139, 139, 139, 139, 139, 139, 139, 139, 139, 140,
140, 140, 141, 141, 141, 123, 123, 123, 123, 123,
131, 131, 131, 131, 131, 132, 132, 132, 132, 132,
132, 132, 132, 132, 132, 132, 132, 133, 23, 19,
133, 133, 133, 134, 134, 15, 10, 9, 8, 7,
134, 4, 134, 135, 135, 135, 135, 135, 3, 135,
135, 135, 135, 135, 135, 136, 136, 136, 136, 136,
136, 0, 136, 136, 136, 136, 136, 137, 0, 0,
137, 137, 137, 138, 138, 138, 138, 0, 138, 138,
138, 138, 138, 138, 138, 139, 139, 139, 139, 139,
0, 139, 139, 139, 139, 139, 139, 140, 140, 140,
140, 140, 0, 140, 140, 140, 140, 140, 141, 141,
123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
123, 123, 123, 123, 123, 123, 123
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
142, 142, 0, 142, 142, 142, 142, 142, 142, 142,
142, 142, 143, 143, 143, 143, 144, 144, 144, 144,
145, 145, 145, 145, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126
} ;
static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
@ -539,7 +547,7 @@ char *yytext;
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.13 1998/02/13 05:09:15 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.14 1998/02/18 07:23:22 thomas Exp $
*
*-------------------------------------------------------------------------
*/
@ -651,7 +659,7 @@ char literal[MAX_PARSE_BUFFER];
* Other embedded escaped characters are matched explicitly and the leading
* backslash is dropped from the string. - thomas 1997-09-24
*/
#line 655 "lex.yy.c"
#line 663 "lex.yy.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
@ -804,7 +812,7 @@ YY_DECL
#line 178 "scan.l"
#line 808 "lex.yy.c"
#line 816 "lex.yy.c"
if ( yy_init )
{
@ -852,14 +860,14 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 124 )
if ( yy_current_state >= 127 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
*yy_state_ptr++ = yy_current_state;
++yy_cp;
}
while ( yy_base[yy_current_state] != 396 );
while ( yy_base[yy_current_state] != 435 );
yy_find_action:
yy_current_state = *--yy_state_ptr;
@ -1152,6 +1160,29 @@ YY_RULE_SETUP
case 33:
YY_RULE_SETUP
#line 314 "scan.l"
{
int i;
ScanKeyword *keyword;
BEGIN(xm);
for(i = 0; yytext[i]; i++)
if (isupper(yytext[i]))
yytext[i] = tolower(yytext[i]);
keyword = ScanKeywordLookup((char*)yytext);
if (keyword != NULL) {
return (keyword->value);
}
else
{
yylval.str = pstrdup((char*)yytext);
return (IDENT);
}
}
YY_BREAK
case 34:
YY_RULE_SETUP
#line 333 "scan.l"
{
char* endptr;
@ -1171,9 +1202,9 @@ YY_RULE_SETUP
return (ICONST);
}
YY_BREAK
case 34:
case 35:
YY_RULE_SETUP
#line 332 "scan.l"
#line 351 "scan.l"
{
char* endptr;
@ -1186,9 +1217,9 @@ YY_RULE_SETUP
return (FCONST);
}
YY_BREAK
case 35:
case 36:
YY_RULE_SETUP
#line 343 "scan.l"
#line 362 "scan.l"
{
char* endptr;
@ -1207,9 +1238,9 @@ YY_RULE_SETUP
return (ICONST);
}
YY_BREAK
case 36:
case 37:
YY_RULE_SETUP
#line 360 "scan.l"
#line 379 "scan.l"
{
char* endptr;
@ -1221,9 +1252,9 @@ YY_RULE_SETUP
return (FCONST);
}
YY_BREAK
case 37:
case 38:
YY_RULE_SETUP
#line 370 "scan.l"
#line 389 "scan.l"
{
int i;
ScanKeyword *keyword;
@ -1243,22 +1274,22 @@ YY_RULE_SETUP
}
}
YY_BREAK
case 38:
YY_RULE_SETUP
#line 388 "scan.l"
{ /* ignore */ }
YY_BREAK
case 39:
YY_RULE_SETUP
#line 390 "scan.l"
{ return (yytext[0]); }
#line 407 "scan.l"
{ /* ignore */ }
YY_BREAK
case 40:
YY_RULE_SETUP
#line 392 "scan.l"
#line 409 "scan.l"
{ return (yytext[0]); }
YY_BREAK
case 41:
YY_RULE_SETUP
#line 411 "scan.l"
ECHO;
YY_BREAK
#line 1262 "lex.yy.c"
#line 1293 "lex.yy.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(xb):
case YY_STATE_EOF(xc):
@ -1553,7 +1584,7 @@ static yy_state_type yy_get_previous_state()
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 124 )
if ( yy_current_state >= 127 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@ -1583,11 +1614,11 @@ yy_state_type yy_current_state;
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 124 )
if ( yy_current_state >= 127 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 123);
yy_is_jam = (yy_current_state == 126);
if ( ! yy_is_jam )
*yy_state_ptr++ = yy_current_state;
@ -2144,7 +2175,7 @@ int main()
return 0;
}
#endif
#line 392 "scan.l"
#line 411 "scan.l"
void yyerror(char message[])

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.35 1998/02/11 03:56:07 thomas Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.36 1998/02/18 07:22:40 thomas Exp $
*
*-------------------------------------------------------------------------
*/
@ -311,6 +311,25 @@ other .
return (PARAM);
}
{identifier}/{space}*-{number} {
int i;
ScanKeyword *keyword;
BEGIN(xm);
for(i = 0; yytext[i]; i++)
if (isupper(yytext[i]))
yytext[i] = tolower(yytext[i]);
keyword = ScanKeywordLookup((char*)yytext);
if (keyword != NULL) {
return (keyword->value);
}
else
{
yylval.str = pstrdup((char*)yytext);
return (IDENT);
}
}
{integer}/{space}*-{number} {
char* endptr;