sql-parser 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sql-parser.rb +4 -4
- data/lib/sql-parser/parser.racc +76 -76
- data/lib/sql-parser/parser.racc.rb +76 -76
- data/lib/sql-parser/version.rb +1 -1
- metadata +1 -1
data/lib/sql-parser.rb
CHANGED
@@ -5,9 +5,9 @@ module SQLParser
|
|
5
5
|
|
6
6
|
require 'racc/parser'
|
7
7
|
|
8
|
-
require_relative 'sql/version'
|
9
|
-
require_relative 'sql/statement'
|
10
|
-
require_relative 'sql/sql_visitor'
|
11
|
-
require_relative 'sql/parser.racc.rb'
|
8
|
+
require_relative 'sql-parser/version'
|
9
|
+
require_relative 'sql-parser/statement'
|
10
|
+
require_relative 'sql-parser/sql_visitor'
|
11
|
+
require_relative 'sql-parser/parser.racc.rb'
|
12
12
|
|
13
13
|
end
|
data/lib/sql-parser/parser.racc
CHANGED
@@ -9,12 +9,12 @@ rule
|
|
9
9
|
: direct_select_statement_multiple_rows
|
10
10
|
|
11
11
|
direct_select_statement_multiple_rows
|
12
|
-
: query_expression order_by_clause { result =
|
12
|
+
: query_expression order_by_clause { result = SQLParser::Statement::DirectSelect.new(val[0], val[1]) }
|
13
13
|
|
14
14
|
# module contents
|
15
15
|
order_by_clause
|
16
16
|
: # no action
|
17
|
-
| ORDER BY sort_specification_list { result =
|
17
|
+
| ORDER BY sort_specification_list { result = SQLParser::Statement::OrderBy.new(val[2]) }
|
18
18
|
|
19
19
|
sort_specification_list
|
20
20
|
: sort_specification_list comma sort_specification { result = Array(val[0]) + Array(val[2]) }
|
@@ -25,47 +25,47 @@ rule
|
|
25
25
|
|
26
26
|
sort_key
|
27
27
|
: column_name
|
28
|
-
| unsigned_integer { result =
|
28
|
+
| unsigned_integer { result = SQLParser::Statement::Integer.new(val[0]) }
|
29
29
|
|
30
30
|
ordering_specification
|
31
|
-
: { result =
|
32
|
-
| ASC { result =
|
33
|
-
| DESC { result =
|
31
|
+
: { result = SQLParser::Statement::Ascending } # default
|
32
|
+
| ASC { result = SQLParser::Statement::Ascending }
|
33
|
+
| DESC { result = SQLParser::Statement::Descending }
|
34
34
|
|
35
35
|
# queries
|
36
36
|
subquery
|
37
37
|
# FIXME: shortcut
|
38
|
-
: left_paren query_expression right_paren { result =
|
38
|
+
: left_paren query_expression right_paren { result = SQLParser::Statement::Subquery.new(val[1]) }
|
39
39
|
|
40
40
|
query_expression
|
41
41
|
: query_specification
|
42
42
|
|
43
43
|
query_specification
|
44
|
-
: SELECT select_list table_expression { result =
|
45
|
-
| SELECT select_list { result =
|
44
|
+
: SELECT select_list table_expression { result = SQLParser::Statement::Select.new(val[1], val[2]) }
|
45
|
+
| SELECT select_list { result = SQLParser::Statement::Select.new(val[1]) }
|
46
46
|
|
47
47
|
select_list
|
48
|
-
: asterisk { result =
|
49
|
-
| select_sublist { result =
|
48
|
+
: asterisk { result = SQLParser::Statement::All.new }
|
49
|
+
| select_sublist { result = SQLParser::Statement::SelectList.new(val[0]) }
|
50
50
|
|
51
51
|
select_sublist
|
52
52
|
: derived_column comma select_sublist { result = Array(val[0]) + Array(val[2]) }
|
53
53
|
| derived_column
|
54
54
|
|
55
55
|
derived_column
|
56
|
-
: value_expression AS column_name { result =
|
57
|
-
| value_expression column_name { result =
|
56
|
+
: value_expression AS column_name { result = SQLParser::Statement::As.new(val[0], val[2]) }
|
57
|
+
| value_expression column_name { result = SQLParser::Statement::As.new(val[0], val[1]) }
|
58
58
|
| value_expression
|
59
59
|
|
60
60
|
table_expression
|
61
|
-
: from_clause where_clause group_by_clause having_clause { result =
|
61
|
+
: from_clause where_clause group_by_clause having_clause { result = SQLParser::Statement::TableExpression.new(val[0], val[1], val[2], val[3]) }
|
62
62
|
|
63
63
|
from_clause
|
64
|
-
: FROM table_reference { result =
|
64
|
+
: FROM table_reference { result = SQLParser::Statement::FromClause.new(val[1]) }
|
65
65
|
|
66
66
|
table_reference
|
67
|
-
: table_name AS column_name { result =
|
68
|
-
| table_name column_name { result =
|
67
|
+
: table_name AS column_name { result = SQLParser::Statement::As.new(val[0], val[2]) }
|
68
|
+
| table_name column_name { result = SQLParser::Statement::As.new(val[0], val[1]) }
|
69
69
|
| table_name
|
70
70
|
| joined_table
|
71
71
|
|
@@ -77,41 +77,41 @@ rule
|
|
77
77
|
| qualified_join
|
78
78
|
|
79
79
|
cross_join
|
80
|
-
: table_reference comma table_name { result =
|
81
|
-
| table_reference CROSS JOIN table_name { result =
|
80
|
+
: table_reference comma table_name { result = SQLParser::Statement::CrossJoin.new(val[0], val[2]) }
|
81
|
+
| table_reference CROSS JOIN table_name { result = SQLParser::Statement::CrossJoin.new(val[0], val[3]) }
|
82
82
|
|
83
83
|
qualified_join
|
84
84
|
: table_reference join_type JOIN table_reference join_specification { result = val[1].new(val[0], val[3], val[4]) }
|
85
85
|
|
86
86
|
join_type
|
87
|
-
: INNER { result =
|
88
|
-
| LEFT OUTER { result =
|
89
|
-
| LEFT { result =
|
90
|
-
| RIGHT OUTER { result =
|
91
|
-
| RIGHT { result =
|
92
|
-
| FULL { result =
|
93
|
-
| FULL OUTER { result =
|
87
|
+
: INNER { result = SQLParser::Statement::InnerJoin }
|
88
|
+
| LEFT OUTER { result = SQLParser::Statement::LeftOuterJoin }
|
89
|
+
| LEFT { result = SQLParser::Statement::LeftJoin }
|
90
|
+
| RIGHT OUTER { result = SQLParser::Statement::RightOuterJoin }
|
91
|
+
| RIGHT { result = SQLParser::Statement::RightJoin }
|
92
|
+
| FULL { result = SQLParser::Statement::FullJoin }
|
93
|
+
| FULL OUTER { result = SQLParser::Statement::FullOuterJoin }
|
94
94
|
|
95
95
|
join_specification
|
96
96
|
: join_condition
|
97
97
|
| named_columns_join
|
98
98
|
|
99
99
|
join_condition
|
100
|
-
: ON search_condition { result =
|
100
|
+
: ON search_condition { result = SQLParser::Statement::On.new(val[1]) }
|
101
101
|
|
102
102
|
named_columns_join
|
103
|
-
: USING left_paren join_column_list right_paren { result =
|
103
|
+
: USING left_paren join_column_list right_paren { result = SQLParser::Statement::Using.new(val[2]) }
|
104
104
|
|
105
105
|
join_column_list
|
106
106
|
: column_name_list
|
107
107
|
|
108
108
|
where_clause
|
109
109
|
: # no action
|
110
|
-
| WHERE search_condition { result =
|
110
|
+
| WHERE search_condition { result = SQLParser::Statement::WhereClause.new(val[1]) }
|
111
111
|
|
112
112
|
group_by_clause
|
113
113
|
: # no action
|
114
|
-
| GROUP BY grouping_column_reference_list { result =
|
114
|
+
| GROUP BY grouping_column_reference_list { result = SQLParser::Statement::GroupByClause.new(val[2]) }
|
115
115
|
|
116
116
|
grouping_column_reference_list
|
117
117
|
: grouping_column_reference_list comma grouping_column_reference { result = Array(val[0]) + Array(val[2]) }
|
@@ -122,23 +122,23 @@ rule
|
|
122
122
|
|
123
123
|
having_clause
|
124
124
|
: # no action
|
125
|
-
| HAVING search_condition { result =
|
125
|
+
| HAVING search_condition { result = SQLParser::Statement::HavingClause.new(val[1]) }
|
126
126
|
|
127
127
|
# query expression components
|
128
128
|
row_subquery
|
129
129
|
: subquery
|
130
130
|
|
131
131
|
between_predicate
|
132
|
-
: row_value_constructor NOT BETWEEN row_value_constructor AND row_value_constructor { result =
|
133
|
-
| row_value_constructor BETWEEN row_value_constructor AND row_value_constructor { result =
|
132
|
+
: row_value_constructor NOT BETWEEN row_value_constructor AND row_value_constructor { result = SQLParser::Statement::Not.new(SQLParser::Statement::Between.new(val[0], val[3], val[5])) }
|
133
|
+
| row_value_constructor BETWEEN row_value_constructor AND row_value_constructor { result = SQLParser::Statement::Between.new(val[0], val[2], val[4]) }
|
134
134
|
|
135
135
|
in_predicate
|
136
|
-
: row_value_constructor NOT IN in_predicate_value { result =
|
137
|
-
| row_value_constructor IN in_predicate_value { result =
|
136
|
+
: row_value_constructor NOT IN in_predicate_value { result = SQLParser::Statement::Not.new(SQLParser::Statement::In.new(val[0], val[3])) }
|
137
|
+
| row_value_constructor IN in_predicate_value { result = SQLParser::Statement::In.new(val[0], val[2]) }
|
138
138
|
|
139
139
|
in_predicate_value
|
140
140
|
: table_subquery
|
141
|
-
| left_paren in_value_list right_paren { result =
|
141
|
+
| left_paren in_value_list right_paren { result = SQLParser::Statement::InValueList.new(val[1]) }
|
142
142
|
|
143
143
|
in_value_list
|
144
144
|
: value_expression comma in_value_list { result = Array(val[0]) + Array(val[2]) }
|
@@ -148,19 +148,19 @@ rule
|
|
148
148
|
# FIXME: the SQL-92 grammar indicates these should be
|
149
149
|
# character_value_expression nodes, but changing them causes reduce/reduce
|
150
150
|
# conflicts.
|
151
|
-
: row_value_constructor NOT LIKE row_value_constructor { result =
|
152
|
-
| row_value_constructor LIKE row_value_constructor { result =
|
151
|
+
: row_value_constructor NOT LIKE row_value_constructor { result = SQLParser::Statement::Not.new(SQLParser::Statement::Like.new(val[0], val[3])) }
|
152
|
+
| row_value_constructor LIKE row_value_constructor { result = SQLParser::Statement::Like.new(val[0], val[2]) }
|
153
153
|
|
154
154
|
null_predicate
|
155
|
-
: row_value_constructor IS NOT NULL { result =
|
156
|
-
| row_value_constructor IS NULL { result =
|
155
|
+
: row_value_constructor IS NOT NULL { result = SQLParser::Statement::Not.new(SQLParser::Statement::Is.new(val[0], SQLParser::Statement::Null.new)) }
|
156
|
+
| row_value_constructor IS NULL { result = SQLParser::Statement::Is.new(val[0], SQLParser::Statement::Null.new) }
|
157
157
|
|
158
158
|
exists_predicate
|
159
|
-
: EXISTS table_subquery { result =
|
159
|
+
: EXISTS table_subquery { result = SQLParser::Statement::Exists.new(val[1]) }
|
160
160
|
|
161
161
|
# constraints
|
162
162
|
table_name
|
163
|
-
: identifier { result =
|
163
|
+
: identifier { result = SQLParser::Statement::Table.new(val[0]) }
|
164
164
|
|
165
165
|
column_name_list
|
166
166
|
: column_name_list comma column_name { result = Array(val[0]) + Array(val[2]) }
|
@@ -169,14 +169,14 @@ rule
|
|
169
169
|
# search condition
|
170
170
|
search_condition
|
171
171
|
: boolean_term
|
172
|
-
| search_condition OR boolean_term { result =
|
172
|
+
| search_condition OR boolean_term { result = SQLParser::Statement::Or.new(val[0], val[2]) }
|
173
173
|
|
174
174
|
boolean_term
|
175
175
|
: boolean_factor
|
176
|
-
| boolean_term AND boolean_factor { result =
|
176
|
+
| boolean_term AND boolean_factor { result = SQLParser::Statement::And.new(val[0], val[2]) }
|
177
177
|
|
178
178
|
boolean_factor:
|
179
|
-
: NOT boolean_test { result =
|
179
|
+
: NOT boolean_test { result = SQLParser::Statement::Not.new(val[1]) }
|
180
180
|
| boolean_test
|
181
181
|
|
182
182
|
boolean_test
|
@@ -195,12 +195,12 @@ rule
|
|
195
195
|
| exists_predicate
|
196
196
|
|
197
197
|
comparison_predicate
|
198
|
-
: row_value_constructor equals_operator row_value_constructor { result =
|
199
|
-
| row_value_constructor not_equals_operator row_value_constructor { result =
|
200
|
-
| row_value_constructor less_than_operator row_value_constructor { result =
|
201
|
-
| row_value_constructor greater_than_operator row_value_constructor { result =
|
202
|
-
| row_value_constructor less_than_or_equals_operator row_value_constructor { result =
|
203
|
-
| row_value_constructor greater_than_or_equals_operator row_value_constructor { result =
|
198
|
+
: row_value_constructor equals_operator row_value_constructor { result = SQLParser::Statement::Equals.new(val[0], val[2]) }
|
199
|
+
| row_value_constructor not_equals_operator row_value_constructor { result = SQLParser::Statement::Not.new(SQLParser::Statement::Equals.new(val[0], val[2])) }
|
200
|
+
| row_value_constructor less_than_operator row_value_constructor { result = SQLParser::Statement::Less.new(val[0], val[2]) }
|
201
|
+
| row_value_constructor greater_than_operator row_value_constructor { result = SQLParser::Statement::Greater.new(val[0], val[2]) }
|
202
|
+
| row_value_constructor less_than_or_equals_operator row_value_constructor { result = SQLParser::Statement::LessOrEquals.new(val[0], val[2]) }
|
203
|
+
| row_value_constructor greater_than_or_equals_operator row_value_constructor { result = SQLParser::Statement::GreaterOrEquals.new(val[0], val[2]) }
|
204
204
|
|
205
205
|
row_value_constructor
|
206
206
|
: row_value_constructor_element
|
@@ -213,13 +213,13 @@ rule
|
|
213
213
|
: numeric_value_expression
|
214
214
|
|
215
215
|
numeric_value_expression
|
216
|
-
: term plus_sign numeric_value_expression { result =
|
217
|
-
| term minus_sign numeric_value_expression { result =
|
216
|
+
: term plus_sign numeric_value_expression { result = SQLParser::Statement::Add.new(val[0], val[2]) }
|
217
|
+
| term minus_sign numeric_value_expression { result = SQLParser::Statement::Subtract.new(val[0], val[2]) }
|
218
218
|
| term
|
219
219
|
|
220
220
|
term
|
221
|
-
: factor asterisk term { result =
|
222
|
-
| factor solidus term { result =
|
221
|
+
: factor asterisk term { result = SQLParser::Statement::Multiply.new(val[0], val[2]) }
|
222
|
+
| factor solidus term { result = SQLParser::Statement::Divide.new(val[0], val[2]) }
|
223
223
|
| factor
|
224
224
|
|
225
225
|
factor
|
@@ -241,25 +241,25 @@ rule
|
|
241
241
|
| general_literal
|
242
242
|
|
243
243
|
general_value_specification
|
244
|
-
: CURRENT_USER { result =
|
244
|
+
: CURRENT_USER { result = SQLParser::Statement::CurrentUser.new }
|
245
245
|
|
246
246
|
column_reference
|
247
|
-
: qualifier period column_name { result =
|
247
|
+
: qualifier period column_name { result = SQLParser::Statement::QualifiedColumn.new(val[0], val[2]) }
|
248
248
|
| column_name
|
249
249
|
|
250
250
|
qualifier
|
251
251
|
: table_name
|
252
252
|
|
253
253
|
set_function_specification
|
254
|
-
: COUNT left_paren asterisk right_paren { result =
|
254
|
+
: COUNT left_paren asterisk right_paren { result = SQLParser::Statement::Count.new(SQLParser::Statement::All.new) }
|
255
255
|
| general_set_function
|
256
256
|
|
257
257
|
general_set_function
|
258
|
-
: COUNT left_paren value_expression right_paren { result =
|
259
|
-
| AVG left_paren value_expression right_paren { result =
|
260
|
-
| MAX left_paren value_expression right_paren { result =
|
261
|
-
| MIN left_paren value_expression right_paren { result =
|
262
|
-
| SUM left_paren value_expression right_paren { result =
|
258
|
+
: COUNT left_paren value_expression right_paren { result = SQLParser::Statement::Count.new(val[2]) }
|
259
|
+
| AVG left_paren value_expression right_paren { result = SQLParser::Statement::Average.new(val[2]) }
|
260
|
+
| MAX left_paren value_expression right_paren { result = SQLParser::Statement::Maximum.new(val[2]) }
|
261
|
+
| MIN left_paren value_expression right_paren { result = SQLParser::Statement::Minimum.new(val[2]) }
|
262
|
+
| SUM left_paren value_expression right_paren { result = SQLParser::Statement::Sum.new(val[2]) }
|
263
263
|
|
264
264
|
# literal numbers, strings, dates and times
|
265
265
|
unsigned_numeric_literal
|
@@ -267,13 +267,13 @@ rule
|
|
267
267
|
| approximate_numeric_literal
|
268
268
|
|
269
269
|
exact_numeric_literal
|
270
|
-
: unsigned_integer period unsigned_integer { result =
|
271
|
-
| unsigned_integer period { result =
|
272
|
-
| period unsigned_integer { result =
|
273
|
-
| unsigned_integer { result =
|
270
|
+
: unsigned_integer period unsigned_integer { result = SQLParser::Statement::Float.new("#{val[0]}.#{val[2]}".to_f) }
|
271
|
+
| unsigned_integer period { result = SQLParser::Statement::Float.new(val[0]) }
|
272
|
+
| period unsigned_integer { result = SQLParser::Statement::Float.new("0.#{val[1]}".to_f) }
|
273
|
+
| unsigned_integer { result = SQLParser::Statement::Integer.new(val[0]) }
|
274
274
|
|
275
275
|
approximate_numeric_literal
|
276
|
-
: mantissa E exponent { result =
|
276
|
+
: mantissa E exponent { result = SQLParser::Statement::ApproximateFloat.new(val[0], val[2]) }
|
277
277
|
|
278
278
|
mantissa
|
279
279
|
: exact_numeric_literal
|
@@ -282,28 +282,28 @@ rule
|
|
282
282
|
: signed_integer
|
283
283
|
|
284
284
|
signed_integer
|
285
|
-
: sign unsigned_integer { result = val[0].new(
|
286
|
-
| unsigned_integer { result =
|
285
|
+
: sign unsigned_integer { result = val[0].new(SQLParser::Statement::Integer.new(val[1])) }
|
286
|
+
| unsigned_integer { result = SQLParser::Statement::Integer.new(val[0]) }
|
287
287
|
|
288
288
|
sign
|
289
|
-
: plus_sign { result =
|
290
|
-
| minus_sign { result =
|
289
|
+
: plus_sign { result = SQLParser::Statement::UnaryPlus }
|
290
|
+
| minus_sign { result = SQLParser::Statement::UnaryMinus }
|
291
291
|
|
292
292
|
# sql module
|
293
293
|
column_name
|
294
|
-
: identifier { result =
|
294
|
+
: identifier { result = SQLParser::Statement::Column.new(val[0]) }
|
295
295
|
|
296
296
|
# literals
|
297
297
|
general_literal
|
298
|
-
: quote character_string_literal quote { result =
|
299
|
-
| quote quote { result =
|
298
|
+
: quote character_string_literal quote { result = SQLParser::Statement::String.new(val[1]) }
|
299
|
+
| quote quote { result = SQLParser::Statement::String.new('') }
|
300
300
|
| datetime_literal
|
301
301
|
|
302
302
|
datetime_literal
|
303
303
|
: date_literal
|
304
304
|
|
305
305
|
date_literal
|
306
|
-
: DATE date_string { result =
|
306
|
+
: DATE date_string { result = SQLParser::Statement::Date.new(val[1]) }
|
307
307
|
|
308
308
|
---- header ----
|
309
309
|
require File.dirname(__FILE__) + '/parser.rex.rb'
|
@@ -701,7 +701,7 @@ Racc_debug_parser = false
|
|
701
701
|
|
702
702
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 11
|
703
703
|
def _reduce_3( val, _values, result )
|
704
|
-
result =
|
704
|
+
result = SQLParser::Statement::DirectSelect.new(val[0], val[1])
|
705
705
|
result
|
706
706
|
end
|
707
707
|
.,.,
|
@@ -710,7 +710,7 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 11
|
|
710
710
|
|
711
711
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 16
|
712
712
|
def _reduce_5( val, _values, result )
|
713
|
-
result =
|
713
|
+
result = SQLParser::Statement::OrderBy.new(val[2])
|
714
714
|
result
|
715
715
|
end
|
716
716
|
.,.,
|
@@ -735,35 +735,35 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 23
|
|
735
735
|
|
736
736
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 27
|
737
737
|
def _reduce_10( val, _values, result )
|
738
|
-
result =
|
738
|
+
result = SQLParser::Statement::Integer.new(val[0])
|
739
739
|
result
|
740
740
|
end
|
741
741
|
.,.,
|
742
742
|
|
743
743
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 30
|
744
744
|
def _reduce_11( val, _values, result )
|
745
|
-
result =
|
745
|
+
result = SQLParser::Statement::Ascending
|
746
746
|
result
|
747
747
|
end
|
748
748
|
.,.,
|
749
749
|
|
750
750
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 31
|
751
751
|
def _reduce_12( val, _values, result )
|
752
|
-
result =
|
752
|
+
result = SQLParser::Statement::Ascending
|
753
753
|
result
|
754
754
|
end
|
755
755
|
.,.,
|
756
756
|
|
757
757
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 32
|
758
758
|
def _reduce_13( val, _values, result )
|
759
|
-
result =
|
759
|
+
result = SQLParser::Statement::Descending
|
760
760
|
result
|
761
761
|
end
|
762
762
|
.,.,
|
763
763
|
|
764
764
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 37
|
765
765
|
def _reduce_14( val, _values, result )
|
766
|
-
result =
|
766
|
+
result = SQLParser::Statement::Subquery.new(val[1])
|
767
767
|
result
|
768
768
|
end
|
769
769
|
.,.,
|
@@ -772,28 +772,28 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 37
|
|
772
772
|
|
773
773
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 43
|
774
774
|
def _reduce_16( val, _values, result )
|
775
|
-
result =
|
775
|
+
result = SQLParser::Statement::Select.new(val[1], val[2])
|
776
776
|
result
|
777
777
|
end
|
778
778
|
.,.,
|
779
779
|
|
780
780
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 44
|
781
781
|
def _reduce_17( val, _values, result )
|
782
|
-
result =
|
782
|
+
result = SQLParser::Statement::Select.new(val[1])
|
783
783
|
result
|
784
784
|
end
|
785
785
|
.,.,
|
786
786
|
|
787
787
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 47
|
788
788
|
def _reduce_18( val, _values, result )
|
789
|
-
result =
|
789
|
+
result = SQLParser::Statement::All.new
|
790
790
|
result
|
791
791
|
end
|
792
792
|
.,.,
|
793
793
|
|
794
794
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 48
|
795
795
|
def _reduce_19( val, _values, result )
|
796
|
-
result =
|
796
|
+
result = SQLParser::Statement::SelectList.new(val[0])
|
797
797
|
result
|
798
798
|
end
|
799
799
|
.,.,
|
@@ -809,14 +809,14 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 51
|
|
809
809
|
|
810
810
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 55
|
811
811
|
def _reduce_22( val, _values, result )
|
812
|
-
result =
|
812
|
+
result = SQLParser::Statement::As.new(val[0], val[2])
|
813
813
|
result
|
814
814
|
end
|
815
815
|
.,.,
|
816
816
|
|
817
817
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 56
|
818
818
|
def _reduce_23( val, _values, result )
|
819
|
-
result =
|
819
|
+
result = SQLParser::Statement::As.new(val[0], val[1])
|
820
820
|
result
|
821
821
|
end
|
822
822
|
.,.,
|
@@ -825,28 +825,28 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 56
|
|
825
825
|
|
826
826
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 60
|
827
827
|
def _reduce_25( val, _values, result )
|
828
|
-
result =
|
828
|
+
result = SQLParser::Statement::TableExpression.new(val[0], val[1], val[2], val[3])
|
829
829
|
result
|
830
830
|
end
|
831
831
|
.,.,
|
832
832
|
|
833
833
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 63
|
834
834
|
def _reduce_26( val, _values, result )
|
835
|
-
result =
|
835
|
+
result = SQLParser::Statement::FromClause.new(val[1])
|
836
836
|
result
|
837
837
|
end
|
838
838
|
.,.,
|
839
839
|
|
840
840
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 66
|
841
841
|
def _reduce_27( val, _values, result )
|
842
|
-
result =
|
842
|
+
result = SQLParser::Statement::As.new(val[0], val[2])
|
843
843
|
result
|
844
844
|
end
|
845
845
|
.,.,
|
846
846
|
|
847
847
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 67
|
848
848
|
def _reduce_28( val, _values, result )
|
849
|
-
result =
|
849
|
+
result = SQLParser::Statement::As.new(val[0], val[1])
|
850
850
|
result
|
851
851
|
end
|
852
852
|
.,.,
|
@@ -863,14 +863,14 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 67
|
|
863
863
|
|
864
864
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 79
|
865
865
|
def _reduce_34( val, _values, result )
|
866
|
-
result =
|
866
|
+
result = SQLParser::Statement::CrossJoin.new(val[0], val[2])
|
867
867
|
result
|
868
868
|
end
|
869
869
|
.,.,
|
870
870
|
|
871
871
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 80
|
872
872
|
def _reduce_35( val, _values, result )
|
873
|
-
result =
|
873
|
+
result = SQLParser::Statement::CrossJoin.new(val[0], val[3])
|
874
874
|
result
|
875
875
|
end
|
876
876
|
.,.,
|
@@ -884,49 +884,49 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 83
|
|
884
884
|
|
885
885
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 86
|
886
886
|
def _reduce_37( val, _values, result )
|
887
|
-
result =
|
887
|
+
result = SQLParser::Statement::InnerJoin
|
888
888
|
result
|
889
889
|
end
|
890
890
|
.,.,
|
891
891
|
|
892
892
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 87
|
893
893
|
def _reduce_38( val, _values, result )
|
894
|
-
result =
|
894
|
+
result = SQLParser::Statement::LeftOuterJoin
|
895
895
|
result
|
896
896
|
end
|
897
897
|
.,.,
|
898
898
|
|
899
899
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 88
|
900
900
|
def _reduce_39( val, _values, result )
|
901
|
-
result =
|
901
|
+
result = SQLParser::Statement::LeftJoin
|
902
902
|
result
|
903
903
|
end
|
904
904
|
.,.,
|
905
905
|
|
906
906
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 89
|
907
907
|
def _reduce_40( val, _values, result )
|
908
|
-
result =
|
908
|
+
result = SQLParser::Statement::RightOuterJoin
|
909
909
|
result
|
910
910
|
end
|
911
911
|
.,.,
|
912
912
|
|
913
913
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 90
|
914
914
|
def _reduce_41( val, _values, result )
|
915
|
-
result =
|
915
|
+
result = SQLParser::Statement::RightJoin
|
916
916
|
result
|
917
917
|
end
|
918
918
|
.,.,
|
919
919
|
|
920
920
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 91
|
921
921
|
def _reduce_42( val, _values, result )
|
922
|
-
result =
|
922
|
+
result = SQLParser::Statement::FullJoin
|
923
923
|
result
|
924
924
|
end
|
925
925
|
.,.,
|
926
926
|
|
927
927
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 92
|
928
928
|
def _reduce_43( val, _values, result )
|
929
|
-
result =
|
929
|
+
result = SQLParser::Statement::FullOuterJoin
|
930
930
|
result
|
931
931
|
end
|
932
932
|
.,.,
|
@@ -937,14 +937,14 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 92
|
|
937
937
|
|
938
938
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 99
|
939
939
|
def _reduce_46( val, _values, result )
|
940
|
-
result =
|
940
|
+
result = SQLParser::Statement::On.new(val[1])
|
941
941
|
result
|
942
942
|
end
|
943
943
|
.,.,
|
944
944
|
|
945
945
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 102
|
946
946
|
def _reduce_47( val, _values, result )
|
947
|
-
result =
|
947
|
+
result = SQLParser::Statement::Using.new(val[2])
|
948
948
|
result
|
949
949
|
end
|
950
950
|
.,.,
|
@@ -955,7 +955,7 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 102
|
|
955
955
|
|
956
956
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 109
|
957
957
|
def _reduce_50( val, _values, result )
|
958
|
-
result =
|
958
|
+
result = SQLParser::Statement::WhereClause.new(val[1])
|
959
959
|
result
|
960
960
|
end
|
961
961
|
.,.,
|
@@ -964,7 +964,7 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 109
|
|
964
964
|
|
965
965
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 113
|
966
966
|
def _reduce_52( val, _values, result )
|
967
|
-
result =
|
967
|
+
result = SQLParser::Statement::GroupByClause.new(val[2])
|
968
968
|
result
|
969
969
|
end
|
970
970
|
.,.,
|
@@ -984,7 +984,7 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 116
|
|
984
984
|
|
985
985
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 124
|
986
986
|
def _reduce_57( val, _values, result )
|
987
|
-
result =
|
987
|
+
result = SQLParser::Statement::HavingClause.new(val[1])
|
988
988
|
result
|
989
989
|
end
|
990
990
|
.,.,
|
@@ -993,28 +993,28 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 124
|
|
993
993
|
|
994
994
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 131
|
995
995
|
def _reduce_59( val, _values, result )
|
996
|
-
result =
|
996
|
+
result = SQLParser::Statement::Not.new(SQLParser::Statement::Between.new(val[0], val[3], val[5]))
|
997
997
|
result
|
998
998
|
end
|
999
999
|
.,.,
|
1000
1000
|
|
1001
1001
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 132
|
1002
1002
|
def _reduce_60( val, _values, result )
|
1003
|
-
result =
|
1003
|
+
result = SQLParser::Statement::Between.new(val[0], val[2], val[4])
|
1004
1004
|
result
|
1005
1005
|
end
|
1006
1006
|
.,.,
|
1007
1007
|
|
1008
1008
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 135
|
1009
1009
|
def _reduce_61( val, _values, result )
|
1010
|
-
result =
|
1010
|
+
result = SQLParser::Statement::Not.new(SQLParser::Statement::In.new(val[0], val[3]))
|
1011
1011
|
result
|
1012
1012
|
end
|
1013
1013
|
.,.,
|
1014
1014
|
|
1015
1015
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 136
|
1016
1016
|
def _reduce_62( val, _values, result )
|
1017
|
-
result =
|
1017
|
+
result = SQLParser::Statement::In.new(val[0], val[2])
|
1018
1018
|
result
|
1019
1019
|
end
|
1020
1020
|
.,.,
|
@@ -1023,7 +1023,7 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 136
|
|
1023
1023
|
|
1024
1024
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 140
|
1025
1025
|
def _reduce_64( val, _values, result )
|
1026
|
-
result =
|
1026
|
+
result = SQLParser::Statement::InValueList.new(val[1])
|
1027
1027
|
result
|
1028
1028
|
end
|
1029
1029
|
.,.,
|
@@ -1039,42 +1039,42 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 143
|
|
1039
1039
|
|
1040
1040
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 150
|
1041
1041
|
def _reduce_67( val, _values, result )
|
1042
|
-
result =
|
1042
|
+
result = SQLParser::Statement::Not.new(SQLParser::Statement::Like.new(val[0], val[3]))
|
1043
1043
|
result
|
1044
1044
|
end
|
1045
1045
|
.,.,
|
1046
1046
|
|
1047
1047
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 151
|
1048
1048
|
def _reduce_68( val, _values, result )
|
1049
|
-
result =
|
1049
|
+
result = SQLParser::Statement::Like.new(val[0], val[2])
|
1050
1050
|
result
|
1051
1051
|
end
|
1052
1052
|
.,.,
|
1053
1053
|
|
1054
1054
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 154
|
1055
1055
|
def _reduce_69( val, _values, result )
|
1056
|
-
result =
|
1056
|
+
result = SQLParser::Statement::Not.new(SQLParser::Statement::Is.new(val[0], SQLParser::Statement::Null.new))
|
1057
1057
|
result
|
1058
1058
|
end
|
1059
1059
|
.,.,
|
1060
1060
|
|
1061
1061
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 155
|
1062
1062
|
def _reduce_70( val, _values, result )
|
1063
|
-
result =
|
1063
|
+
result = SQLParser::Statement::Is.new(val[0], SQLParser::Statement::Null.new)
|
1064
1064
|
result
|
1065
1065
|
end
|
1066
1066
|
.,.,
|
1067
1067
|
|
1068
1068
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 158
|
1069
1069
|
def _reduce_71( val, _values, result )
|
1070
|
-
result =
|
1070
|
+
result = SQLParser::Statement::Exists.new(val[1])
|
1071
1071
|
result
|
1072
1072
|
end
|
1073
1073
|
.,.,
|
1074
1074
|
|
1075
1075
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 162
|
1076
1076
|
def _reduce_72( val, _values, result )
|
1077
|
-
result =
|
1077
|
+
result = SQLParser::Statement::Table.new(val[0])
|
1078
1078
|
result
|
1079
1079
|
end
|
1080
1080
|
.,.,
|
@@ -1092,7 +1092,7 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 165
|
|
1092
1092
|
|
1093
1093
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 171
|
1094
1094
|
def _reduce_76( val, _values, result )
|
1095
|
-
result =
|
1095
|
+
result = SQLParser::Statement::Or.new(val[0], val[2])
|
1096
1096
|
result
|
1097
1097
|
end
|
1098
1098
|
.,.,
|
@@ -1101,14 +1101,14 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 171
|
|
1101
1101
|
|
1102
1102
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 175
|
1103
1103
|
def _reduce_78( val, _values, result )
|
1104
|
-
result =
|
1104
|
+
result = SQLParser::Statement::And.new(val[0], val[2])
|
1105
1105
|
result
|
1106
1106
|
end
|
1107
1107
|
.,.,
|
1108
1108
|
|
1109
1109
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 178
|
1110
1110
|
def _reduce_79( val, _values, result )
|
1111
|
-
result =
|
1111
|
+
result = SQLParser::Statement::Not.new(val[1])
|
1112
1112
|
result
|
1113
1113
|
end
|
1114
1114
|
.,.,
|
@@ -1140,42 +1140,42 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 186
|
|
1140
1140
|
|
1141
1141
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 197
|
1142
1142
|
def _reduce_90( val, _values, result )
|
1143
|
-
result =
|
1143
|
+
result = SQLParser::Statement::Equals.new(val[0], val[2])
|
1144
1144
|
result
|
1145
1145
|
end
|
1146
1146
|
.,.,
|
1147
1147
|
|
1148
1148
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 198
|
1149
1149
|
def _reduce_91( val, _values, result )
|
1150
|
-
result =
|
1150
|
+
result = SQLParser::Statement::Not.new(SQLParser::Statement::Equals.new(val[0], val[2]))
|
1151
1151
|
result
|
1152
1152
|
end
|
1153
1153
|
.,.,
|
1154
1154
|
|
1155
1155
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 199
|
1156
1156
|
def _reduce_92( val, _values, result )
|
1157
|
-
result =
|
1157
|
+
result = SQLParser::Statement::Less.new(val[0], val[2])
|
1158
1158
|
result
|
1159
1159
|
end
|
1160
1160
|
.,.,
|
1161
1161
|
|
1162
1162
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 200
|
1163
1163
|
def _reduce_93( val, _values, result )
|
1164
|
-
result =
|
1164
|
+
result = SQLParser::Statement::Greater.new(val[0], val[2])
|
1165
1165
|
result
|
1166
1166
|
end
|
1167
1167
|
.,.,
|
1168
1168
|
|
1169
1169
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 201
|
1170
1170
|
def _reduce_94( val, _values, result )
|
1171
|
-
result =
|
1171
|
+
result = SQLParser::Statement::LessOrEquals.new(val[0], val[2])
|
1172
1172
|
result
|
1173
1173
|
end
|
1174
1174
|
.,.,
|
1175
1175
|
|
1176
1176
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 202
|
1177
1177
|
def _reduce_95( val, _values, result )
|
1178
|
-
result =
|
1178
|
+
result = SQLParser::Statement::GreaterOrEquals.new(val[0], val[2])
|
1179
1179
|
result
|
1180
1180
|
end
|
1181
1181
|
.,.,
|
@@ -1190,14 +1190,14 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 202
|
|
1190
1190
|
|
1191
1191
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 215
|
1192
1192
|
def _reduce_100( val, _values, result )
|
1193
|
-
result =
|
1193
|
+
result = SQLParser::Statement::Add.new(val[0], val[2])
|
1194
1194
|
result
|
1195
1195
|
end
|
1196
1196
|
.,.,
|
1197
1197
|
|
1198
1198
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 216
|
1199
1199
|
def _reduce_101( val, _values, result )
|
1200
|
-
result =
|
1200
|
+
result = SQLParser::Statement::Subtract.new(val[0], val[2])
|
1201
1201
|
result
|
1202
1202
|
end
|
1203
1203
|
.,.,
|
@@ -1206,14 +1206,14 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 216
|
|
1206
1206
|
|
1207
1207
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 220
|
1208
1208
|
def _reduce_103( val, _values, result )
|
1209
|
-
result =
|
1209
|
+
result = SQLParser::Statement::Multiply.new(val[0], val[2])
|
1210
1210
|
result
|
1211
1211
|
end
|
1212
1212
|
.,.,
|
1213
1213
|
|
1214
1214
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 221
|
1215
1215
|
def _reduce_104( val, _values, result )
|
1216
|
-
result =
|
1216
|
+
result = SQLParser::Statement::Divide.new(val[0], val[2])
|
1217
1217
|
result
|
1218
1218
|
end
|
1219
1219
|
.,.,
|
@@ -1252,14 +1252,14 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 232
|
|
1252
1252
|
|
1253
1253
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 243
|
1254
1254
|
def _reduce_116( val, _values, result )
|
1255
|
-
result =
|
1255
|
+
result = SQLParser::Statement::CurrentUser.new
|
1256
1256
|
result
|
1257
1257
|
end
|
1258
1258
|
.,.,
|
1259
1259
|
|
1260
1260
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 246
|
1261
1261
|
def _reduce_117( val, _values, result )
|
1262
|
-
result =
|
1262
|
+
result = SQLParser::Statement::QualifiedColumn.new(val[0], val[2])
|
1263
1263
|
result
|
1264
1264
|
end
|
1265
1265
|
.,.,
|
@@ -1270,7 +1270,7 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 246
|
|
1270
1270
|
|
1271
1271
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 253
|
1272
1272
|
def _reduce_120( val, _values, result )
|
1273
|
-
result =
|
1273
|
+
result = SQLParser::Statement::Count.new(SQLParser::Statement::All.new)
|
1274
1274
|
result
|
1275
1275
|
end
|
1276
1276
|
.,.,
|
@@ -1279,35 +1279,35 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 253
|
|
1279
1279
|
|
1280
1280
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 257
|
1281
1281
|
def _reduce_122( val, _values, result )
|
1282
|
-
result =
|
1282
|
+
result = SQLParser::Statement::Count.new(val[2])
|
1283
1283
|
result
|
1284
1284
|
end
|
1285
1285
|
.,.,
|
1286
1286
|
|
1287
1287
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 258
|
1288
1288
|
def _reduce_123( val, _values, result )
|
1289
|
-
result =
|
1289
|
+
result = SQLParser::Statement::Average.new(val[2])
|
1290
1290
|
result
|
1291
1291
|
end
|
1292
1292
|
.,.,
|
1293
1293
|
|
1294
1294
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 259
|
1295
1295
|
def _reduce_124( val, _values, result )
|
1296
|
-
result =
|
1296
|
+
result = SQLParser::Statement::Maximum.new(val[2])
|
1297
1297
|
result
|
1298
1298
|
end
|
1299
1299
|
.,.,
|
1300
1300
|
|
1301
1301
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 260
|
1302
1302
|
def _reduce_125( val, _values, result )
|
1303
|
-
result =
|
1303
|
+
result = SQLParser::Statement::Minimum.new(val[2])
|
1304
1304
|
result
|
1305
1305
|
end
|
1306
1306
|
.,.,
|
1307
1307
|
|
1308
1308
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 261
|
1309
1309
|
def _reduce_126( val, _values, result )
|
1310
|
-
result =
|
1310
|
+
result = SQLParser::Statement::Sum.new(val[2])
|
1311
1311
|
result
|
1312
1312
|
end
|
1313
1313
|
.,.,
|
@@ -1318,35 +1318,35 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 261
|
|
1318
1318
|
|
1319
1319
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 269
|
1320
1320
|
def _reduce_129( val, _values, result )
|
1321
|
-
result =
|
1321
|
+
result = SQLParser::Statement::Float.new("#{val[0]}.#{val[2]}".to_f)
|
1322
1322
|
result
|
1323
1323
|
end
|
1324
1324
|
.,.,
|
1325
1325
|
|
1326
1326
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 270
|
1327
1327
|
def _reduce_130( val, _values, result )
|
1328
|
-
result =
|
1328
|
+
result = SQLParser::Statement::Float.new(val[0])
|
1329
1329
|
result
|
1330
1330
|
end
|
1331
1331
|
.,.,
|
1332
1332
|
|
1333
1333
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 271
|
1334
1334
|
def _reduce_131( val, _values, result )
|
1335
|
-
result =
|
1335
|
+
result = SQLParser::Statement::Float.new("0.#{val[1]}".to_f)
|
1336
1336
|
result
|
1337
1337
|
end
|
1338
1338
|
.,.,
|
1339
1339
|
|
1340
1340
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 272
|
1341
1341
|
def _reduce_132( val, _values, result )
|
1342
|
-
result =
|
1342
|
+
result = SQLParser::Statement::Integer.new(val[0])
|
1343
1343
|
result
|
1344
1344
|
end
|
1345
1345
|
.,.,
|
1346
1346
|
|
1347
1347
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 275
|
1348
1348
|
def _reduce_133( val, _values, result )
|
1349
|
-
result =
|
1349
|
+
result = SQLParser::Statement::ApproximateFloat.new(val[0], val[2])
|
1350
1350
|
result
|
1351
1351
|
end
|
1352
1352
|
.,.,
|
@@ -1357,49 +1357,49 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 275
|
|
1357
1357
|
|
1358
1358
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 284
|
1359
1359
|
def _reduce_136( val, _values, result )
|
1360
|
-
result = val[0].new(
|
1360
|
+
result = val[0].new(SQLParser::Statement::Integer.new(val[1]))
|
1361
1361
|
result
|
1362
1362
|
end
|
1363
1363
|
.,.,
|
1364
1364
|
|
1365
1365
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 285
|
1366
1366
|
def _reduce_137( val, _values, result )
|
1367
|
-
result =
|
1367
|
+
result = SQLParser::Statement::Integer.new(val[0])
|
1368
1368
|
result
|
1369
1369
|
end
|
1370
1370
|
.,.,
|
1371
1371
|
|
1372
1372
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 288
|
1373
1373
|
def _reduce_138( val, _values, result )
|
1374
|
-
result =
|
1374
|
+
result = SQLParser::Statement::UnaryPlus
|
1375
1375
|
result
|
1376
1376
|
end
|
1377
1377
|
.,.,
|
1378
1378
|
|
1379
1379
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 289
|
1380
1380
|
def _reduce_139( val, _values, result )
|
1381
|
-
result =
|
1381
|
+
result = SQLParser::Statement::UnaryMinus
|
1382
1382
|
result
|
1383
1383
|
end
|
1384
1384
|
.,.,
|
1385
1385
|
|
1386
1386
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 293
|
1387
1387
|
def _reduce_140( val, _values, result )
|
1388
|
-
result =
|
1388
|
+
result = SQLParser::Statement::Column.new(val[0])
|
1389
1389
|
result
|
1390
1390
|
end
|
1391
1391
|
.,.,
|
1392
1392
|
|
1393
1393
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 297
|
1394
1394
|
def _reduce_141( val, _values, result )
|
1395
|
-
result =
|
1395
|
+
result = SQLParser::Statement::String.new(val[1])
|
1396
1396
|
result
|
1397
1397
|
end
|
1398
1398
|
.,.,
|
1399
1399
|
|
1400
1400
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 298
|
1401
1401
|
def _reduce_142( val, _values, result )
|
1402
|
-
result =
|
1402
|
+
result = SQLParser::Statement::String.new('')
|
1403
1403
|
result
|
1404
1404
|
end
|
1405
1405
|
.,.,
|
@@ -1410,7 +1410,7 @@ module_eval <<'.,.,', 'lib/sql/parser.racc', 298
|
|
1410
1410
|
|
1411
1411
|
module_eval <<'.,.,', 'lib/sql/parser.racc', 305
|
1412
1412
|
def _reduce_145( val, _values, result )
|
1413
|
-
result =
|
1413
|
+
result = SQLParser::Statement::Date.new(val[1])
|
1414
1414
|
result
|
1415
1415
|
end
|
1416
1416
|
.,.,
|
data/lib/sql-parser/version.rb
CHANGED