rgviz 0.4 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rgviz/nodes.rb +37 -37
- data/lib/rgviz/parser.rb +1 -1
- data/lib/rgviz/token.rb +14 -14
- metadata +3 -3
data/lib/rgviz/nodes.rb
CHANGED
@@ -107,8 +107,8 @@ module Rgviz
|
|
107
107
|
|
108
108
|
class Sort
|
109
109
|
|
110
|
-
Asc =
|
111
|
-
Desc =
|
110
|
+
Asc = Token::Asc
|
111
|
+
Desc = Token::Desc
|
112
112
|
|
113
113
|
attr_accessor :column
|
114
114
|
attr_accessor :order
|
@@ -214,19 +214,19 @@ module Rgviz
|
|
214
214
|
end
|
215
215
|
|
216
216
|
class BinaryExpression
|
217
|
-
And =
|
218
|
-
Contains =
|
219
|
-
EndsWith = :
|
220
|
-
Eq =
|
221
|
-
Gt =
|
222
|
-
Gte =
|
223
|
-
Like =
|
224
|
-
Lt =
|
225
|
-
Lte =
|
226
|
-
Matches =
|
227
|
-
Neq =
|
228
|
-
Or =
|
229
|
-
StartsWith = :
|
217
|
+
And = Token::And
|
218
|
+
Contains = Token::Contains
|
219
|
+
EndsWith = :'ends with'
|
220
|
+
Eq = Token::EQ
|
221
|
+
Gt = Token::GT
|
222
|
+
Gte = Token::GTE
|
223
|
+
Like = Token::Like
|
224
|
+
Lt = Token::LT
|
225
|
+
Lte = Token::LTE
|
226
|
+
Matches = Token::Matches
|
227
|
+
Neq = Token::NEQ
|
228
|
+
Or = Token::Or
|
229
|
+
StartsWith = :'starts with'
|
230
230
|
|
231
231
|
attr_accessor :operator
|
232
232
|
attr_accessor :left
|
@@ -252,9 +252,9 @@ module Rgviz
|
|
252
252
|
end
|
253
253
|
|
254
254
|
class UnaryExpression
|
255
|
-
Not =
|
256
|
-
IsNull = :
|
257
|
-
IsNotNull = :
|
255
|
+
Not = Token::Not
|
256
|
+
IsNull = :'is null'
|
257
|
+
IsNotNull = :'is not null'
|
258
258
|
|
259
259
|
attr_accessor :operand
|
260
260
|
attr_accessor :operator
|
@@ -357,24 +357,24 @@ module Rgviz
|
|
357
357
|
|
358
358
|
class ScalarFunctionColumn
|
359
359
|
|
360
|
-
DateDiff =
|
361
|
-
Day =
|
362
|
-
DayOfWeek =
|
360
|
+
DateDiff = Token::DateDiff
|
361
|
+
Day = Token::Day
|
362
|
+
DayOfWeek = Token::DayOfWeek
|
363
363
|
Difference = :difference
|
364
|
-
Hour =
|
365
|
-
Lower =
|
366
|
-
Millisecond =
|
367
|
-
Minute =
|
368
|
-
Month =
|
369
|
-
Now =
|
364
|
+
Hour = Token::Hour
|
365
|
+
Lower = Token::Lower
|
366
|
+
Millisecond = Token::Millisecond
|
367
|
+
Minute = Token::Minute
|
368
|
+
Month = Token::Month
|
369
|
+
Now = Token::Now
|
370
370
|
Product = :product
|
371
|
-
Quarter =
|
371
|
+
Quarter = Token::Quarter
|
372
372
|
Quotient = :quotient
|
373
|
-
Second =
|
373
|
+
Second = Token::Second
|
374
374
|
Sum = :sum
|
375
|
-
ToDate =
|
376
|
-
Upper =
|
377
|
-
Year =
|
375
|
+
ToDate = Token::ToDate
|
376
|
+
Upper = Token::Upper
|
377
|
+
Year = Token::Year
|
378
378
|
|
379
379
|
attr_accessor :function
|
380
380
|
attr_accessor :arguments
|
@@ -409,11 +409,11 @@ module Rgviz
|
|
409
409
|
|
410
410
|
class AggregateColumn
|
411
411
|
|
412
|
-
Avg =
|
413
|
-
Count =
|
414
|
-
Max =
|
415
|
-
Min =
|
416
|
-
Sum =
|
412
|
+
Avg = Token::Avg
|
413
|
+
Count = Token::Count
|
414
|
+
Max = Token::Max
|
415
|
+
Min = Token::Min
|
416
|
+
Sum = Token::Sum
|
417
417
|
|
418
418
|
attr_accessor :function
|
419
419
|
attr_accessor :argument
|
data/lib/rgviz/parser.rb
CHANGED
@@ -239,7 +239,7 @@ module Rgviz
|
|
239
239
|
raise ParseException.new "Expecting right exp" unless right
|
240
240
|
return BinaryExpression.new left, operator, right
|
241
241
|
when Token::Starts, Token::Ends
|
242
|
-
operator = "#{@token.value}
|
242
|
+
operator = "#{@token.value} with".to_sym
|
243
243
|
next_token
|
244
244
|
check! Token::With
|
245
245
|
right = parse_column
|
data/lib/rgviz/token.rb
CHANGED
@@ -58,22 +58,22 @@ module Rgviz
|
|
58
58
|
DECIMAL = :DECIMAL
|
59
59
|
STRING = :STRING
|
60
60
|
|
61
|
-
PLUS = :
|
62
|
-
MINUS = :
|
63
|
-
STAR = :
|
64
|
-
SLASH = :
|
61
|
+
PLUS = :'+'
|
62
|
+
MINUS = :'-'
|
63
|
+
STAR = :'*'
|
64
|
+
SLASH = :'/'
|
65
65
|
|
66
|
-
COMMA = :
|
67
|
-
LPAREN = :
|
68
|
-
RPAREN = :
|
69
|
-
EQ = :
|
70
|
-
LT = :
|
71
|
-
LTE = :
|
72
|
-
GT = :
|
73
|
-
GTE = :
|
74
|
-
NEQ = :
|
66
|
+
COMMA = :','
|
67
|
+
LPAREN = :'('
|
68
|
+
RPAREN = :')'
|
69
|
+
EQ = :'='
|
70
|
+
LT = :'<'
|
71
|
+
LTE = :'<='
|
72
|
+
GT = :'>'
|
73
|
+
GTE = :'>='
|
74
|
+
NEQ = :'!='
|
75
75
|
|
76
|
-
EOF = :EOF
|
76
|
+
EOF = :'<EOF'
|
77
77
|
|
78
78
|
attr_accessor :start
|
79
79
|
attr_accessor :value
|
metadata
CHANGED