Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
f7c6a88c
Commit
f7c6a88c
authored
Feb 07, 1999
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify lexer's rules for string constants, eliminate potential buffer overrun.
parent
45ff93c4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
216 additions
and
245 deletions
+216
-245
src/backend/parser/scan.c
src/backend/parser/scan.c
+211
-228
src/backend/parser/scan.l
src/backend/parser/scan.l
+5
-17
No files found.
src/backend/parser/scan.c
View file @
f7c6a88c
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
*
/master/usr.bin/lex/skel.c,v 1.3 1997/09/25 00:10:23 jch Exp
*
$Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.33 1999/02/07 23:58:52 tgl Exp $
*/
#define FLEX_SCANNER
...
...
@@ -284,33 +284,33 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
*yy_cp = '\0'; \
yy_c_buf_p = yy_cp;
#define YY_NUM_RULES 4
2
#define YY_END_OF_BUFFER 4
3
static
yyconst
short
int
yy_acclist
[
18
4
]
=
#define YY_NUM_RULES 4
1
#define YY_END_OF_BUFFER 4
2
static
yyconst
short
int
yy_acclist
[
18
2
]
=
{
0
,
10
,
10
,
6
,
6
,
2
4
,
24
,
9
,
9
,
25
,
25
,
18
,
18
,
4
3
,
41
,
42
,
40
,
41
,
42
,
40
,
42
,
3
2
,
41
,
42
,
22
,
41
,
42
,
29
,
30
,
32
,
41
,
4
2
,
15
,
41
,
42
,
29
,
30
,
41
,
42
,
29
,
30
,
3
2
,
41
,
42
,
29
,
30
,
32
,
41
,
42
,
29
,
30
,
4
1
,
42
,
29
,
30
,
32
,
41
,
42
,
37
,
41
,
42
,
1641
9
,
29
,
30
,
32
,
41
,
42
,
39
,
41
,
42
,
16418
,
3
9
,
41
,
42
,
16418
,
39
,
41
,
42
,
16418
,
10
,
42
,
8
,
4
2
,
3
,
6
,
42
,
3
,
6
,
42
,
3
,
42
,
6
,
4
2
,
24
,
42
,
23
,
42
,
9
,
42
,
14
,
42
,
4
2
,
25
,
42
,
26
,
42
,
18
,
42
,
16
,
42
,
42
,
3
2
,
32
,
32
,
33
,
32
,
32
,
37
,
16419
,
38
,
16420
,
4
,
3
2
,
32
,
38
,
16420
,
27
,
32
,
39
,
16418
,
7
,
13
,
10
,
6
,
6
,
5
,
2
4
,
9
,
25
,
18
,
17
,
20
,
19
,
20
,
31
,
28
,
31
,
28
,
31
,
33
,
28
,
1
,
32
,
32
,
28
,
31
,
4
,
32
,
4
,
32
,
4
,
3
2
,
8227
,
38
,
16420
,
38
,
16420
,
8226
,
12
,
5
,
11
,
21
,
31
,
8228
,
38
,
16420
,
2
,
4
,
32
,
31
,
2
,
2
,
2
,
2
10
,
10
,
6
,
6
,
2
3
,
23
,
9
,
9
,
24
,
24
,
18
,
18
,
4
2
,
40
,
41
,
39
,
40
,
41
,
39
,
41
,
3
1
,
40
,
41
,
21
,
40
,
41
,
28
,
29
,
31
,
40
,
4
1
,
15
,
40
,
41
,
28
,
29
,
40
,
41
,
28
,
29
,
3
1
,
40
,
41
,
28
,
29
,
31
,
40
,
41
,
28
,
29
,
4
0
,
41
,
28
,
29
,
31
,
40
,
41
,
36
,
40
,
41
,
1641
8
,
28
,
29
,
31
,
40
,
41
,
38
,
40
,
41
,
16417
,
3
8
,
40
,
41
,
16417
,
38
,
40
,
41
,
16417
,
10
,
41
,
8
,
4
1
,
3
,
6
,
41
,
3
,
6
,
41
,
3
,
41
,
6
,
4
1
,
23
,
41
,
22
,
41
,
9
,
41
,
14
,
41
,
4
1
,
24
,
41
,
25
,
41
,
18
,
41
,
16
,
41
,
41
,
3
1
,
31
,
31
,
32
,
31
,
31
,
36
,
16418
,
37
,
16419
,
4
,
3
1
,
31
,
37
,
16419
,
26
,
31
,
38
,
16417
,
7
,
13
,
10
,
6
,
6
,
5
,
2
3
,
9
,
24
,
18
,
17
,
19
,
30
,
27
,
30
,
27
,
30
,
32
,
27
,
1
,
31
,
31
,
27
,
30
,
4
,
31
,
4
,
31
,
4
,
31
,
8226
,
3
7
,
16419
,
37
,
16419
,
8225
,
12
,
5
,
11
,
20
,
30
,
8227
,
37
,
16419
,
2
,
4
,
31
,
30
,
2
,
2
,
2
,
2
}
;
static
yyconst
short
int
yy_accept
[
13
5
]
=
static
yyconst
short
int
yy_accept
[
13
4
]
=
{
0
,
1
,
1
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
16
,
19
,
21
,
24
,
...
...
@@ -321,12 +321,12 @@ static yyconst short int yy_accept[135] =
123
,
124
,
124
,
124
,
126
,
126
,
128
,
128
,
128
,
130
,
131
,
132
,
133
,
133
,
133
,
134
,
135
,
135
,
135
,
136
,
137
,
138
,
138
,
138
,
139
,
140
,
140
,
140
,
141
,
142
,
14
4
,
145
,
147
,
150
,
151
,
151
,
152
,
153
,
154
,
156
,
14
3
,
145
,
148
,
149
,
149
,
150
,
151
,
152
,
154
,
154
,
15
6
,
156
,
156
,
156
,
158
,
160
,
162
,
163
,
165
,
165
,
16
7
,
168
,
168
,
168
,
169
,
170
,
170
,
170
,
171
,
171
,
17
1
,
172
,
173
,
174
,
174
,
176
,
176
,
179
,
180
,
181
,
18
2
,
183
,
184
,
184
15
4
,
154
,
154
,
156
,
158
,
160
,
161
,
163
,
163
,
165
,
16
6
,
166
,
166
,
167
,
168
,
168
,
168
,
169
,
169
,
169
,
17
0
,
171
,
172
,
172
,
174
,
174
,
177
,
178
,
179
,
180
,
18
1
,
182
,
182
}
;
static
yyconst
int
yy_ec
[
256
]
=
...
...
@@ -368,79 +368,79 @@ static yyconst int yy_meta[22] =
12
}
;
static
yyconst
short
int
yy_base
[
15
3
]
=
static
yyconst
short
int
yy_base
[
15
2
]
=
{
0
,
0
,
0
,
36
8
,
361
,
18
,
31
,
350
,
343
,
339
,
338
,
46
,
48
,
18
,
31
,
34
4
,
451
,
451
,
451
,
332
,
451
,
58
,
451
,
51
,
12
,
44
,
71
,
23
,
84
,
32
7
,
64
,
102
,
32
9
,
0
,
61
,
0
,
110
,
67
,
0
,
0
,
451
,
0
,
68
,
451
,
75
,
451
,
0
,
81
,
328
,
247
,
78
,
0
,
0
,
36
1
,
348
,
18
,
31
,
343
,
341
,
338
,
337
,
46
,
48
,
18
,
31
,
34
3
,
451
,
451
,
451
,
331
,
451
,
58
,
451
,
51
,
12
,
44
,
71
,
23
,
84
,
32
1
,
64
,
102
,
32
8
,
0
,
61
,
0
,
110
,
67
,
0
,
0
,
451
,
0
,
68
,
451
,
75
,
451
,
0
,
81
,
0
,
247
,
78
,
91
,
31
,
242
,
67
,
234
,
126
,
228
,
0
,
146
,
162
,
85
,
104
,
0
,
226
,
140
,
222
,
150
,
0
,
211
,
451
,
451
,
0
,
98
,
115
,
0
,
0
,
99
,
174
,
153
,
0
,
0
,
108
,
156
,
167
,
0
,
177
,
179
,
451
,
451
,
451
,
451
,
451
,
153
,
451
,
183
,
451
,
196
,
162
,
0
,
211
,
0
,
174
,
155
,
219
,
111
,
189
,
451
,
0
,
77
,
196
,
451
,
214
,
217
,
451
,
188
,
224
,
234
,
451
,
236
,
242
,
451
,
0
,
451
,
54
,
51
,
195
,
244
,
21
,
248
,
250
,
25
2
,
258
,
451
,
261
,
273
,
285
,
297
,
309
,
321
,
330
,
3
38
,
349
,
361
,
370
,
379
,
391
,
403
,
414
,
426
,
431
,
43
5
,
43
9
451
,
153
,
451
,
183
,
451
,
196
,
162
,
0
,
211
,
0
,
174
,
155
,
219
,
111
,
189
,
451
,
0
,
77
,
196
,
451
,
214
,
217
,
451
,
188
,
224
,
234
,
451
,
236
,
242
,
451
,
0
,
451
,
54
,
51
,
195
,
244
,
21
,
248
,
250
,
252
,
25
8
,
451
,
261
,
273
,
285
,
297
,
309
,
321
,
330
,
338
,
3
49
,
361
,
370
,
379
,
391
,
403
,
414
,
426
,
431
,
435
,
439
}
;
static
yyconst
short
int
yy_def
[
15
3
]
=
static
yyconst
short
int
yy_def
[
15
2
]
=
{
0
,
13
3
,
1
,
134
,
134
,
135
,
135
,
136
,
136
,
137
,
137
,
13
8
,
138
,
139
,
139
,
133
,
133
,
133
,
133
,
140
,
133
,
1
40
,
133
,
133
,
21
,
21
,
133
,
24
,
133
,
24
,
141
,
14
1
,
31
,
142
,
133
,
143
,
143
,
144
,
36
,
145
,
133
,
14
6
,
133
,
133
,
133
,
133
,
147
,
133
,
148
,
140
,
140
,
13
3
,
50
,
133
,
133
,
52
,
133
,
133
,
28
,
133
,
149
,
56
,
13
3
,
150
,
59
,
133
,
140
,
133
,
151
,
31
,
133
,
13
3
,
142
,
133
,
133
,
143
,
36
,
144
,
144
,
144
,
145
,
14
6
,
133
,
133
,
133
,
147
,
133
,
133
,
133
,
133
,
133
,
13
3
,
133
,
133
,
133
,
56
,
133
,
95
,
97
,
95
,
133
,
1
52
,
133
,
149
,
149
,
104
,
104
,
133
,
64
,
133
,
64
,
13
3
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
95
,
133
,
133
,
110
,
149
,
104
,
149
,
149
,
149
,
13
3
,
133
,
0
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
13
3
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
13
3
,
133
13
2
,
1
,
133
,
133
,
134
,
134
,
135
,
135
,
136
,
136
,
13
7
,
137
,
138
,
138
,
132
,
132
,
132
,
132
,
139
,
132
,
1
39
,
132
,
132
,
21
,
21
,
132
,
24
,
132
,
24
,
140
,
14
0
,
31
,
141
,
132
,
142
,
142
,
143
,
36
,
144
,
132
,
14
5
,
132
,
132
,
132
,
132
,
146
,
132
,
147
,
139
,
139
,
13
2
,
50
,
132
,
132
,
52
,
132
,
132
,
28
,
132
,
148
,
56
,
13
2
,
149
,
59
,
132
,
139
,
132
,
150
,
31
,
132
,
13
2
,
141
,
132
,
132
,
142
,
36
,
143
,
143
,
143
,
144
,
14
5
,
132
,
132
,
132
,
146
,
132
,
132
,
132
,
132
,
132
,
13
2
,
132
,
132
,
56
,
132
,
94
,
96
,
94
,
132
,
151
,
1
32
,
148
,
148
,
103
,
103
,
132
,
64
,
132
,
64
,
132
,
13
2
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
94
,
132
,
132
,
109
,
148
,
103
,
148
,
148
,
148
,
132
,
13
2
,
0
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
13
2
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
13
2
}
;
static
yyconst
short
int
yy_nxt
[
473
]
=
{
0
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
24
,
25
,
26
,
27
,
28
,
29
,
24
,
30
,
31
,
30
,
32
,
16
,
36
,
55
,
36
,
47
,
13
3
,
37
,
36
,
36
,
126
,
16
,
36
,
55
,
36
,
47
,
13
2
,
37
,
36
,
36
,
125
,
38
,
60
,
36
,
36
,
36
,
61
,
36
,
47
,
48
,
37
,
36
,
36
,
9
2
,
38
,
93
,
36
,
36
,
44
,
44
,
44
,
36
,
36
,
9
1
,
38
,
92
,
36
,
36
,
44
,
44
,
44
,
44
,
48
,
51
,
51
,
56
,
57
,
45
,
58
,
45
,
51
,
51
,
54
,
73
,
74
,
12
5
,
67
,
67
,
125
,
52
,
82
,
83
,
53
,
51
,
51
,
68
,
77
,
84
,
84
,
9
4
,
79
,
9
4
,
54
,
86
,
87
,
59
,
62
,
62
,
88
,
50
,
91
,
1
10
,
91
,
51
,
51
,
63
,
64
,
95
,
58
,
95
,
73
,
51
,
54
,
73
,
74
,
12
4
,
67
,
67
,
124
,
52
,
82
,
83
,
53
,
51
,
51
,
68
,
77
,
84
,
84
,
9
3
,
79
,
9
3
,
54
,
86
,
87
,
59
,
62
,
62
,
88
,
50
,
90
,
1
09
,
90
,
51
,
51
,
63
,
64
,
94
,
58
,
94
,
73
,
74
,
54
,
65
,
67
,
67
,
62
,
62
,
77
,
70
,
82
,
83
,
79
,
68
,
76
,
63
,
76
,
11
2
,
113
,
77
,
76
,
76
,
11
4
,
76
,
127
,
76
,
76
,
95
,
95
,
96
,
97
,
9
5
,
97
,
95
,
95
,
97
,
97
,
98
,
99
,
97
,
99
,
9
7
,
97
,
95
,
95
,
95
,
95
,
95
,
100
,
100
,
109
,
10
9
,
67
,
67
,
110
,
115
,
115
,
101
,
116
,
117
,
59
,
68
,
77
,
11
8
,
126
,
102
,
104
,
53
,
104
,
84
,
84
,
10
5
,
104
,
106
,
122
,
104
,
122
,
104
,
104
,
86
,
87
,
11
9
,
120
,
77
,
124
,
124
,
121
,
95
,
125
,
95
,
115
,
11
5
,
95
,
95
,
95
,
95
,
95
,
95
,
95
,
95
,
97
,
12
8
,
97
,
128
,
126
,
97
,
97
,
98
,
129
,
97
,
110
,
9
7
,
97
,
100
,
100
,
133
,
112
,
113
,
133
,
112
,
113
,
11
4
,
101
,
104
,
114
,
104
,
116
,
117
,
105
,
104
,
106
,
11
8
,
104
,
50
,
104
,
104
,
116
,
117
,
119
,
120
,
108
,
11
8
,
59
,
121
,
119
,
120
,
130
,
131
,
92
,
121
,
130
,
13
1
,
130
,
131
,
132
,
131
,
53
,
126
,
50
,
126
,
132
,
13
1
,
33
,
33
,
33
,
33
,
33
,
33
,
33
,
33
,
33
,
83
,
79
,
68
,
76
,
63
,
76
,
11
1
,
112
,
77
,
76
,
76
,
11
3
,
76
,
126
,
76
,
76
,
94
,
94
,
95
,
96
,
9
4
,
96
,
94
,
94
,
96
,
96
,
97
,
98
,
96
,
98
,
9
6
,
96
,
94
,
94
,
94
,
94
,
94
,
99
,
99
,
108
,
10
8
,
67
,
67
,
109
,
114
,
114
,
100
,
115
,
116
,
59
,
68
,
77
,
11
7
,
125
,
101
,
103
,
53
,
103
,
84
,
84
,
10
4
,
103
,
105
,
121
,
103
,
121
,
103
,
103
,
86
,
87
,
11
8
,
119
,
77
,
123
,
123
,
120
,
94
,
124
,
94
,
114
,
11
4
,
94
,
94
,
94
,
94
,
94
,
94
,
94
,
94
,
96
,
12
7
,
96
,
127
,
125
,
96
,
96
,
97
,
128
,
96
,
109
,
9
6
,
96
,
99
,
99
,
132
,
111
,
112
,
132
,
111
,
112
,
11
3
,
100
,
103
,
113
,
103
,
115
,
116
,
104
,
103
,
105
,
11
7
,
103
,
50
,
103
,
103
,
115
,
116
,
118
,
119
,
107
,
11
7
,
59
,
120
,
118
,
119
,
129
,
130
,
91
,
120
,
129
,
13
0
,
129
,
130
,
131
,
130
,
53
,
125
,
50
,
125
,
131
,
13
0
,
33
,
33
,
33
,
33
,
33
,
33
,
33
,
33
,
33
,
33
,
33
,
33
,
35
,
35
,
35
,
35
,
35
,
35
,
35
,
35
,
35
,
35
,
35
,
35
,
39
,
39
,
39
,
39
,
39
,
39
,
39
,
39
,
39
,
39
,
39
,
39
,
41
,
41
,
41
,
...
...
@@ -448,78 +448,78 @@ static yyconst short int yy_nxt[473] =
41
,
41
,
41
,
41
,
41
,
41
,
41
,
41
,
41
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
43
,
46
,
46
,
46
,
46
,
46
,
46
,
46
,
46
,
46
,
46
,
46
,
46
,
49
,
90
,
71
,
49
,
49
,
49
,
69
,
69
,
66
,
50
,
133
,
42
,
42
,
69
,
40
,
69
,
72
,
72
,
72
,
72
,
72
,
40
,
72
,
72
,
72
,
72
,
72
,
46
,
46
,
46
,
49
,
71
,
66
,
49
,
49
,
49
,
69
,
69
,
50
,
132
,
42
,
42
,
40
,
69
,
40
,
69
,
72
,
72
,
72
,
72
,
72
,
34
,
72
,
72
,
72
,
72
,
72
,
72
,
75
,
75
,
75
,
75
,
75
,
75
,
34
,
75
,
75
,
75
,
75
,
75
,
78
,
34
,
133
,
78
,
78
,
78
,
80
,
80
,
80
,
80
,
13
3
,
80
,
80
,
80
,
80
,
80
,
80
,
80
,
81
,
81
,
81
,
81
,
81
,
13
3
,
81
,
81
,
81
,
75
,
75
,
75
,
78
,
132
,
132
,
78
,
78
,
78
,
80
,
80
,
80
,
80
,
13
2
,
80
,
80
,
80
,
80
,
80
,
80
,
80
,
81
,
81
,
81
,
81
,
81
,
13
2
,
81
,
81
,
81
,
81
,
81
,
81
,
85
,
85
,
85
,
85
,
85
,
13
3
,
85
,
81
,
81
,
81
,
85
,
85
,
85
,
85
,
85
,
13
2
,
85
,
85
,
85
,
85
,
85
,
89
,
89
,
89
,
89
,
89
,
89
,
89
,
89
,
89
,
89
,
89
,
89
,
10
3
,
103
,
133
,
103
,
10
3
,
103
,
103
,
103
,
103
,
103
,
103
,
103
,
107
,
107
,
10
7
,
107
,
111
,
111
,
111
,
111
,
123
,
123
,
123
,
123
,
15
,
13
3
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
13
3
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
13
3
,
133
89
,
89
,
89
,
89
,
89
,
89
,
10
2
,
102
,
132
,
102
,
10
2
,
102
,
102
,
102
,
102
,
102
,
102
,
102
,
106
,
106
,
10
6
,
106
,
110
,
110
,
110
,
110
,
122
,
122
,
122
,
122
,
15
,
13
2
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
13
2
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
13
2
,
132
}
;
static
yyconst
short
int
yy_chk
[
473
]
=
{
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
5
,
24
,
5
,
13
,
24
,
5
,
5
,
5
,
12
8
,
1
,
5
,
24
,
5
,
13
,
24
,
5
,
5
,
5
,
12
7
,
5
,
27
,
5
,
5
,
6
,
27
,
6
,
14
,
13
,
6
,
6
,
6
,
52
,
6
,
52
,
6
,
6
,
11
,
11
,
12
,
12
,
14
,
23
,
23
,
25
,
25
,
11
,
25
,
12
,
21
,
21
,
23
,
34
,
34
,
12
5
,
30
,
30
,
124
,
21
,
42
,
21
,
23
,
34
,
34
,
12
4
,
30
,
30
,
123
,
21
,
42
,
42
,
21
,
26
,
26
,
30
,
37
,
44
,
44
,
54
,
37
,
54
,
26
,
47
,
47
,
26
,
28
,
28
,
47
,
50
,
50
,
10
9
,
50
,
51
,
51
,
28
,
28
,
61
,
28
,
61
,
73
,
10
8
,
50
,
51
,
51
,
28
,
28
,
61
,
28
,
61
,
73
,
73
,
51
,
28
,
31
,
31
,
62
,
62
,
77
,
31
,
82
,
82
,
77
,
31
,
36
,
62
,
36
,
74
,
74
,
36
,
36
,
36
,
74
,
36
,
10
5
,
36
,
36
,
56
,
56
,
56
,
56
,
36
,
74
,
36
,
10
4
,
36
,
36
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
56
,
59
,
59
,
65
,
65
,
67
,
67
,
65
,
79
,
79
,
59
,
83
,
83
,
59
,
67
,
79
,
83
,
10
3
,
59
,
60
,
93
,
60
,
84
,
84
,
60
,
60
,
60
,
9
8
,
60
,
98
,
60
,
60
,
86
,
86
,
87
,
87
,
78
,
10
2
,
102
,
87
,
95
,
102
,
95
,
115
,
11
5
,
95
,
95
,
95
,
95
,
95
,
95
,
95
,
95
,
97
,
10
6
,
97
,
106
,
126
,
97
,
97
,
97
,
126
,
97
,
110
,
9
7
,
97
,
100
,
100
,
110
,
112
,
112
,
69
,
113
,
113
,
11
2
,
100
,
104
,
113
,
104
,
116
,
116
,
104
,
104
,
104
,
11
6
,
104
,
66
,
104
,
104
,
117
,
117
,
119
,
119
,
64
,
11
7
,
57
,
119
,
120
,
120
,
127
,
127
,
55
,
120
,
129
,
12
9
,
130
,
130
,
131
,
131
,
53
,
129
,
49
,
130
,
132
,
13
2
,
134
,
134
,
134
,
134
,
134
,
134
,
134
,
134
,
134
,
13
4
,
134
,
134
,
135
,
135
,
135
,
135
,
135
,
135
,
135
,
13
5
,
135
,
135
,
135
,
135
,
136
,
136
,
136
,
136
,
136
,
13
6
,
136
,
136
,
136
,
136
,
136
,
136
,
137
,
137
,
137
,
13
7
,
137
,
137
,
137
,
137
,
137
,
137
,
137
,
137
,
138
,
13
8
,
138
,
138
,
138
,
138
,
138
,
138
,
138
,
138
,
138
,
13
8
,
139
,
139
,
139
,
139
,
139
,
139
,
139
,
139
,
139
,
13
9
,
139
,
139
,
140
,
48
,
32
,
140
,
140
,
140
,
141
,
14
1
,
29
,
19
,
15
,
10
,
9
,
141
,
8
,
141
,
142
,
14
2
,
142
,
142
,
142
,
7
,
142
,
142
,
142
,
142
,
142
,
14
2
,
143
,
143
,
143
,
143
,
143
,
143
,
4
,
143
,
143
,
14
3
,
143
,
143
,
144
,
3
,
0
,
144
,
144
,
144
,
145
,
14
5
,
145
,
145
,
0
,
145
,
145
,
145
,
145
,
145
,
145
,
14
5
,
146
,
146
,
146
,
146
,
146
,
0
,
146
,
146
,
146
,
14
6
,
146
,
146
,
147
,
147
,
147
,
147
,
147
,
0
,
147
,
14
7
,
147
,
147
,
147
,
148
,
148
,
148
,
148
,
148
,
148
,
14
8
,
148
,
148
,
148
,
148
,
148
,
149
,
149
,
0
,
149
,
14
9
,
149
,
149
,
149
,
149
,
149
,
149
,
149
,
150
,
150
,
1
50
,
150
,
151
,
151
,
151
,
151
,
152
,
152
,
152
,
152
,
13
3
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
13
3
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
13
3
,
133
67
,
79
,
83
,
10
2
,
59
,
60
,
92
,
60
,
84
,
84
,
60
,
60
,
60
,
9
7
,
60
,
97
,
60
,
60
,
86
,
86
,
87
,
87
,
78
,
10
1
,
101
,
87
,
94
,
101
,
94
,
114
,
11
4
,
94
,
94
,
94
,
94
,
94
,
94
,
94
,
94
,
96
,
10
5
,
96
,
105
,
125
,
96
,
96
,
96
,
125
,
96
,
109
,
9
6
,
96
,
99
,
99
,
109
,
111
,
111
,
69
,
112
,
112
,
11
1
,
99
,
103
,
112
,
103
,
115
,
115
,
103
,
103
,
103
,
11
5
,
103
,
66
,
103
,
103
,
116
,
116
,
118
,
118
,
64
,
11
6
,
57
,
118
,
119
,
119
,
126
,
126
,
55
,
119
,
128
,
12
8
,
129
,
129
,
130
,
130
,
53
,
128
,
49
,
129
,
131
,
13
1
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
133
,
13
3
,
133
,
133
,
134
,
134
,
134
,
134
,
134
,
134
,
134
,
13
4
,
134
,
134
,
134
,
134
,
135
,
135
,
135
,
135
,
135
,
13
5
,
135
,
135
,
135
,
135
,
135
,
135
,
136
,
136
,
136
,
13
6
,
136
,
136
,
136
,
136
,
136
,
136
,
136
,
136
,
137
,
13
7
,
137
,
137
,
137
,
137
,
137
,
137
,
137
,
137
,
137
,
13
7
,
138
,
138
,
138
,
138
,
138
,
138
,
138
,
138
,
138
,
13
8
,
138
,
138
,
139
,
32
,
29
,
139
,
139
,
139
,
140
,
14
0
,
19
,
15
,
10
,
9
,
8
,
140
,
7
,
140
,
141
,
14
1
,
141
,
141
,
141
,
4
,
141
,
141
,
141
,
141
,
141
,
14
1
,
142
,
142
,
142
,
142
,
142
,
142
,
3
,
142
,
142
,
14
2
,
142
,
142
,
143
,
0
,
0
,
143
,
143
,
143
,
144
,
14
4
,
144
,
144
,
0
,
144
,
144
,
144
,
144
,
144
,
144
,
14
4
,
145
,
145
,
145
,
145
,
145
,
0
,
145
,
145
,
145
,
14
5
,
145
,
145
,
146
,
146
,
146
,
146
,
146
,
0
,
146
,
14
6
,
146
,
146
,
146
,
147
,
147
,
147
,
147
,
147
,
147
,
14
7
,
147
,
147
,
147
,
147
,
147
,
148
,
148
,
0
,
148
,
14
8
,
148
,
148
,
148
,
148
,
148
,
148
,
148
,
149
,
149
,
1
49
,
149
,
150
,
150
,
150
,
150
,
151
,
151
,
151
,
151
,
13
2
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
13
2
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
132
,
13
2
,
132
}
;
static
yy_state_type
yy_state_buf
[
YY_BUF_SIZE
+
2
],
*
yy_state_ptr
;
...
...
@@ -556,7 +556,7 @@ char *yytext;
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.3
2 1998/12/18 19:45:36 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.3
3 1999/02/07 23:58:52 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -649,6 +649,8 @@ char literal[MAX_PARSE_BUFFER];
/* Extended quote
* xqdouble implements SQL92 embedded quote
* xqcat allows strings to cross input lines
* Note: reduction of '' and \ sequences to output text is done in scanstr(),
* not by rules here.
*/
/* Delimited quote
* Allows embedded spaces and other special characters into identifiers.
...
...
@@ -671,7 +673,7 @@ real [\-]?{digit}+\.{digit}+([Ee][-+]?{digit}+)?
* Other embedded escaped characters are matched explicitly and the leading
* backslash is dropped from the string. - thomas 1997-09-24
*/
#line 67
5
"lex.yy.c"
#line 67
7
"lex.yy.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
...
...
@@ -822,9 +824,9 @@ YY_DECL
register
char
*
yy_cp
,
*
yy_bp
;
register
int
yy_act
;
#line 1
79
"scan.l"
#line 1
80
"scan.l"
#line 8
28
"lex.yy.c"
#line 8
30
"lex.yy.c"
if
(
yy_init
)
{
...
...
@@ -872,7 +874,7 @@ 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
>=
13
4
)
if
(
yy_current_state
>=
13
3
)
yy_c
=
yy_meta
[(
unsigned
int
)
yy_c
];
}
yy_current_state
=
yy_nxt
[
yy_base
[
yy_current_state
]
+
(
unsigned
int
)
yy_c
];
...
...
@@ -930,34 +932,34 @@ do_action: /* This label is used only to access EOF actions. */
{
/* beginning of action switch */
case
1
:
YY_RULE_SETUP
#line 18
0
"scan.l"
#line 18
1
"scan.l"
{
/* ignore */
}
YY_BREAK
case
2
:
YY_RULE_SETUP
#line 18
2
"scan.l"
#line 18
3
"scan.l"
{
/* ignore */
}
YY_BREAK
case
3
:
#line 18
5
"scan.l"
#line 18
6
"scan.l"
case
4
:
YY_RULE_SETUP
#line 18
5
"scan.l"
#line 18
6
"scan.l"
{
BEGIN
(
xc
);
}
YY_BREAK
case
5
:
YY_RULE_SETUP
#line 18
7
"scan.l"
#line 18
8
"scan.l"
{
BEGIN
(
INITIAL
);
}
YY_BREAK
case
6
:
YY_RULE_SETUP
#line 1
89
"scan.l"
#line 1
90
"scan.l"
{
/* ignore */
}
YY_BREAK
case
7
:
YY_RULE_SETUP
#line 19
1
"scan.l"
#line 19
2
"scan.l"
{
BEGIN
(
xb
);
llen
=
0
;
...
...
@@ -966,7 +968,7 @@ YY_RULE_SETUP
YY_BREAK
case
8
:
YY_RULE_SETUP
#line 19
6
"scan.l"
#line 19
7
"scan.l"
{
char
*
endptr
;
...
...
@@ -979,10 +981,10 @@ YY_RULE_SETUP
}
YY_BREAK
case
9
:
#line 20
7
"scan.l"
#line 20
8
"scan.l"
case
10
:
YY_RULE_SETUP
#line 20
7
"scan.l"
#line 20
8
"scan.l"
{
if
((
llen
+
yyleng
)
>
(
MAX_PARSE_BUFFER
-
1
))
elog
(
ERROR
,
"quoted string parse buffer of %d chars exceeded"
,
MAX_PARSE_BUFFER
);
...
...
@@ -991,16 +993,16 @@ YY_RULE_SETUP
}
YY_BREAK
case
11
:
#line 21
4
"scan.l"
#line 21
5
"scan.l"
case
12
:
YY_RULE_SETUP
#line 21
4
"scan.l"
#line 21
5
"scan.l"
{
}
YY_BREAK
case
13
:
YY_RULE_SETUP
#line 21
7
"scan.l"
#line 21
8
"scan.l"
{
BEGIN
(
xh
);
llen
=
0
;
...
...
@@ -1009,7 +1011,7 @@ YY_RULE_SETUP
YY_BREAK
case
14
:
YY_RULE_SETUP
#line 22
2
"scan.l"
#line 22
3
"scan.l"
{
char
*
endptr
;
...
...
@@ -1023,7 +1025,7 @@ YY_RULE_SETUP
YY_BREAK
case
15
:
YY_RULE_SETUP
#line 23
3
"scan.l"
#line 23
4
"scan.l"
{
BEGIN
(
xq
);
llen
=
0
;
...
...
@@ -1032,7 +1034,7 @@ YY_RULE_SETUP
YY_BREAK
case
16
:
YY_RULE_SETUP
#line 23
8
"scan.l"
#line 23
9
"scan.l"
{
BEGIN
(
INITIAL
);
yylval
.
str
=
pstrdup
(
scanstr
(
literal
));
...
...
@@ -1040,65 +1042,46 @@ YY_RULE_SETUP
}
YY_BREAK
case
17
:
#line 24
4
"scan.l"
#line 24
5
"scan.l"
case
18
:
YY_RULE_SETUP
#line 244 "scan.l"
{
if
((
llen
+
yyleng
)
>
(
MAX_PARSE_BUFFER
-
1
))
elog
(
ERROR
,
"quoted string parse buffer of %d chars exceeded"
,
MAX_PARSE_BUFFER
);
memcpy
(
literal
+
llen
,
yytext
,
yyleng
+
1
);
llen
+=
yyleng
;
}
YY_BREAK
#line 246 "scan.l"
case
19
:
YY_RULE_SETUP
#line 2
50
"scan.l"
#line 2
46
"scan.l"
{
if
((
llen
+
yyleng
-
1
)
>
(
MAX_PARSE_BUFFER
-
1
))
if
((
llen
+
yyleng
)
>
(
MAX_PARSE_BUFFER
-
1
))
elog
(
ERROR
,
"quoted string parse buffer of %d chars exceeded"
,
MAX_PARSE_BUFFER
);
memcpy
(
literal
+
llen
,
yytext
,
yyleng
+
1
);
*
(
literal
+
llen
)
=
'\''
;
llen
+=
yyleng
;
}
YY_BREAK
case
20
:
YY_RULE_SETUP
#line 25
8
"scan.l"
#line 25
2
"scan.l"
{
if
((
llen
+
yyleng
-
1
)
>
(
MAX_PARSE_BUFFER
-
1
))
elog
(
ERROR
,
"quoted string parse buffer of %d chars exceeded"
,
MAX_PARSE_BUFFER
);
memcpy
(
literal
+
llen
,
yytext
,
yyleng
+
1
);
llen
+=
yyleng
;
}
YY_BREAK
case
21
:
YY_RULE_SETUP
#line 264 "scan.l"
{
}
YY_BREAK
case
22
:
YY_RULE_SETUP
#line 268 "scan.l"
#line 256 "scan.l"
{
BEGIN
(
xd
);
llen
=
0
;
*
literal
=
'\0'
;
}
YY_BREAK
case
2
3
:
case
2
2
:
YY_RULE_SETUP
#line 2
73
"scan.l"
#line 2
61
"scan.l"
{
BEGIN
(
INITIAL
);
yylval
.
str
=
pstrdup
(
literal
);
return
IDENT
;
}
YY_BREAK
case
2
4
:
case
2
3
:
YY_RULE_SETUP
#line 2
78
"scan.l"
#line 2
66
"scan.l"
{
if
((
llen
+
yyleng
)
>
(
MAX_PARSE_BUFFER
-
1
))
elog
(
ERROR
,
"quoted string parse buffer of %d chars exceeded"
,
MAX_PARSE_BUFFER
);
...
...
@@ -1106,59 +1089,59 @@ YY_RULE_SETUP
llen
+=
yyleng
;
}
YY_BREAK
case
2
5
:
case
2
4
:
YY_RULE_SETUP
#line 2
86
"scan.l"
#line 2
74
"scan.l"
{
/* ignore */
}
YY_BREAK
case
2
6
:
case
2
5
:
YY_RULE_SETUP
#line 2
87
"scan.l"
#line 2
75
"scan.l"
{
BEGIN
(
INITIAL
);
return
yytext
[
0
];
}
YY_BREAK
case
2
7
:
case
2
6
:
YY_RULE_SETUP
#line 2
93
"scan.l"
#line 2
81
"scan.l"
{
return
TYPECAST
;
}
YY_BREAK
case
2
8
:
case
2
7
:
*
yy_cp
=
yy_hold_char
;
/* undo effects of setting up yytext */
yy_c_buf_p
=
yy_cp
=
yy_bp
+
1
;
YY_DO_BEFORE_ACTION
;
/* set up yytext again */
YY_RULE_SETUP
#line 2
95
"scan.l"
#line 2
83
"scan.l"
{
BEGIN
(
xm
);
return
yytext
[
0
];
}
YY_BREAK
case
2
9
:
case
2
8
:
YY_RULE_SETUP
#line 2
99
"scan.l"
#line 2
87
"scan.l"
{
return
yytext
[
0
];
}
YY_BREAK
case
30
:
case
29
:
YY_RULE_SETUP
#line
300
"scan.l"
#line
288
"scan.l"
{
return
yytext
[
0
];
}
YY_BREAK
case
3
1
:
case
3
0
:
*
yy_cp
=
yy_hold_char
;
/* undo effects of setting up yytext */
yy_c_buf_p
=
yy_cp
-=
2
;
YY_DO_BEFORE_ACTION
;
/* set up yytext again */
YY_RULE_SETUP
#line
301
"scan.l"
#line
289
"scan.l"
{
yylval
.
str
=
pstrdup
((
char
*
)
yytext
);
return
Op
;
}
YY_BREAK
case
3
2
:
case
3
1
:
YY_RULE_SETUP
#line
305
"scan.l"
#line
293
"scan.l"
{
if
(
strcmp
((
char
*
)
yytext
,
"!="
)
==
0
)
yylval
.
str
=
pstrdup
(
"<>"
);
/* compatability */
...
...
@@ -1167,17 +1150,17 @@ YY_RULE_SETUP
return
Op
;
}
YY_BREAK
case
3
3
:
case
3
2
:
YY_RULE_SETUP
#line 3
12
"scan.l"
#line 3
00
"scan.l"
{
yylval
.
ival
=
atoi
((
char
*
)
&
yytext
[
1
]);
return
PARAM
;
}
YY_BREAK
case
3
4
:
case
3
3
:
YY_RULE_SETUP
#line 3
18
"scan.l"
#line 3
06
"scan.l"
{
int
i
;
ScanKeyword
*
keyword
;
...
...
@@ -1201,9 +1184,9 @@ YY_RULE_SETUP
}
}
YY_BREAK
case
3
5
:
case
3
4
:
YY_RULE_SETUP
#line 3
40
"scan.l"
#line 3
28
"scan.l"
{
char
*
endptr
;
...
...
@@ -1223,9 +1206,9 @@ YY_RULE_SETUP
return
ICONST
;
}
YY_BREAK
case
3
6
:
case
3
5
:
YY_RULE_SETUP
#line 3
58
"scan.l"
#line 3
46
"scan.l"
{
char
*
endptr
;
...
...
@@ -1238,9 +1221,9 @@ YY_RULE_SETUP
return
FCONST
;
}
YY_BREAK
case
3
7
:
case
3
6
:
YY_RULE_SETUP
#line 3
69
"scan.l"
#line 3
57
"scan.l"
{
char
*
endptr
;
...
...
@@ -1259,9 +1242,9 @@ YY_RULE_SETUP
return
ICONST
;
}
YY_BREAK
case
3
8
:
case
3
7
:
YY_RULE_SETUP
#line 3
86
"scan.l"
#line 3
74
"scan.l"
{
char
*
endptr
;
...
...
@@ -1273,9 +1256,9 @@ YY_RULE_SETUP
return
FCONST
;
}
YY_BREAK
case
3
9
:
case
3
8
:
YY_RULE_SETUP
#line 3
98
"scan.l"
#line 3
86
"scan.l"
{
int
i
;
ScanKeyword
*
keyword
;
...
...
@@ -1298,22 +1281,22 @@ YY_RULE_SETUP
}
}
YY_BREAK
case
40
:
case
39
:
YY_RULE_SETUP
#line 4
19
"scan.l"
#line 4
07
"scan.l"
{
/* ignore */
}
YY_BREAK
case
4
1
:
case
4
0
:
YY_RULE_SETUP
#line 4
21
"scan.l"
#line 4
09
"scan.l"
{
return
yytext
[
0
];
}
YY_BREAK
case
4
2
:
case
4
1
:
YY_RULE_SETUP
#line 4
23
"scan.l"
#line 4
11
"scan.l"
ECHO
;
YY_BREAK
#line 13
17
"lex.yy.c"
#line 13
00
"lex.yy.c"
case
YY_STATE_EOF
(
INITIAL
):
case
YY_STATE_EOF
(
xb
):
case
YY_STATE_EOF
(
xc
):
...
...
@@ -1608,7 +1591,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
>=
13
4
)
if
(
yy_current_state
>=
13
3
)
yy_c
=
yy_meta
[(
unsigned
int
)
yy_c
];
}
yy_current_state
=
yy_nxt
[
yy_base
[
yy_current_state
]
+
(
unsigned
int
)
yy_c
];
...
...
@@ -1638,11 +1621,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
>=
13
4
)
if
(
yy_current_state
>=
13
3
)
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
==
13
3
);
yy_is_jam
=
(
yy_current_state
==
13
2
);
if
(
!
yy_is_jam
)
*
yy_state_ptr
++
=
yy_current_state
;
...
...
@@ -2199,7 +2182,7 @@ int main()
return
0
;
}
#endif
#line 4
23
"scan.l"
#line 4
11
"scan.l"
void
yyerror
(
char
message
[])
...
...
src/backend/parser/scan.l
View file @
f7c6a88c
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.4
4 1998/10/08 18:29:51 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.4
5 1999/02/07 23:58:10 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -108,13 +108,14 @@ xhcat {quote}{space}*\n{space}*{quote}
/* Extended quote
* xqdouble implements SQL92 embedded quote
* xqcat allows strings to cross input lines
* Note: reduction of '' and \ sequences to output text is done in scanstr(),
* not by rules here.
*/
quote '
xqstart {quote}
xqstop {quote}
xqdouble {quote}{quote}
xqinside [^\\']*
xqembedded "\\'"
xqliteral [\\](.|\n)
xqcat {quote}{space}*\n{space}*{quote}
...
...
@@ -241,22 +242,9 @@ other .
return SCONST;
}
<xq>{xqdouble} |
<xq>{xqinside} {
if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1))
elog(ERROR,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
memcpy(literal+llen, yytext, yyleng+1);
llen += yyleng;
}
<xq>{xqembedded} {
if ((llen+yyleng-1) > (MAX_PARSE_BUFFER - 1))
elog(ERROR,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
memcpy(literal+llen, yytext, yyleng+1);
*(literal+llen) = '\'';
llen += yyleng;
}
<xq>{xqinside} |
<xq>{xqliteral} {
if ((llen+yyleng
-1
) > (MAX_PARSE_BUFFER - 1))
if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1))
elog(ERROR,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
memcpy(literal+llen, yytext, yyleng+1);
llen += yyleng;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment