csv_plus_plus 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -1
- data/README.md +18 -62
- data/lib/csv_plus_plus/benchmarked_compiler.rb +62 -0
- data/lib/csv_plus_plus/can_define_references.rb +88 -0
- data/lib/csv_plus_plus/can_resolve_references.rb +8 -0
- data/lib/csv_plus_plus/cell.rb +3 -3
- data/lib/csv_plus_plus/cli.rb +24 -7
- data/lib/csv_plus_plus/color.rb +12 -6
- data/lib/csv_plus_plus/compiler.rb +156 -0
- data/lib/csv_plus_plus/data_validation.rb +138 -0
- data/lib/csv_plus_plus/{language → entities}/ast_builder.rb +5 -7
- data/lib/csv_plus_plus/entities/boolean.rb +31 -0
- data/lib/csv_plus_plus/{language → entities}/builtins.rb +2 -4
- data/lib/csv_plus_plus/entities/cell_reference.rb +60 -0
- data/lib/csv_plus_plus/entities/date.rb +30 -0
- data/lib/csv_plus_plus/entities/entity.rb +84 -0
- data/lib/csv_plus_plus/entities/function.rb +33 -0
- data/lib/csv_plus_plus/entities/function_call.rb +35 -0
- data/lib/csv_plus_plus/entities/number.rb +34 -0
- data/lib/csv_plus_plus/entities/runtime_value.rb +26 -0
- data/lib/csv_plus_plus/entities/string.rb +29 -0
- data/lib/csv_plus_plus/entities/variable.rb +25 -0
- data/lib/csv_plus_plus/entities.rb +33 -0
- data/lib/csv_plus_plus/error/error.rb +10 -0
- data/lib/csv_plus_plus/error/formula_syntax_error.rb +36 -0
- data/lib/csv_plus_plus/error/modifier_syntax_error.rb +27 -0
- data/lib/csv_plus_plus/error/modifier_validation_error.rb +49 -0
- data/lib/csv_plus_plus/{language → error}/syntax_error.rb +6 -14
- data/lib/csv_plus_plus/error/writer_error.rb +9 -0
- data/lib/csv_plus_plus/error.rb +9 -2
- data/lib/csv_plus_plus/expand.rb +3 -1
- data/lib/csv_plus_plus/google_api_client.rb +4 -0
- data/lib/csv_plus_plus/lexer/lexer.rb +19 -11
- data/lib/csv_plus_plus/modifier/conditional_formatting.rb +17 -0
- data/lib/csv_plus_plus/modifier.rb +73 -70
- data/lib/csv_plus_plus/options.rb +3 -0
- data/lib/csv_plus_plus/parser/cell_value.tab.rb +305 -0
- data/lib/csv_plus_plus/parser/code_section.tab.rb +410 -0
- data/lib/csv_plus_plus/parser/modifier.tab.rb +484 -0
- data/lib/csv_plus_plus/references.rb +68 -0
- data/lib/csv_plus_plus/row.rb +0 -3
- data/lib/csv_plus_plus/runtime.rb +199 -0
- data/lib/csv_plus_plus/scope.rb +196 -0
- data/lib/csv_plus_plus/template.rb +21 -5
- data/lib/csv_plus_plus/validated_modifier.rb +164 -0
- data/lib/csv_plus_plus/version.rb +1 -1
- data/lib/csv_plus_plus/writer/file_backer_upper.rb +6 -4
- data/lib/csv_plus_plus/writer/google_sheet_builder.rb +24 -29
- data/lib/csv_plus_plus/writer/google_sheet_modifier.rb +33 -12
- data/lib/csv_plus_plus/writer/rubyxl_builder.rb +3 -6
- data/lib/csv_plus_plus.rb +41 -16
- metadata +34 -24
- data/lib/csv_plus_plus/code_section.rb +0 -68
- data/lib/csv_plus_plus/language/benchmarked_compiler.rb +0 -65
- data/lib/csv_plus_plus/language/cell_value.tab.rb +0 -332
- data/lib/csv_plus_plus/language/code_section.tab.rb +0 -442
- data/lib/csv_plus_plus/language/compiler.rb +0 -157
- data/lib/csv_plus_plus/language/entities/boolean.rb +0 -33
- data/lib/csv_plus_plus/language/entities/cell_reference.rb +0 -33
- data/lib/csv_plus_plus/language/entities/entity.rb +0 -86
- data/lib/csv_plus_plus/language/entities/function.rb +0 -35
- data/lib/csv_plus_plus/language/entities/function_call.rb +0 -26
- data/lib/csv_plus_plus/language/entities/number.rb +0 -36
- data/lib/csv_plus_plus/language/entities/runtime_value.rb +0 -28
- data/lib/csv_plus_plus/language/entities/string.rb +0 -31
- data/lib/csv_plus_plus/language/entities/variable.rb +0 -25
- data/lib/csv_plus_plus/language/entities.rb +0 -28
- data/lib/csv_plus_plus/language/references.rb +0 -70
- data/lib/csv_plus_plus/language/runtime.rb +0 -205
- data/lib/csv_plus_plus/language/scope.rb +0 -188
- data/lib/csv_plus_plus/modifier.tab.rb +0 -907
@@ -1,907 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# DO NOT MODIFY!!!!
|
3
|
-
# This file is automatically generated by Racc 1.6.2
|
4
|
-
# from Racc grammar file "".
|
5
|
-
#
|
6
|
-
|
7
|
-
require 'racc/parser.rb'
|
8
|
-
|
9
|
-
require_relative './expand'
|
10
|
-
require_relative './lexer'
|
11
|
-
|
12
|
-
module CSVPlusPlus
|
13
|
-
class ModifierParser < Racc::Parser
|
14
|
-
|
15
|
-
module_eval(<<'...end modifier.y/module_eval...', 'modifier.y', 121)
|
16
|
-
attr_reader :return_value
|
17
|
-
|
18
|
-
include ::CSVPlusPlus::Lexer
|
19
|
-
|
20
|
-
# @param cell_modifier
|
21
|
-
def initialize(cell_modifier:, row_modifier:)
|
22
|
-
super()
|
23
|
-
|
24
|
-
@parsing_row = false
|
25
|
-
@cell_modifier = cell_modifier
|
26
|
-
@row_modifier = row_modifier
|
27
|
-
end
|
28
|
-
|
29
|
-
protected
|
30
|
-
|
31
|
-
def anything_to_parse?(input)
|
32
|
-
@modifiers_to_parse = input.scan(/!?\[\[/).count
|
33
|
-
|
34
|
-
if @modifiers_to_parse == 0
|
35
|
-
assign_defaults!
|
36
|
-
@return_value = input
|
37
|
-
end
|
38
|
-
|
39
|
-
@modifiers_to_parse > 0
|
40
|
-
end
|
41
|
-
|
42
|
-
def parse_subject
|
43
|
-
'modifier'
|
44
|
-
end
|
45
|
-
|
46
|
-
def tokenizer
|
47
|
-
::CSVPlusPlus::Lexer::Tokenizer.new(
|
48
|
-
catchall: /\w+/,
|
49
|
-
ignore: /\s+/,
|
50
|
-
stop_fn: lambda do |scanner|
|
51
|
-
return false unless scanner.scan(/\]\]/)
|
52
|
-
|
53
|
-
@tokens << [:END_MODIFIERS, scanner.matched]
|
54
|
-
@return_value = scanner.rest
|
55
|
-
|
56
|
-
@modifiers_to_parse -= 1
|
57
|
-
@modifiers_to_parse == 0
|
58
|
-
end,
|
59
|
-
tokens: [
|
60
|
-
[/\[\[/, :START_CELL_MODIFIERS],
|
61
|
-
[/!\[\[/, :START_ROW_MODIFIERS],
|
62
|
-
[/^#(([0-9a-fA-F]{2}){3}|([0-9a-fA-F]){3})/, :HEX_COLOR],
|
63
|
-
[/(['\w]+\!)?[\w\d]+:[\w\d]+/, :A1_NOTATION],
|
64
|
-
[/=/, :EQ],
|
65
|
-
[/-?[\d.]+/, :NUMBER],
|
66
|
-
[/'(?:[^'\\]|\\(?:['\\\/bfnrt]|u[0-9a-fA-F]{4}))*'/, :STRING],
|
67
|
-
[/\//, :MODIFIER_SEPARATOR],
|
68
|
-
],
|
69
|
-
alter_matches: {
|
70
|
-
STRING: ->(s) { s.gsub(/^'|'$/, '') }
|
71
|
-
},
|
72
|
-
)
|
73
|
-
end
|
74
|
-
|
75
|
-
private
|
76
|
-
|
77
|
-
def assign_defaults!
|
78
|
-
@cell_modifier.take_defaults_from!(@row_modifier)
|
79
|
-
end
|
80
|
-
|
81
|
-
def parsing_row!
|
82
|
-
@parsing_row = true
|
83
|
-
end
|
84
|
-
|
85
|
-
def finished_row!
|
86
|
-
parsing_cell!
|
87
|
-
end
|
88
|
-
|
89
|
-
def parsing_cell!
|
90
|
-
@parsing_row = false
|
91
|
-
assign_defaults!
|
92
|
-
end
|
93
|
-
|
94
|
-
def freeze!
|
95
|
-
(@parsing_row ? @row_modifier : @cell_modifier).freeze!
|
96
|
-
end
|
97
|
-
|
98
|
-
def s!(property, value)
|
99
|
-
target = @parsing_row ? @row_modifier : @cell_modifier
|
100
|
-
target.public_send("#{property}=".to_sym, value)
|
101
|
-
end
|
102
|
-
...end modifier.y/module_eval...
|
103
|
-
##### State transition tables begin ###
|
104
|
-
|
105
|
-
racc_action_table = [
|
106
|
-
128, 13, 14, 15, 16, 17, 18, 19, 20, 21,
|
107
|
-
22, 23, 24, 25, 26, 27, 28, 13, 14, 15,
|
108
|
-
16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
|
109
|
-
26, 27, 28, 86, 87, 88, 89, 90, 91, 92,
|
110
|
-
93, 6, 95, 96, 98, 99, 100, 101, 102, 103,
|
111
|
-
104, 105, 106, 108, 109, 110, 111, 112, 113, 114,
|
112
|
-
115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
|
113
|
-
125, 126, 127, 129, 130, 131, 132, 133, 134, 13,
|
114
|
-
14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
|
115
|
-
24, 25, 26, 27, 28, 30, 47, 50, 51, 52,
|
116
|
-
31, 31, 62, 5, 61, 60, 63, 59, 66, 67,
|
117
|
-
68, 69, 70, 71, 62, 10, 61, 60, 63, 59,
|
118
|
-
129, 130, 131, 132, 133, 134, 129, 130, 131, 132,
|
119
|
-
133, 134, 55, 32, 54, 56, 80, 81, 82, 83,
|
120
|
-
80, 81, 82, 83, 5, 4, 33, 34, 35, 36,
|
121
|
-
37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
|
122
|
-
64, 72, 73, 74, 75, 76, 77, 84, 137, 138,
|
123
|
-
139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
|
124
|
-
149, 150, 151, 152, 153, 154, 155, 156, 157, 158,
|
125
|
-
159, 160, 161, 162, 128, 128, 128, 128, 128, 128,
|
126
|
-
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
|
127
|
-
128, 183, 128, 128, 128, 128, 128, 128, 128, 128,
|
128
|
-
128, 128, 128, 128, 128 ]
|
129
|
-
|
130
|
-
racc_action_check = [
|
131
|
-
46, 8, 8, 8, 8, 8, 8, 8, 8, 8,
|
132
|
-
8, 8, 8, 8, 8, 8, 8, 9, 9, 9,
|
133
|
-
9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
|
134
|
-
9, 9, 9, 45, 45, 45, 45, 45, 45, 45,
|
135
|
-
45, 1, 46, 46, 46, 46, 46, 46, 46, 46,
|
136
|
-
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
|
137
|
-
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
|
138
|
-
46, 46, 46, 46, 46, 46, 46, 46, 46, 31,
|
139
|
-
31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
|
140
|
-
31, 31, 31, 31, 31, 11, 29, 32, 32, 32,
|
141
|
-
11, 29, 34, 2, 34, 34, 34, 34, 36, 36,
|
142
|
-
36, 36, 36, 36, 57, 6, 57, 57, 57, 57,
|
143
|
-
139, 139, 139, 139, 139, 139, 140, 140, 140, 140,
|
144
|
-
140, 140, 33, 13, 33, 33, 43, 43, 43, 43,
|
145
|
-
78, 78, 78, 78, 0, 0, 14, 15, 16, 17,
|
146
|
-
18, 19, 20, 21, 22, 23, 24, 26, 27, 28,
|
147
|
-
35, 37, 38, 39, 40, 41, 42, 44, 96, 98,
|
148
|
-
99, 100, 101, 102, 104, 105, 106, 108, 110, 111,
|
149
|
-
112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
|
150
|
-
122, 125, 126, 127, 137, 138, 141, 142, 143, 144,
|
151
|
-
145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
|
152
|
-
155, 156, 157, 158, 159, 160, 161, 162, 167, 169,
|
153
|
-
170, 174, 180, 182, 188 ]
|
154
|
-
|
155
|
-
racc_action_pointer = [
|
156
|
-
129, 41, 88, nil, nil, nil, 115, nil, -18, -2,
|
157
|
-
nil, 86, nil, 123, 136, 137, 138, 139, 140, 141,
|
158
|
-
142, 143, 144, 145, 146, nil, 147, 148, 149, 87,
|
159
|
-
nil, 60, 58, 92, 63, 149, 63, 150, 150, 146,
|
160
|
-
153, 148, 154, 101, 150, -18, -17, nil, nil, nil,
|
161
|
-
nil, nil, nil, nil, nil, nil, nil, 75, nil, nil,
|
162
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
163
|
-
nil, nil, nil, nil, nil, nil, nil, nil, 105, nil,
|
164
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
165
|
-
nil, nil, nil, nil, nil, nil, 163, nil, 164, 165,
|
166
|
-
166, 167, 168, nil, 169, 170, 171, nil, 172, nil,
|
167
|
-
173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
|
168
|
-
183, 184, 185, nil, nil, 186, 187, 188, nil, nil,
|
169
|
-
nil, nil, nil, nil, nil, nil, nil, 177, 178, 30,
|
170
|
-
36, 179, 180, 181, 182, 183, 184, 185, 186, 187,
|
171
|
-
188, 189, 190, 191, 192, 193, 203, 195, 196, 197,
|
172
|
-
198, 199, 200, nil, nil, nil, nil, 201, nil, 202,
|
173
|
-
203, nil, nil, nil, 204, nil, nil, nil, nil, nil,
|
174
|
-
205, nil, 206, nil, nil, nil, nil, nil, 207, nil,
|
175
|
-
nil, nil, nil, nil, nil ]
|
176
|
-
|
177
|
-
racc_action_default = [
|
178
|
-
-105, -105, -2, -3, -4, -6, -105, -1, -105, -105,
|
179
|
-
195, -105, -9, -105, -105, -105, -105, -105, -105, -17,
|
180
|
-
-105, -105, -105, -105, -105, -23, -105, -105, -105, -105,
|
181
|
-
-5, -105, -105, -105, -105, -105, -105, -105, -105, -105,
|
182
|
-
-105, -105, -105, -105, -105, -105, -105, -7, -8, -10,
|
183
|
-
-33, -34, -35, -11, -36, -37, -38, -12, -40, -41,
|
184
|
-
-42, -43, -44, -45, -13, -14, -46, -47, -48, -49,
|
185
|
-
-50, -51, -15, -16, -18, -19, -20, -21, -22, -28,
|
186
|
-
-29, -30, -31, -32, -24, -25, -52, -53, -54, -55,
|
187
|
-
-56, -57, -58, -59, -26, -60, -61, -64, -105, -105,
|
188
|
-
-105, -105, -105, -70, -105, -105, -105, -74, -105, -77,
|
189
|
-
-105, -105, -105, -105, -105, -105, -105, -105, -105, -105,
|
190
|
-
-105, -105, -105, -91, -92, -105, -105, -105, -98, -99,
|
191
|
-
-100, -101, -102, -103, -104, -39, -27, -105, -105, -105,
|
192
|
-
-105, -105, -105, -105, -105, -105, -105, -105, -105, -105,
|
193
|
-
-105, -105, -105, -105, -105, -105, -105, -105, -105, -105,
|
194
|
-
-105, -105, -105, -62, -65, -66, -67, -105, -69, -105,
|
195
|
-
-72, -97, -73, -75, -105, -79, -80, -81, -82, -83,
|
196
|
-
-105, -85, -86, -87, -88, -89, -90, -93, -94, -95,
|
197
|
-
-68, -71, -96, -78, -84 ]
|
198
|
-
|
199
|
-
racc_goto_table = [
|
200
|
-
97, 79, 58, 170, 3, 1, 7, 11, 29, 2,
|
201
|
-
8, 9, 48, 49, 182, 53, 107, 57, 65, 78,
|
202
|
-
188, 85, 94, nil, nil, 135, nil, nil, nil, nil,
|
203
|
-
nil, nil, nil, nil, nil, nil, 136, nil, nil, nil,
|
204
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
205
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
206
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
207
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
208
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
209
|
-
nil, 163, 164, nil, nil, 167, 168, 169, nil, 172,
|
210
|
-
173, 174, 175, 176, 177, 178, 179, 180, 181, 165,
|
211
|
-
166, 184, 185, 186, 187, nil, 189, nil, nil, nil,
|
212
|
-
nil, 190, nil, 191, 192, nil, nil, nil, 193, nil,
|
213
|
-
nil, nil, nil, nil, 194, nil, 192, nil, nil, nil,
|
214
|
-
nil, nil, 192 ]
|
215
|
-
|
216
|
-
racc_goto_check = [
|
217
|
-
17, 15, 16, 19, 3, 1, 3, 4, 4, 2,
|
218
|
-
5, 6, 7, 8, 19, 9, 18, 10, 11, 12,
|
219
|
-
19, 13, 14, nil, nil, 16, nil, nil, nil, nil,
|
220
|
-
nil, nil, nil, nil, nil, nil, 15, nil, nil, nil,
|
221
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
222
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
223
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
224
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
225
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
226
|
-
nil, 17, 17, nil, nil, 17, 17, 17, nil, 17,
|
227
|
-
17, 17, 17, 17, 17, 17, 17, 17, 17, 18,
|
228
|
-
18, 17, 17, 17, 17, nil, 17, nil, nil, nil,
|
229
|
-
nil, 17, nil, 17, 17, nil, nil, nil, 17, nil,
|
230
|
-
nil, nil, nil, nil, 17, nil, 17, nil, nil, nil,
|
231
|
-
nil, nil, 17 ]
|
232
|
-
|
233
|
-
racc_goto_pointer = [
|
234
|
-
nil, 5, 9, 4, -1, 6, 6, -19, -19, -18,
|
235
|
-
-17, -18, -24, -24, -24, -42, -32, -46, -30, -141 ]
|
236
|
-
|
237
|
-
racc_goto_default = [
|
238
|
-
nil, nil, nil, nil, nil, nil, nil, 12, nil, nil,
|
239
|
-
nil, nil, nil, nil, nil, nil, nil, 171, nil, nil ]
|
240
|
-
|
241
|
-
racc_reduce_table = [
|
242
|
-
0, 0, :racc_error,
|
243
|
-
2, 97, :_reduce_none,
|
244
|
-
1, 97, :_reduce_none,
|
245
|
-
1, 97, :_reduce_none,
|
246
|
-
0, 101, :_reduce_4,
|
247
|
-
4, 98, :_reduce_5,
|
248
|
-
0, 102, :_reduce_6,
|
249
|
-
4, 99, :_reduce_none,
|
250
|
-
3, 100, :_reduce_none,
|
251
|
-
1, 100, :_reduce_none,
|
252
|
-
3, 103, :_reduce_10,
|
253
|
-
3, 103, :_reduce_11,
|
254
|
-
3, 103, :_reduce_none,
|
255
|
-
3, 103, :_reduce_13,
|
256
|
-
3, 103, :_reduce_14,
|
257
|
-
3, 103, :_reduce_15,
|
258
|
-
3, 103, :_reduce_16,
|
259
|
-
1, 103, :_reduce_17,
|
260
|
-
3, 103, :_reduce_18,
|
261
|
-
3, 103, :_reduce_19,
|
262
|
-
3, 103, :_reduce_20,
|
263
|
-
3, 103, :_reduce_21,
|
264
|
-
3, 103, :_reduce_none,
|
265
|
-
1, 103, :_reduce_23,
|
266
|
-
3, 103, :_reduce_24,
|
267
|
-
3, 103, :_reduce_25,
|
268
|
-
3, 103, :_reduce_26,
|
269
|
-
2, 108, :_reduce_none,
|
270
|
-
1, 108, :_reduce_28,
|
271
|
-
1, 111, :_reduce_none,
|
272
|
-
1, 111, :_reduce_none,
|
273
|
-
1, 111, :_reduce_none,
|
274
|
-
1, 111, :_reduce_none,
|
275
|
-
1, 104, :_reduce_none,
|
276
|
-
1, 104, :_reduce_none,
|
277
|
-
1, 104, :_reduce_none,
|
278
|
-
1, 105, :_reduce_none,
|
279
|
-
1, 105, :_reduce_none,
|
280
|
-
1, 105, :_reduce_none,
|
281
|
-
2, 106, :_reduce_none,
|
282
|
-
1, 106, :_reduce_40,
|
283
|
-
1, 112, :_reduce_none,
|
284
|
-
1, 112, :_reduce_none,
|
285
|
-
1, 112, :_reduce_none,
|
286
|
-
1, 112, :_reduce_none,
|
287
|
-
1, 112, :_reduce_none,
|
288
|
-
1, 107, :_reduce_none,
|
289
|
-
1, 107, :_reduce_none,
|
290
|
-
1, 107, :_reduce_none,
|
291
|
-
1, 107, :_reduce_none,
|
292
|
-
1, 107, :_reduce_none,
|
293
|
-
1, 107, :_reduce_none,
|
294
|
-
1, 109, :_reduce_none,
|
295
|
-
1, 109, :_reduce_none,
|
296
|
-
1, 109, :_reduce_none,
|
297
|
-
1, 109, :_reduce_none,
|
298
|
-
1, 109, :_reduce_none,
|
299
|
-
1, 109, :_reduce_none,
|
300
|
-
1, 109, :_reduce_none,
|
301
|
-
1, 109, :_reduce_none,
|
302
|
-
1, 110, :_reduce_none,
|
303
|
-
1, 110, :_reduce_none,
|
304
|
-
3, 110, :_reduce_none,
|
305
|
-
3, 110, :_reduce_none,
|
306
|
-
1, 110, :_reduce_none,
|
307
|
-
3, 110, :_reduce_none,
|
308
|
-
3, 110, :_reduce_none,
|
309
|
-
3, 110, :_reduce_none,
|
310
|
-
4, 110, :_reduce_none,
|
311
|
-
3, 110, :_reduce_none,
|
312
|
-
1, 110, :_reduce_none,
|
313
|
-
4, 110, :_reduce_none,
|
314
|
-
3, 110, :_reduce_none,
|
315
|
-
3, 110, :_reduce_none,
|
316
|
-
1, 110, :_reduce_none,
|
317
|
-
3, 110, :_reduce_none,
|
318
|
-
1, 110, :_reduce_none,
|
319
|
-
1, 110, :_reduce_none,
|
320
|
-
4, 110, :_reduce_none,
|
321
|
-
3, 110, :_reduce_none,
|
322
|
-
3, 110, :_reduce_none,
|
323
|
-
3, 110, :_reduce_none,
|
324
|
-
3, 110, :_reduce_none,
|
325
|
-
3, 110, :_reduce_none,
|
326
|
-
4, 110, :_reduce_none,
|
327
|
-
3, 110, :_reduce_none,
|
328
|
-
3, 110, :_reduce_none,
|
329
|
-
3, 110, :_reduce_none,
|
330
|
-
3, 110, :_reduce_none,
|
331
|
-
3, 110, :_reduce_none,
|
332
|
-
3, 110, :_reduce_none,
|
333
|
-
1, 110, :_reduce_none,
|
334
|
-
1, 110, :_reduce_none,
|
335
|
-
3, 110, :_reduce_none,
|
336
|
-
3, 110, :_reduce_none,
|
337
|
-
3, 110, :_reduce_none,
|
338
|
-
2, 115, :_reduce_none,
|
339
|
-
1, 115, :_reduce_none,
|
340
|
-
1, 113, :_reduce_none,
|
341
|
-
1, 114, :_reduce_none,
|
342
|
-
1, 114, :_reduce_none,
|
343
|
-
1, 114, :_reduce_none,
|
344
|
-
1, 114, :_reduce_none,
|
345
|
-
1, 114, :_reduce_none,
|
346
|
-
1, 114, :_reduce_none ]
|
347
|
-
|
348
|
-
racc_reduce_n = 105
|
349
|
-
|
350
|
-
racc_shift_n = 195
|
351
|
-
|
352
|
-
racc_token_table = {
|
353
|
-
false => 0,
|
354
|
-
:error => 1,
|
355
|
-
"![[" => 2,
|
356
|
-
"[[" => 3,
|
357
|
-
"]]" => 4,
|
358
|
-
":" => 5,
|
359
|
-
"=" => 6,
|
360
|
-
"/" => 7,
|
361
|
-
:A1_NOTATION => 8,
|
362
|
-
:END_MODIFIERS => 9,
|
363
|
-
:EQ => 10,
|
364
|
-
:HEX_COLOR => 11,
|
365
|
-
:NUMBER => 12,
|
366
|
-
:MODIFIER_ID => 13,
|
367
|
-
:MODIFIER_SEPARATOR => 14,
|
368
|
-
:START_CELL_MODIFIERS => 15,
|
369
|
-
:START_ROW_MODIFIERS => 16,
|
370
|
-
:STRING => 17,
|
371
|
-
:URL => 18,
|
372
|
-
"halign" => 19,
|
373
|
-
"valign" => 20,
|
374
|
-
"border" => 21,
|
375
|
-
"bordercolor" => 22,
|
376
|
-
"borderstyle" => 23,
|
377
|
-
"color" => 24,
|
378
|
-
"expand" => 25,
|
379
|
-
"font" => 26,
|
380
|
-
"fontcolor" => 27,
|
381
|
-
"fontfamily" => 28,
|
382
|
-
"fontsize" => 29,
|
383
|
-
"format" => 30,
|
384
|
-
"freeze" => 31,
|
385
|
-
"note" => 32,
|
386
|
-
"numberformat" => 33,
|
387
|
-
"validate" => 34,
|
388
|
-
"bold" => 35,
|
389
|
-
"italic" => 36,
|
390
|
-
"strikethrough" => 37,
|
391
|
-
"underline" => 38,
|
392
|
-
"left" => 39,
|
393
|
-
"center" => 40,
|
394
|
-
"right" => 41,
|
395
|
-
"top" => 42,
|
396
|
-
"bottom" => 43,
|
397
|
-
"all" => 44,
|
398
|
-
"dashed" => 45,
|
399
|
-
"dotted" => 46,
|
400
|
-
"double" => 47,
|
401
|
-
"solid" => 48,
|
402
|
-
"solid_medium" => 49,
|
403
|
-
"solid_thick" => 50,
|
404
|
-
"currency" => 51,
|
405
|
-
"date" => 52,
|
406
|
-
"date_time" => 53,
|
407
|
-
"number" => 54,
|
408
|
-
"percent" => 55,
|
409
|
-
"text" => 56,
|
410
|
-
"time" => 57,
|
411
|
-
"scientific" => 58,
|
412
|
-
"blank" => 59,
|
413
|
-
"boolean" => 60,
|
414
|
-
"custom_formula" => 61,
|
415
|
-
"date_after" => 62,
|
416
|
-
"date_before" => 63,
|
417
|
-
"date_between" => 64,
|
418
|
-
"date_eq" => 65,
|
419
|
-
"date_is_valid" => 66,
|
420
|
-
"date_not_between" => 67,
|
421
|
-
"date_not_eq" => 68,
|
422
|
-
"date_on_or_after" => 69,
|
423
|
-
"date_on_or_before" => 70,
|
424
|
-
"not_blank" => 71,
|
425
|
-
"number_between" => 72,
|
426
|
-
"number_eq" => 73,
|
427
|
-
"number_greater" => 74,
|
428
|
-
"number_greater_than_eq" => 75,
|
429
|
-
"number_less" => 76,
|
430
|
-
"number_less_than_eq" => 77,
|
431
|
-
"number_not_between" => 78,
|
432
|
-
"number_not_eq" => 79,
|
433
|
-
"one_of_list" => 80,
|
434
|
-
"one_of_range" => 81,
|
435
|
-
"text_contains" => 82,
|
436
|
-
"text_ends_with" => 83,
|
437
|
-
"text_eq" => 84,
|
438
|
-
"text_is_email" => 85,
|
439
|
-
"text_is_url" => 86,
|
440
|
-
"text_not_contains" => 87,
|
441
|
-
"text_not_eq" => 88,
|
442
|
-
"text_starts_with" => 89,
|
443
|
-
"past_year" => 90,
|
444
|
-
"past_month" => 91,
|
445
|
-
"past_week" => 92,
|
446
|
-
"yesterday" => 93,
|
447
|
-
"today" => 94,
|
448
|
-
"tomorrow" => 95 }
|
449
|
-
|
450
|
-
racc_nt_base = 96
|
451
|
-
|
452
|
-
racc_use_result_var = true
|
453
|
-
|
454
|
-
Racc_arg = [
|
455
|
-
racc_action_table,
|
456
|
-
racc_action_check,
|
457
|
-
racc_action_default,
|
458
|
-
racc_action_pointer,
|
459
|
-
racc_goto_table,
|
460
|
-
racc_goto_check,
|
461
|
-
racc_goto_default,
|
462
|
-
racc_goto_pointer,
|
463
|
-
racc_nt_base,
|
464
|
-
racc_reduce_table,
|
465
|
-
racc_token_table,
|
466
|
-
racc_shift_n,
|
467
|
-
racc_reduce_n,
|
468
|
-
racc_use_result_var ]
|
469
|
-
|
470
|
-
Racc_token_to_s_table = [
|
471
|
-
"$end",
|
472
|
-
"error",
|
473
|
-
"\"![[\"",
|
474
|
-
"\"[[\"",
|
475
|
-
"\"]]\"",
|
476
|
-
"\":\"",
|
477
|
-
"\"=\"",
|
478
|
-
"\"/\"",
|
479
|
-
"A1_NOTATION",
|
480
|
-
"END_MODIFIERS",
|
481
|
-
"EQ",
|
482
|
-
"HEX_COLOR",
|
483
|
-
"NUMBER",
|
484
|
-
"MODIFIER_ID",
|
485
|
-
"MODIFIER_SEPARATOR",
|
486
|
-
"START_CELL_MODIFIERS",
|
487
|
-
"START_ROW_MODIFIERS",
|
488
|
-
"STRING",
|
489
|
-
"URL",
|
490
|
-
"\"halign\"",
|
491
|
-
"\"valign\"",
|
492
|
-
"\"border\"",
|
493
|
-
"\"bordercolor\"",
|
494
|
-
"\"borderstyle\"",
|
495
|
-
"\"color\"",
|
496
|
-
"\"expand\"",
|
497
|
-
"\"font\"",
|
498
|
-
"\"fontcolor\"",
|
499
|
-
"\"fontfamily\"",
|
500
|
-
"\"fontsize\"",
|
501
|
-
"\"format\"",
|
502
|
-
"\"freeze\"",
|
503
|
-
"\"note\"",
|
504
|
-
"\"numberformat\"",
|
505
|
-
"\"validate\"",
|
506
|
-
"\"bold\"",
|
507
|
-
"\"italic\"",
|
508
|
-
"\"strikethrough\"",
|
509
|
-
"\"underline\"",
|
510
|
-
"\"left\"",
|
511
|
-
"\"center\"",
|
512
|
-
"\"right\"",
|
513
|
-
"\"top\"",
|
514
|
-
"\"bottom\"",
|
515
|
-
"\"all\"",
|
516
|
-
"\"dashed\"",
|
517
|
-
"\"dotted\"",
|
518
|
-
"\"double\"",
|
519
|
-
"\"solid\"",
|
520
|
-
"\"solid_medium\"",
|
521
|
-
"\"solid_thick\"",
|
522
|
-
"\"currency\"",
|
523
|
-
"\"date\"",
|
524
|
-
"\"date_time\"",
|
525
|
-
"\"number\"",
|
526
|
-
"\"percent\"",
|
527
|
-
"\"text\"",
|
528
|
-
"\"time\"",
|
529
|
-
"\"scientific\"",
|
530
|
-
"\"blank\"",
|
531
|
-
"\"boolean\"",
|
532
|
-
"\"custom_formula\"",
|
533
|
-
"\"date_after\"",
|
534
|
-
"\"date_before\"",
|
535
|
-
"\"date_between\"",
|
536
|
-
"\"date_eq\"",
|
537
|
-
"\"date_is_valid\"",
|
538
|
-
"\"date_not_between\"",
|
539
|
-
"\"date_not_eq\"",
|
540
|
-
"\"date_on_or_after\"",
|
541
|
-
"\"date_on_or_before\"",
|
542
|
-
"\"not_blank\"",
|
543
|
-
"\"number_between\"",
|
544
|
-
"\"number_eq\"",
|
545
|
-
"\"number_greater\"",
|
546
|
-
"\"number_greater_than_eq\"",
|
547
|
-
"\"number_less\"",
|
548
|
-
"\"number_less_than_eq\"",
|
549
|
-
"\"number_not_between\"",
|
550
|
-
"\"number_not_eq\"",
|
551
|
-
"\"one_of_list\"",
|
552
|
-
"\"one_of_range\"",
|
553
|
-
"\"text_contains\"",
|
554
|
-
"\"text_ends_with\"",
|
555
|
-
"\"text_eq\"",
|
556
|
-
"\"text_is_email\"",
|
557
|
-
"\"text_is_url\"",
|
558
|
-
"\"text_not_contains\"",
|
559
|
-
"\"text_not_eq\"",
|
560
|
-
"\"text_starts_with\"",
|
561
|
-
"\"past_year\"",
|
562
|
-
"\"past_month\"",
|
563
|
-
"\"past_week\"",
|
564
|
-
"\"yesterday\"",
|
565
|
-
"\"today\"",
|
566
|
-
"\"tomorrow\"",
|
567
|
-
"$start",
|
568
|
-
"modifiers_definition",
|
569
|
-
"row_modifiers",
|
570
|
-
"cell_modifiers",
|
571
|
-
"modifiers",
|
572
|
-
"@1",
|
573
|
-
"@2",
|
574
|
-
"modifier",
|
575
|
-
"halign_option",
|
576
|
-
"valign_option",
|
577
|
-
"border_options",
|
578
|
-
"borderstyle_option",
|
579
|
-
"format_options",
|
580
|
-
"numberformat_option",
|
581
|
-
"condition",
|
582
|
-
"format_option",
|
583
|
-
"border_option",
|
584
|
-
"condition_value",
|
585
|
-
"relative_date",
|
586
|
-
"condition_values" ]
|
587
|
-
|
588
|
-
Racc_debug_parser = false
|
589
|
-
|
590
|
-
##### State transition tables end #####
|
591
|
-
|
592
|
-
# reduce 0 omitted
|
593
|
-
|
594
|
-
# reduce 1 omitted
|
595
|
-
|
596
|
-
# reduce 2 omitted
|
597
|
-
|
598
|
-
# reduce 3 omitted
|
599
|
-
|
600
|
-
module_eval(<<'.,.,', 'modifier.y', 26)
|
601
|
-
def _reduce_4(val, _values, result)
|
602
|
-
parsing_row!
|
603
|
-
result
|
604
|
-
end
|
605
|
-
.,.,
|
606
|
-
|
607
|
-
module_eval(<<'.,.,', 'modifier.y', 28)
|
608
|
-
def _reduce_5(val, _values, result)
|
609
|
-
finished_row!
|
610
|
-
result
|
611
|
-
end
|
612
|
-
.,.,
|
613
|
-
|
614
|
-
module_eval(<<'.,.,', 'modifier.y', 30)
|
615
|
-
def _reduce_6(val, _values, result)
|
616
|
-
parsing_cell!
|
617
|
-
result
|
618
|
-
end
|
619
|
-
.,.,
|
620
|
-
|
621
|
-
# reduce 7 omitted
|
622
|
-
|
623
|
-
# reduce 8 omitted
|
624
|
-
|
625
|
-
# reduce 9 omitted
|
626
|
-
|
627
|
-
module_eval(<<'.,.,', 'modifier.y', 36)
|
628
|
-
def _reduce_10(val, _values, result)
|
629
|
-
s!(:halign, val[2])
|
630
|
-
result
|
631
|
-
end
|
632
|
-
.,.,
|
633
|
-
|
634
|
-
module_eval(<<'.,.,', 'modifier.y', 37)
|
635
|
-
def _reduce_11(val, _values, result)
|
636
|
-
s!(:valign, val[2])
|
637
|
-
result
|
638
|
-
end
|
639
|
-
.,.,
|
640
|
-
|
641
|
-
# reduce 12 omitted
|
642
|
-
|
643
|
-
module_eval(<<'.,.,', 'modifier.y', 39)
|
644
|
-
def _reduce_13(val, _values, result)
|
645
|
-
s!(:bordercolor, val[2])
|
646
|
-
result
|
647
|
-
end
|
648
|
-
.,.,
|
649
|
-
|
650
|
-
module_eval(<<'.,.,', 'modifier.y', 40)
|
651
|
-
def _reduce_14(val, _values, result)
|
652
|
-
s!(:borderstyle, val[2])
|
653
|
-
result
|
654
|
-
end
|
655
|
-
.,.,
|
656
|
-
|
657
|
-
module_eval(<<'.,.,', 'modifier.y', 41)
|
658
|
-
def _reduce_15(val, _values, result)
|
659
|
-
s!(:color, val[2])
|
660
|
-
result
|
661
|
-
end
|
662
|
-
.,.,
|
663
|
-
|
664
|
-
module_eval(<<'.,.,', 'modifier.y', 42)
|
665
|
-
def _reduce_16(val, _values, result)
|
666
|
-
s!(:expand, Expand.new(val[2].to_i))
|
667
|
-
result
|
668
|
-
end
|
669
|
-
.,.,
|
670
|
-
|
671
|
-
module_eval(<<'.,.,', 'modifier.y', 43)
|
672
|
-
def _reduce_17(val, _values, result)
|
673
|
-
s!(:expand, Expand.new)
|
674
|
-
result
|
675
|
-
end
|
676
|
-
.,.,
|
677
|
-
|
678
|
-
module_eval(<<'.,.,', 'modifier.y', 44)
|
679
|
-
def _reduce_18(val, _values, result)
|
680
|
-
s!(:fontfamily, val[2])
|
681
|
-
result
|
682
|
-
end
|
683
|
-
.,.,
|
684
|
-
|
685
|
-
module_eval(<<'.,.,', 'modifier.y', 45)
|
686
|
-
def _reduce_19(val, _values, result)
|
687
|
-
s!(:fontcolor, val[2])
|
688
|
-
result
|
689
|
-
end
|
690
|
-
.,.,
|
691
|
-
|
692
|
-
module_eval(<<'.,.,', 'modifier.y', 46)
|
693
|
-
def _reduce_20(val, _values, result)
|
694
|
-
s!(:fontfamily, val[2])
|
695
|
-
result
|
696
|
-
end
|
697
|
-
.,.,
|
698
|
-
|
699
|
-
module_eval(<<'.,.,', 'modifier.y', 47)
|
700
|
-
def _reduce_21(val, _values, result)
|
701
|
-
s!(:fontsize, val[2].to_f)
|
702
|
-
result
|
703
|
-
end
|
704
|
-
.,.,
|
705
|
-
|
706
|
-
# reduce 22 omitted
|
707
|
-
|
708
|
-
module_eval(<<'.,.,', 'modifier.y', 49)
|
709
|
-
def _reduce_23(val, _values, result)
|
710
|
-
freeze!
|
711
|
-
result
|
712
|
-
end
|
713
|
-
.,.,
|
714
|
-
|
715
|
-
module_eval(<<'.,.,', 'modifier.y', 50)
|
716
|
-
def _reduce_24(val, _values, result)
|
717
|
-
s!(:note, val[2])
|
718
|
-
result
|
719
|
-
end
|
720
|
-
.,.,
|
721
|
-
|
722
|
-
module_eval(<<'.,.,', 'modifier.y', 51)
|
723
|
-
def _reduce_25(val, _values, result)
|
724
|
-
s!(:numberformat, val[2])
|
725
|
-
result
|
726
|
-
end
|
727
|
-
.,.,
|
728
|
-
|
729
|
-
module_eval(<<'.,.,', 'modifier.y', 52)
|
730
|
-
def _reduce_26(val, _values, result)
|
731
|
-
s!(:validation, val[2])
|
732
|
-
result
|
733
|
-
end
|
734
|
-
.,.,
|
735
|
-
|
736
|
-
# reduce 27 omitted
|
737
|
-
|
738
|
-
module_eval(<<'.,.,', 'modifier.y', 54)
|
739
|
-
def _reduce_28(val, _values, result)
|
740
|
-
s!(:format, val[0])
|
741
|
-
result
|
742
|
-
end
|
743
|
-
.,.,
|
744
|
-
|
745
|
-
# reduce 29 omitted
|
746
|
-
|
747
|
-
# reduce 30 omitted
|
748
|
-
|
749
|
-
# reduce 31 omitted
|
750
|
-
|
751
|
-
# reduce 32 omitted
|
752
|
-
|
753
|
-
# reduce 33 omitted
|
754
|
-
|
755
|
-
# reduce 34 omitted
|
756
|
-
|
757
|
-
# reduce 35 omitted
|
758
|
-
|
759
|
-
# reduce 36 omitted
|
760
|
-
|
761
|
-
# reduce 37 omitted
|
762
|
-
|
763
|
-
# reduce 38 omitted
|
764
|
-
|
765
|
-
# reduce 39 omitted
|
766
|
-
|
767
|
-
module_eval(<<'.,.,', 'modifier.y', 60)
|
768
|
-
def _reduce_40(val, _values, result)
|
769
|
-
s!(:border, val[0])
|
770
|
-
result
|
771
|
-
end
|
772
|
-
.,.,
|
773
|
-
|
774
|
-
# reduce 41 omitted
|
775
|
-
|
776
|
-
# reduce 42 omitted
|
777
|
-
|
778
|
-
# reduce 43 omitted
|
779
|
-
|
780
|
-
# reduce 44 omitted
|
781
|
-
|
782
|
-
# reduce 45 omitted
|
783
|
-
|
784
|
-
# reduce 46 omitted
|
785
|
-
|
786
|
-
# reduce 47 omitted
|
787
|
-
|
788
|
-
# reduce 48 omitted
|
789
|
-
|
790
|
-
# reduce 49 omitted
|
791
|
-
|
792
|
-
# reduce 50 omitted
|
793
|
-
|
794
|
-
# reduce 51 omitted
|
795
|
-
|
796
|
-
# reduce 52 omitted
|
797
|
-
|
798
|
-
# reduce 53 omitted
|
799
|
-
|
800
|
-
# reduce 54 omitted
|
801
|
-
|
802
|
-
# reduce 55 omitted
|
803
|
-
|
804
|
-
# reduce 56 omitted
|
805
|
-
|
806
|
-
# reduce 57 omitted
|
807
|
-
|
808
|
-
# reduce 58 omitted
|
809
|
-
|
810
|
-
# reduce 59 omitted
|
811
|
-
|
812
|
-
# reduce 60 omitted
|
813
|
-
|
814
|
-
# reduce 61 omitted
|
815
|
-
|
816
|
-
# reduce 62 omitted
|
817
|
-
|
818
|
-
# reduce 63 omitted
|
819
|
-
|
820
|
-
# reduce 64 omitted
|
821
|
-
|
822
|
-
# reduce 65 omitted
|
823
|
-
|
824
|
-
# reduce 66 omitted
|
825
|
-
|
826
|
-
# reduce 67 omitted
|
827
|
-
|
828
|
-
# reduce 68 omitted
|
829
|
-
|
830
|
-
# reduce 69 omitted
|
831
|
-
|
832
|
-
# reduce 70 omitted
|
833
|
-
|
834
|
-
# reduce 71 omitted
|
835
|
-
|
836
|
-
# reduce 72 omitted
|
837
|
-
|
838
|
-
# reduce 73 omitted
|
839
|
-
|
840
|
-
# reduce 74 omitted
|
841
|
-
|
842
|
-
# reduce 75 omitted
|
843
|
-
|
844
|
-
# reduce 76 omitted
|
845
|
-
|
846
|
-
# reduce 77 omitted
|
847
|
-
|
848
|
-
# reduce 78 omitted
|
849
|
-
|
850
|
-
# reduce 79 omitted
|
851
|
-
|
852
|
-
# reduce 80 omitted
|
853
|
-
|
854
|
-
# reduce 81 omitted
|
855
|
-
|
856
|
-
# reduce 82 omitted
|
857
|
-
|
858
|
-
# reduce 83 omitted
|
859
|
-
|
860
|
-
# reduce 84 omitted
|
861
|
-
|
862
|
-
# reduce 85 omitted
|
863
|
-
|
864
|
-
# reduce 86 omitted
|
865
|
-
|
866
|
-
# reduce 87 omitted
|
867
|
-
|
868
|
-
# reduce 88 omitted
|
869
|
-
|
870
|
-
# reduce 89 omitted
|
871
|
-
|
872
|
-
# reduce 90 omitted
|
873
|
-
|
874
|
-
# reduce 91 omitted
|
875
|
-
|
876
|
-
# reduce 92 omitted
|
877
|
-
|
878
|
-
# reduce 93 omitted
|
879
|
-
|
880
|
-
# reduce 94 omitted
|
881
|
-
|
882
|
-
# reduce 95 omitted
|
883
|
-
|
884
|
-
# reduce 96 omitted
|
885
|
-
|
886
|
-
# reduce 97 omitted
|
887
|
-
|
888
|
-
# reduce 98 omitted
|
889
|
-
|
890
|
-
# reduce 99 omitted
|
891
|
-
|
892
|
-
# reduce 100 omitted
|
893
|
-
|
894
|
-
# reduce 101 omitted
|
895
|
-
|
896
|
-
# reduce 102 omitted
|
897
|
-
|
898
|
-
# reduce 103 omitted
|
899
|
-
|
900
|
-
# reduce 104 omitted
|
901
|
-
|
902
|
-
def _reduce_none(val, _values, result)
|
903
|
-
val[0]
|
904
|
-
end
|
905
|
-
|
906
|
-
end # class ModifierParser
|
907
|
-
end # module CSVPlusPlus
|