logstash-core 5.6.16-java → 6.0.0.alpha1-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/gemspec_jars.rb +4 -7
- data/lib/logstash-core/logstash-core.jar +0 -0
- data/lib/logstash-core/version.rb +4 -8
- data/lib/logstash-core_jars.rb +12 -26
- data/lib/logstash/agent.rb +261 -246
- data/lib/logstash/api/commands/default_metadata.rb +1 -1
- data/lib/logstash/api/commands/hot_threads_reporter.rb +5 -11
- data/lib/logstash/api/commands/node.rb +3 -2
- data/lib/logstash/api/commands/stats.rb +3 -2
- data/lib/logstash/bootstrap_check/bad_java.rb +16 -0
- data/lib/logstash/bootstrap_check/bad_ruby.rb +12 -0
- data/lib/logstash/bootstrap_check/default_config.rb +17 -0
- data/lib/logstash/compiler.rb +38 -0
- data/lib/logstash/compiler/lscl.rb +566 -0
- data/lib/logstash/compiler/lscl/lscl_grammar.rb +3503 -0
- data/lib/logstash/compiler/treetop_monkeypatches.rb +92 -0
- data/lib/logstash/config/config_ast.rb +4 -82
- data/lib/logstash/config/mixin.rb +73 -41
- data/lib/logstash/config/pipeline_config.rb +48 -0
- data/lib/logstash/config/source/base.rb +16 -0
- data/lib/logstash/config/source/local.rb +215 -0
- data/lib/logstash/config/source_loader.rb +125 -0
- data/lib/logstash/converge_result.rb +103 -0
- data/lib/logstash/environment.rb +6 -19
- data/lib/logstash/errors.rb +2 -0
- data/lib/logstash/execution_context.rb +4 -7
- data/lib/logstash/filter_delegator.rb +6 -9
- data/lib/logstash/inputs/base.rb +0 -2
- data/lib/logstash/instrument/collector.rb +5 -7
- data/lib/logstash/instrument/metric_store.rb +12 -12
- data/lib/logstash/instrument/metric_type/mean.rb +0 -5
- data/lib/logstash/instrument/namespaced_metric.rb +0 -4
- data/lib/logstash/instrument/namespaced_null_metric.rb +0 -4
- data/lib/logstash/instrument/null_metric.rb +0 -10
- data/lib/logstash/instrument/periodic_poller/cgroup.rb +85 -168
- data/lib/logstash/instrument/periodic_poller/jvm.rb +5 -5
- data/lib/logstash/instrument/periodic_poller/pq.rb +3 -7
- data/lib/logstash/instrument/periodic_pollers.rb +1 -3
- data/lib/logstash/instrument/wrapped_write_client.rb +24 -33
- data/lib/logstash/logging/logger.rb +15 -47
- data/lib/logstash/namespace.rb +0 -1
- data/lib/logstash/output_delegator.rb +5 -7
- data/lib/logstash/outputs/base.rb +0 -2
- data/lib/logstash/pipeline.rb +159 -87
- data/lib/logstash/pipeline_action.rb +13 -0
- data/lib/logstash/pipeline_action/base.rb +29 -0
- data/lib/logstash/pipeline_action/create.rb +47 -0
- data/lib/logstash/pipeline_action/reload.rb +48 -0
- data/lib/logstash/pipeline_action/stop.rb +23 -0
- data/lib/logstash/plugin.rb +0 -1
- data/lib/logstash/plugins/hooks_registry.rb +6 -0
- data/lib/logstash/plugins/registry.rb +0 -1
- data/lib/logstash/program.rb +14 -0
- data/lib/logstash/queue_factory.rb +5 -1
- data/lib/logstash/runner.rb +58 -80
- data/lib/logstash/settings.rb +3 -27
- data/lib/logstash/state_resolver.rb +41 -0
- data/lib/logstash/util/java_version.rb +6 -0
- data/lib/logstash/util/safe_uri.rb +12 -148
- data/lib/logstash/util/thread_dump.rb +4 -7
- data/lib/logstash/util/wrapped_acked_queue.rb +36 -39
- data/lib/logstash/util/wrapped_synchronous_queue.rb +29 -39
- data/lib/logstash/version.rb +10 -8
- data/locales/en.yml +3 -54
- data/logstash-core.gemspec +8 -35
- data/spec/{logstash/api/modules → api/lib/api}/logging_spec.rb +10 -1
- data/spec/{logstash/api/modules → api/lib/api}/node_plugins_spec.rb +2 -1
- data/spec/{logstash/api/modules → api/lib/api}/node_spec.rb +3 -3
- data/spec/{logstash/api/modules → api/lib/api}/node_stats_spec.rb +3 -7
- data/spec/{logstash/api/modules → api/lib/api}/plugins_spec.rb +3 -4
- data/spec/{logstash/api/modules → api/lib/api}/root_spec.rb +2 -2
- data/spec/api/lib/api/support/resource_dsl_methods.rb +87 -0
- data/spec/{logstash/api/commands/stats_spec.rb → api/lib/commands/stats.rb} +2 -7
- data/spec/{logstash/api → api/lib}/errors_spec.rb +1 -1
- data/spec/{logstash/api → api/lib}/rack_app_spec.rb +0 -0
- data/spec/api/spec_helper.rb +106 -0
- data/spec/logstash/agent/converge_spec.rb +286 -0
- data/spec/logstash/agent/metrics_spec.rb +244 -0
- data/spec/logstash/agent_spec.rb +213 -225
- data/spec/logstash/compiler/compiler_spec.rb +584 -0
- data/spec/logstash/config/config_ast_spec.rb +8 -47
- data/spec/logstash/config/mixin_spec.rb +2 -42
- data/spec/logstash/config/pipeline_config_spec.rb +75 -0
- data/spec/logstash/config/source/local_spec.rb +395 -0
- data/spec/logstash/config/source_loader_spec.rb +122 -0
- data/spec/logstash/converge_result_spec.rb +179 -0
- data/spec/logstash/event_spec.rb +0 -66
- data/spec/logstash/execution_context_spec.rb +8 -12
- data/spec/logstash/filter_delegator_spec.rb +12 -24
- data/spec/logstash/inputs/base_spec.rb +7 -5
- data/spec/logstash/instrument/periodic_poller/cgroup_spec.rb +92 -225
- data/spec/logstash/instrument/periodic_poller/jvm_spec.rb +1 -1
- data/spec/logstash/instrument/periodic_poller/os_spec.rb +32 -29
- data/spec/logstash/instrument/wrapped_write_client_spec.rb +33 -33
- data/spec/logstash/legacy_ruby_event_spec.rb +13 -4
- data/spec/logstash/output_delegator_spec.rb +11 -20
- data/spec/logstash/outputs/base_spec.rb +7 -5
- data/spec/logstash/pipeline_action/create_spec.rb +83 -0
- data/spec/logstash/pipeline_action/reload_spec.rb +83 -0
- data/spec/logstash/pipeline_action/stop_spec.rb +37 -0
- data/spec/logstash/pipeline_pq_file_spec.rb +1 -1
- data/spec/logstash/pipeline_spec.rb +81 -137
- data/spec/logstash/plugin_spec.rb +2 -1
- data/spec/logstash/plugins/hooks_registry_spec.rb +6 -0
- data/spec/logstash/queue_factory_spec.rb +13 -1
- data/spec/logstash/runner_spec.rb +29 -140
- data/spec/logstash/settings/writable_directory_spec.rb +10 -13
- data/spec/logstash/settings_spec.rb +0 -91
- data/spec/logstash/state_resolver_spec.rb +156 -0
- data/spec/logstash/timestamp_spec.rb +2 -6
- data/spec/logstash/util/java_version_spec.rb +22 -0
- data/spec/logstash/util/safe_uri_spec.rb +0 -56
- data/spec/logstash/util/wrapped_synchronous_queue_spec.rb +22 -0
- data/spec/support/helpers.rb +9 -11
- data/spec/support/matchers.rb +96 -6
- data/spec/support/mocks_classes.rb +80 -0
- data/spec/support/shared_contexts.rb +2 -27
- metadata +100 -149
- data/lib/logstash/config/loader.rb +0 -107
- data/lib/logstash/config/modules_common.rb +0 -103
- data/lib/logstash/config/source/modules.rb +0 -55
- data/lib/logstash/config/string_escape.rb +0 -27
- data/lib/logstash/dependency_report.rb +0 -131
- data/lib/logstash/dependency_report_runner.rb +0 -17
- data/lib/logstash/elasticsearch_client.rb +0 -142
- data/lib/logstash/instrument/global_metrics.rb +0 -13
- data/lib/logstash/instrument/periodic_poller/dlq.rb +0 -24
- data/lib/logstash/modules/cli_parser.rb +0 -74
- data/lib/logstash/modules/elasticsearch_config.rb +0 -22
- data/lib/logstash/modules/elasticsearch_importer.rb +0 -37
- data/lib/logstash/modules/elasticsearch_resource.rb +0 -10
- data/lib/logstash/modules/file_reader.rb +0 -36
- data/lib/logstash/modules/kibana_base.rb +0 -24
- data/lib/logstash/modules/kibana_client.rb +0 -124
- data/lib/logstash/modules/kibana_config.rb +0 -105
- data/lib/logstash/modules/kibana_dashboards.rb +0 -36
- data/lib/logstash/modules/kibana_importer.rb +0 -17
- data/lib/logstash/modules/kibana_resource.rb +0 -10
- data/lib/logstash/modules/kibana_settings.rb +0 -40
- data/lib/logstash/modules/logstash_config.rb +0 -120
- data/lib/logstash/modules/resource_base.rb +0 -38
- data/lib/logstash/modules/scaffold.rb +0 -52
- data/lib/logstash/modules/settings_merger.rb +0 -23
- data/lib/logstash/modules/util.rb +0 -17
- data/lib/logstash/util/dead_letter_queue_manager.rb +0 -61
- data/lib/logstash/util/environment_variables.rb +0 -43
- data/spec/logstash/config/loader_spec.rb +0 -38
- data/spec/logstash/config/string_escape_spec.rb +0 -24
- data/spec/logstash/instrument/periodic_poller/dlq_spec.rb +0 -17
- data/spec/logstash/modules/logstash_config_spec.rb +0 -56
- data/spec/logstash/modules/scaffold_spec.rb +0 -234
- data/spec/logstash/pipeline_dlq_commit_spec.rb +0 -109
- data/spec/logstash/settings/splittable_string_array_spec.rb +0 -51
- data/spec/logstash/util/wrapped_acked_queue_spec.rb +0 -49
- data/versions-gem-copy.yml +0 -12
@@ -0,0 +1,3503 @@
|
|
1
|
+
# Autogenerated from a Treetop grammar. Edits may be lost.
|
2
|
+
|
3
|
+
|
4
|
+
require "treetop"
|
5
|
+
require "logstash/compiler/lscl.rb"
|
6
|
+
|
7
|
+
module LogStashCompilerLSCLGrammar
|
8
|
+
include Treetop::Runtime
|
9
|
+
|
10
|
+
def root
|
11
|
+
@root ||= :config
|
12
|
+
end
|
13
|
+
|
14
|
+
module Config0
|
15
|
+
def _
|
16
|
+
elements[0]
|
17
|
+
end
|
18
|
+
|
19
|
+
def plugin_section
|
20
|
+
elements[1]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
module Config1
|
25
|
+
def _1
|
26
|
+
elements[0]
|
27
|
+
end
|
28
|
+
|
29
|
+
def plugin_section
|
30
|
+
elements[1]
|
31
|
+
end
|
32
|
+
|
33
|
+
def _2
|
34
|
+
elements[2]
|
35
|
+
end
|
36
|
+
|
37
|
+
def _3
|
38
|
+
elements[4]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def _nt_config
|
43
|
+
start_index = index
|
44
|
+
if node_cache[:config].has_key?(index)
|
45
|
+
cached = node_cache[:config][index]
|
46
|
+
if cached
|
47
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
48
|
+
@index = cached.interval.end
|
49
|
+
end
|
50
|
+
return cached
|
51
|
+
end
|
52
|
+
|
53
|
+
i0, s0 = index, []
|
54
|
+
r1 = _nt__
|
55
|
+
s0 << r1
|
56
|
+
if r1
|
57
|
+
r2 = _nt_plugin_section
|
58
|
+
s0 << r2
|
59
|
+
if r2
|
60
|
+
r3 = _nt__
|
61
|
+
s0 << r3
|
62
|
+
if r3
|
63
|
+
s4, i4 = [], index
|
64
|
+
loop do
|
65
|
+
i5, s5 = index, []
|
66
|
+
r6 = _nt__
|
67
|
+
s5 << r6
|
68
|
+
if r6
|
69
|
+
r7 = _nt_plugin_section
|
70
|
+
s5 << r7
|
71
|
+
end
|
72
|
+
if s5.last
|
73
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
74
|
+
r5.extend(Config0)
|
75
|
+
else
|
76
|
+
@index = i5
|
77
|
+
r5 = nil
|
78
|
+
end
|
79
|
+
if r5
|
80
|
+
s4 << r5
|
81
|
+
else
|
82
|
+
break
|
83
|
+
end
|
84
|
+
end
|
85
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
86
|
+
s0 << r4
|
87
|
+
if r4
|
88
|
+
r8 = _nt__
|
89
|
+
s0 << r8
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
if s0.last
|
95
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Config,input, i0...index, s0)
|
96
|
+
r0.extend(Config1)
|
97
|
+
else
|
98
|
+
@index = i0
|
99
|
+
r0 = nil
|
100
|
+
end
|
101
|
+
|
102
|
+
node_cache[:config][start_index] = r0
|
103
|
+
|
104
|
+
r0
|
105
|
+
end
|
106
|
+
|
107
|
+
module Comment0
|
108
|
+
end
|
109
|
+
|
110
|
+
def _nt_comment
|
111
|
+
start_index = index
|
112
|
+
if node_cache[:comment].has_key?(index)
|
113
|
+
cached = node_cache[:comment][index]
|
114
|
+
if cached
|
115
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
116
|
+
@index = cached.interval.end
|
117
|
+
end
|
118
|
+
return cached
|
119
|
+
end
|
120
|
+
|
121
|
+
s0, i0 = [], index
|
122
|
+
loop do
|
123
|
+
i1, s1 = index, []
|
124
|
+
r3 = _nt_whitespace
|
125
|
+
if r3
|
126
|
+
r2 = r3
|
127
|
+
else
|
128
|
+
r2 = instantiate_node(SyntaxNode,input, index...index)
|
129
|
+
end
|
130
|
+
s1 << r2
|
131
|
+
if r2
|
132
|
+
if has_terminal?("#", false, index)
|
133
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
134
|
+
@index += 1
|
135
|
+
else
|
136
|
+
terminal_parse_failure("#")
|
137
|
+
r4 = nil
|
138
|
+
end
|
139
|
+
s1 << r4
|
140
|
+
if r4
|
141
|
+
s5, i5 = [], index
|
142
|
+
loop do
|
143
|
+
if has_terminal?('\G[^\\r\\n]', true, index)
|
144
|
+
r6 = true
|
145
|
+
@index += 1
|
146
|
+
else
|
147
|
+
r6 = nil
|
148
|
+
end
|
149
|
+
if r6
|
150
|
+
s5 << r6
|
151
|
+
else
|
152
|
+
break
|
153
|
+
end
|
154
|
+
end
|
155
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
156
|
+
s1 << r5
|
157
|
+
if r5
|
158
|
+
if has_terminal?("\r", false, index)
|
159
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
160
|
+
@index += 1
|
161
|
+
else
|
162
|
+
terminal_parse_failure("\r")
|
163
|
+
r8 = nil
|
164
|
+
end
|
165
|
+
if r8
|
166
|
+
r7 = r8
|
167
|
+
else
|
168
|
+
r7 = instantiate_node(SyntaxNode,input, index...index)
|
169
|
+
end
|
170
|
+
s1 << r7
|
171
|
+
if r7
|
172
|
+
if has_terminal?("\n", false, index)
|
173
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
174
|
+
@index += 1
|
175
|
+
else
|
176
|
+
terminal_parse_failure("\n")
|
177
|
+
r9 = nil
|
178
|
+
end
|
179
|
+
s1 << r9
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
184
|
+
if s1.last
|
185
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
186
|
+
r1.extend(Comment0)
|
187
|
+
else
|
188
|
+
@index = i1
|
189
|
+
r1 = nil
|
190
|
+
end
|
191
|
+
if r1
|
192
|
+
s0 << r1
|
193
|
+
else
|
194
|
+
break
|
195
|
+
end
|
196
|
+
end
|
197
|
+
if s0.empty?
|
198
|
+
@index = i0
|
199
|
+
r0 = nil
|
200
|
+
else
|
201
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Comment,input, i0...index, s0)
|
202
|
+
end
|
203
|
+
|
204
|
+
node_cache[:comment][start_index] = r0
|
205
|
+
|
206
|
+
r0
|
207
|
+
end
|
208
|
+
|
209
|
+
def _nt__
|
210
|
+
start_index = index
|
211
|
+
if node_cache[:_].has_key?(index)
|
212
|
+
cached = node_cache[:_][index]
|
213
|
+
if cached
|
214
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
215
|
+
@index = cached.interval.end
|
216
|
+
end
|
217
|
+
return cached
|
218
|
+
end
|
219
|
+
|
220
|
+
s0, i0 = [], index
|
221
|
+
loop do
|
222
|
+
i1 = index
|
223
|
+
r2 = _nt_comment
|
224
|
+
if r2
|
225
|
+
r1 = r2
|
226
|
+
else
|
227
|
+
r3 = _nt_whitespace
|
228
|
+
if r3
|
229
|
+
r1 = r3
|
230
|
+
else
|
231
|
+
@index = i1
|
232
|
+
r1 = nil
|
233
|
+
end
|
234
|
+
end
|
235
|
+
if r1
|
236
|
+
s0 << r1
|
237
|
+
else
|
238
|
+
break
|
239
|
+
end
|
240
|
+
end
|
241
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Whitespace,input, i0...index, s0)
|
242
|
+
|
243
|
+
node_cache[:_][start_index] = r0
|
244
|
+
|
245
|
+
r0
|
246
|
+
end
|
247
|
+
|
248
|
+
def _nt_whitespace
|
249
|
+
start_index = index
|
250
|
+
if node_cache[:whitespace].has_key?(index)
|
251
|
+
cached = node_cache[:whitespace][index]
|
252
|
+
if cached
|
253
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
254
|
+
@index = cached.interval.end
|
255
|
+
end
|
256
|
+
return cached
|
257
|
+
end
|
258
|
+
|
259
|
+
s0, i0 = [], index
|
260
|
+
loop do
|
261
|
+
if has_terminal?('\G[ \\t\\r\\n]', true, index)
|
262
|
+
r1 = true
|
263
|
+
@index += 1
|
264
|
+
else
|
265
|
+
r1 = nil
|
266
|
+
end
|
267
|
+
if r1
|
268
|
+
s0 << r1
|
269
|
+
else
|
270
|
+
break
|
271
|
+
end
|
272
|
+
end
|
273
|
+
if s0.empty?
|
274
|
+
@index = i0
|
275
|
+
r0 = nil
|
276
|
+
else
|
277
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Whitespace,input, i0...index, s0)
|
278
|
+
end
|
279
|
+
|
280
|
+
node_cache[:whitespace][start_index] = r0
|
281
|
+
|
282
|
+
r0
|
283
|
+
end
|
284
|
+
|
285
|
+
module PluginSection0
|
286
|
+
def branch_or_plugin
|
287
|
+
elements[0]
|
288
|
+
end
|
289
|
+
|
290
|
+
def _
|
291
|
+
elements[1]
|
292
|
+
end
|
293
|
+
end
|
294
|
+
|
295
|
+
module PluginSection1
|
296
|
+
def plugin_type
|
297
|
+
elements[0]
|
298
|
+
end
|
299
|
+
|
300
|
+
def _1
|
301
|
+
elements[1]
|
302
|
+
end
|
303
|
+
|
304
|
+
def _2
|
305
|
+
elements[3]
|
306
|
+
end
|
307
|
+
|
308
|
+
end
|
309
|
+
|
310
|
+
def _nt_plugin_section
|
311
|
+
start_index = index
|
312
|
+
if node_cache[:plugin_section].has_key?(index)
|
313
|
+
cached = node_cache[:plugin_section][index]
|
314
|
+
if cached
|
315
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
316
|
+
@index = cached.interval.end
|
317
|
+
end
|
318
|
+
return cached
|
319
|
+
end
|
320
|
+
|
321
|
+
i0, s0 = index, []
|
322
|
+
r1 = _nt_plugin_type
|
323
|
+
s0 << r1
|
324
|
+
if r1
|
325
|
+
r2 = _nt__
|
326
|
+
s0 << r2
|
327
|
+
if r2
|
328
|
+
if has_terminal?("{", false, index)
|
329
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
330
|
+
@index += 1
|
331
|
+
else
|
332
|
+
terminal_parse_failure("{")
|
333
|
+
r3 = nil
|
334
|
+
end
|
335
|
+
s0 << r3
|
336
|
+
if r3
|
337
|
+
r4 = _nt__
|
338
|
+
s0 << r4
|
339
|
+
if r4
|
340
|
+
s5, i5 = [], index
|
341
|
+
loop do
|
342
|
+
i6, s6 = index, []
|
343
|
+
r7 = _nt_branch_or_plugin
|
344
|
+
s6 << r7
|
345
|
+
if r7
|
346
|
+
r8 = _nt__
|
347
|
+
s6 << r8
|
348
|
+
end
|
349
|
+
if s6.last
|
350
|
+
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
351
|
+
r6.extend(PluginSection0)
|
352
|
+
else
|
353
|
+
@index = i6
|
354
|
+
r6 = nil
|
355
|
+
end
|
356
|
+
if r6
|
357
|
+
s5 << r6
|
358
|
+
else
|
359
|
+
break
|
360
|
+
end
|
361
|
+
end
|
362
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
363
|
+
s0 << r5
|
364
|
+
if r5
|
365
|
+
if has_terminal?("}", false, index)
|
366
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
367
|
+
@index += 1
|
368
|
+
else
|
369
|
+
terminal_parse_failure("}")
|
370
|
+
r9 = nil
|
371
|
+
end
|
372
|
+
s0 << r9
|
373
|
+
end
|
374
|
+
end
|
375
|
+
end
|
376
|
+
end
|
377
|
+
end
|
378
|
+
if s0.last
|
379
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::PluginSection,input, i0...index, s0)
|
380
|
+
r0.extend(PluginSection1)
|
381
|
+
else
|
382
|
+
@index = i0
|
383
|
+
r0 = nil
|
384
|
+
end
|
385
|
+
|
386
|
+
node_cache[:plugin_section][start_index] = r0
|
387
|
+
|
388
|
+
r0
|
389
|
+
end
|
390
|
+
|
391
|
+
def _nt_branch_or_plugin
|
392
|
+
start_index = index
|
393
|
+
if node_cache[:branch_or_plugin].has_key?(index)
|
394
|
+
cached = node_cache[:branch_or_plugin][index]
|
395
|
+
if cached
|
396
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
397
|
+
@index = cached.interval.end
|
398
|
+
end
|
399
|
+
return cached
|
400
|
+
end
|
401
|
+
|
402
|
+
i0 = index
|
403
|
+
r1 = _nt_branch
|
404
|
+
if r1
|
405
|
+
r0 = r1
|
406
|
+
else
|
407
|
+
r2 = _nt_plugin
|
408
|
+
if r2
|
409
|
+
r0 = r2
|
410
|
+
else
|
411
|
+
@index = i0
|
412
|
+
r0 = nil
|
413
|
+
end
|
414
|
+
end
|
415
|
+
|
416
|
+
node_cache[:branch_or_plugin][start_index] = r0
|
417
|
+
|
418
|
+
r0
|
419
|
+
end
|
420
|
+
|
421
|
+
def _nt_plugin_type
|
422
|
+
start_index = index
|
423
|
+
if node_cache[:plugin_type].has_key?(index)
|
424
|
+
cached = node_cache[:plugin_type][index]
|
425
|
+
if cached
|
426
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
427
|
+
@index = cached.interval.end
|
428
|
+
end
|
429
|
+
return cached
|
430
|
+
end
|
431
|
+
|
432
|
+
i0 = index
|
433
|
+
if has_terminal?("input", false, index)
|
434
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 5))
|
435
|
+
@index += 5
|
436
|
+
else
|
437
|
+
terminal_parse_failure("input")
|
438
|
+
r1 = nil
|
439
|
+
end
|
440
|
+
if r1
|
441
|
+
r0 = r1
|
442
|
+
else
|
443
|
+
if has_terminal?("filter", false, index)
|
444
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 6))
|
445
|
+
@index += 6
|
446
|
+
else
|
447
|
+
terminal_parse_failure("filter")
|
448
|
+
r2 = nil
|
449
|
+
end
|
450
|
+
if r2
|
451
|
+
r0 = r2
|
452
|
+
else
|
453
|
+
if has_terminal?("output", false, index)
|
454
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 6))
|
455
|
+
@index += 6
|
456
|
+
else
|
457
|
+
terminal_parse_failure("output")
|
458
|
+
r3 = nil
|
459
|
+
end
|
460
|
+
if r3
|
461
|
+
r0 = r3
|
462
|
+
else
|
463
|
+
@index = i0
|
464
|
+
r0 = nil
|
465
|
+
end
|
466
|
+
end
|
467
|
+
end
|
468
|
+
|
469
|
+
node_cache[:plugin_type][start_index] = r0
|
470
|
+
|
471
|
+
r0
|
472
|
+
end
|
473
|
+
|
474
|
+
module Plugins0
|
475
|
+
def _
|
476
|
+
elements[0]
|
477
|
+
end
|
478
|
+
|
479
|
+
def plugin
|
480
|
+
elements[1]
|
481
|
+
end
|
482
|
+
end
|
483
|
+
|
484
|
+
module Plugins1
|
485
|
+
def plugin
|
486
|
+
elements[0]
|
487
|
+
end
|
488
|
+
|
489
|
+
end
|
490
|
+
|
491
|
+
def _nt_plugins
|
492
|
+
start_index = index
|
493
|
+
if node_cache[:plugins].has_key?(index)
|
494
|
+
cached = node_cache[:plugins][index]
|
495
|
+
if cached
|
496
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
497
|
+
@index = cached.interval.end
|
498
|
+
end
|
499
|
+
return cached
|
500
|
+
end
|
501
|
+
|
502
|
+
i1, s1 = index, []
|
503
|
+
r2 = _nt_plugin
|
504
|
+
s1 << r2
|
505
|
+
if r2
|
506
|
+
s3, i3 = [], index
|
507
|
+
loop do
|
508
|
+
i4, s4 = index, []
|
509
|
+
r5 = _nt__
|
510
|
+
s4 << r5
|
511
|
+
if r5
|
512
|
+
r6 = _nt_plugin
|
513
|
+
s4 << r6
|
514
|
+
end
|
515
|
+
if s4.last
|
516
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
517
|
+
r4.extend(Plugins0)
|
518
|
+
else
|
519
|
+
@index = i4
|
520
|
+
r4 = nil
|
521
|
+
end
|
522
|
+
if r4
|
523
|
+
s3 << r4
|
524
|
+
else
|
525
|
+
break
|
526
|
+
end
|
527
|
+
end
|
528
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
529
|
+
s1 << r3
|
530
|
+
end
|
531
|
+
if s1.last
|
532
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
533
|
+
r1.extend(Plugins1)
|
534
|
+
else
|
535
|
+
@index = i1
|
536
|
+
r1 = nil
|
537
|
+
end
|
538
|
+
if r1
|
539
|
+
r0 = r1
|
540
|
+
else
|
541
|
+
r0 = instantiate_node(SyntaxNode,input, index...index)
|
542
|
+
end
|
543
|
+
|
544
|
+
node_cache[:plugins][start_index] = r0
|
545
|
+
|
546
|
+
r0
|
547
|
+
end
|
548
|
+
|
549
|
+
module Plugin0
|
550
|
+
def whitespace
|
551
|
+
elements[0]
|
552
|
+
end
|
553
|
+
|
554
|
+
def _
|
555
|
+
elements[1]
|
556
|
+
end
|
557
|
+
|
558
|
+
def attribute
|
559
|
+
elements[2]
|
560
|
+
end
|
561
|
+
end
|
562
|
+
|
563
|
+
module Plugin1
|
564
|
+
def attribute
|
565
|
+
elements[0]
|
566
|
+
end
|
567
|
+
|
568
|
+
end
|
569
|
+
|
570
|
+
module Plugin2
|
571
|
+
def name
|
572
|
+
elements[0]
|
573
|
+
end
|
574
|
+
|
575
|
+
def _1
|
576
|
+
elements[1]
|
577
|
+
end
|
578
|
+
|
579
|
+
def _2
|
580
|
+
elements[3]
|
581
|
+
end
|
582
|
+
|
583
|
+
def attributes
|
584
|
+
elements[4]
|
585
|
+
end
|
586
|
+
|
587
|
+
def _3
|
588
|
+
elements[5]
|
589
|
+
end
|
590
|
+
|
591
|
+
end
|
592
|
+
|
593
|
+
def _nt_plugin
|
594
|
+
start_index = index
|
595
|
+
if node_cache[:plugin].has_key?(index)
|
596
|
+
cached = node_cache[:plugin][index]
|
597
|
+
if cached
|
598
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
599
|
+
@index = cached.interval.end
|
600
|
+
end
|
601
|
+
return cached
|
602
|
+
end
|
603
|
+
|
604
|
+
i0, s0 = index, []
|
605
|
+
r1 = _nt_name
|
606
|
+
s0 << r1
|
607
|
+
if r1
|
608
|
+
r2 = _nt__
|
609
|
+
s0 << r2
|
610
|
+
if r2
|
611
|
+
if has_terminal?("{", false, index)
|
612
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
613
|
+
@index += 1
|
614
|
+
else
|
615
|
+
terminal_parse_failure("{")
|
616
|
+
r3 = nil
|
617
|
+
end
|
618
|
+
s0 << r3
|
619
|
+
if r3
|
620
|
+
r4 = _nt__
|
621
|
+
s0 << r4
|
622
|
+
if r4
|
623
|
+
i6, s6 = index, []
|
624
|
+
r7 = _nt_attribute
|
625
|
+
s6 << r7
|
626
|
+
if r7
|
627
|
+
s8, i8 = [], index
|
628
|
+
loop do
|
629
|
+
i9, s9 = index, []
|
630
|
+
r10 = _nt_whitespace
|
631
|
+
s9 << r10
|
632
|
+
if r10
|
633
|
+
r11 = _nt__
|
634
|
+
s9 << r11
|
635
|
+
if r11
|
636
|
+
r12 = _nt_attribute
|
637
|
+
s9 << r12
|
638
|
+
end
|
639
|
+
end
|
640
|
+
if s9.last
|
641
|
+
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
|
642
|
+
r9.extend(Plugin0)
|
643
|
+
else
|
644
|
+
@index = i9
|
645
|
+
r9 = nil
|
646
|
+
end
|
647
|
+
if r9
|
648
|
+
s8 << r9
|
649
|
+
else
|
650
|
+
break
|
651
|
+
end
|
652
|
+
end
|
653
|
+
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
654
|
+
s6 << r8
|
655
|
+
end
|
656
|
+
if s6.last
|
657
|
+
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
658
|
+
r6.extend(Plugin1)
|
659
|
+
else
|
660
|
+
@index = i6
|
661
|
+
r6 = nil
|
662
|
+
end
|
663
|
+
if r6
|
664
|
+
r5 = r6
|
665
|
+
else
|
666
|
+
r5 = instantiate_node(SyntaxNode,input, index...index)
|
667
|
+
end
|
668
|
+
s0 << r5
|
669
|
+
if r5
|
670
|
+
r13 = _nt__
|
671
|
+
s0 << r13
|
672
|
+
if r13
|
673
|
+
if has_terminal?("}", false, index)
|
674
|
+
r14 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
675
|
+
@index += 1
|
676
|
+
else
|
677
|
+
terminal_parse_failure("}")
|
678
|
+
r14 = nil
|
679
|
+
end
|
680
|
+
s0 << r14
|
681
|
+
end
|
682
|
+
end
|
683
|
+
end
|
684
|
+
end
|
685
|
+
end
|
686
|
+
end
|
687
|
+
if s0.last
|
688
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Plugin,input, i0...index, s0)
|
689
|
+
r0.extend(Plugin2)
|
690
|
+
else
|
691
|
+
@index = i0
|
692
|
+
r0 = nil
|
693
|
+
end
|
694
|
+
|
695
|
+
node_cache[:plugin][start_index] = r0
|
696
|
+
|
697
|
+
r0
|
698
|
+
end
|
699
|
+
|
700
|
+
def _nt_name
|
701
|
+
start_index = index
|
702
|
+
if node_cache[:name].has_key?(index)
|
703
|
+
cached = node_cache[:name][index]
|
704
|
+
if cached
|
705
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
706
|
+
@index = cached.interval.end
|
707
|
+
end
|
708
|
+
return cached
|
709
|
+
end
|
710
|
+
|
711
|
+
i0 = index
|
712
|
+
s1, i1 = [], index
|
713
|
+
loop do
|
714
|
+
if has_terminal?('\G[A-Za-z0-9_-]', true, index)
|
715
|
+
r2 = true
|
716
|
+
@index += 1
|
717
|
+
else
|
718
|
+
r2 = nil
|
719
|
+
end
|
720
|
+
if r2
|
721
|
+
s1 << r2
|
722
|
+
else
|
723
|
+
break
|
724
|
+
end
|
725
|
+
end
|
726
|
+
if s1.empty?
|
727
|
+
@index = i1
|
728
|
+
r1 = nil
|
729
|
+
else
|
730
|
+
r1 = instantiate_node(LogStash::Compiler::LSCL::AST::Name,input, i1...index, s1)
|
731
|
+
end
|
732
|
+
if r1
|
733
|
+
r0 = r1
|
734
|
+
else
|
735
|
+
r3 = _nt_string
|
736
|
+
if r3
|
737
|
+
r0 = r3
|
738
|
+
else
|
739
|
+
@index = i0
|
740
|
+
r0 = nil
|
741
|
+
end
|
742
|
+
end
|
743
|
+
|
744
|
+
node_cache[:name][start_index] = r0
|
745
|
+
|
746
|
+
r0
|
747
|
+
end
|
748
|
+
|
749
|
+
module Attribute0
|
750
|
+
def name
|
751
|
+
elements[0]
|
752
|
+
end
|
753
|
+
|
754
|
+
def _1
|
755
|
+
elements[1]
|
756
|
+
end
|
757
|
+
|
758
|
+
def _2
|
759
|
+
elements[3]
|
760
|
+
end
|
761
|
+
|
762
|
+
def value
|
763
|
+
elements[4]
|
764
|
+
end
|
765
|
+
end
|
766
|
+
|
767
|
+
def _nt_attribute
|
768
|
+
start_index = index
|
769
|
+
if node_cache[:attribute].has_key?(index)
|
770
|
+
cached = node_cache[:attribute][index]
|
771
|
+
if cached
|
772
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
773
|
+
@index = cached.interval.end
|
774
|
+
end
|
775
|
+
return cached
|
776
|
+
end
|
777
|
+
|
778
|
+
i0, s0 = index, []
|
779
|
+
r1 = _nt_name
|
780
|
+
s0 << r1
|
781
|
+
if r1
|
782
|
+
r2 = _nt__
|
783
|
+
s0 << r2
|
784
|
+
if r2
|
785
|
+
if has_terminal?("=>", false, index)
|
786
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
787
|
+
@index += 2
|
788
|
+
else
|
789
|
+
terminal_parse_failure("=>")
|
790
|
+
r3 = nil
|
791
|
+
end
|
792
|
+
s0 << r3
|
793
|
+
if r3
|
794
|
+
r4 = _nt__
|
795
|
+
s0 << r4
|
796
|
+
if r4
|
797
|
+
r5 = _nt_value
|
798
|
+
s0 << r5
|
799
|
+
end
|
800
|
+
end
|
801
|
+
end
|
802
|
+
end
|
803
|
+
if s0.last
|
804
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Attribute,input, i0...index, s0)
|
805
|
+
r0.extend(Attribute0)
|
806
|
+
else
|
807
|
+
@index = i0
|
808
|
+
r0 = nil
|
809
|
+
end
|
810
|
+
|
811
|
+
node_cache[:attribute][start_index] = r0
|
812
|
+
|
813
|
+
r0
|
814
|
+
end
|
815
|
+
|
816
|
+
def _nt_value
|
817
|
+
start_index = index
|
818
|
+
if node_cache[:value].has_key?(index)
|
819
|
+
cached = node_cache[:value][index]
|
820
|
+
if cached
|
821
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
822
|
+
@index = cached.interval.end
|
823
|
+
end
|
824
|
+
return cached
|
825
|
+
end
|
826
|
+
|
827
|
+
i0 = index
|
828
|
+
r1 = _nt_plugin
|
829
|
+
if r1
|
830
|
+
r0 = r1
|
831
|
+
else
|
832
|
+
r2 = _nt_bareword
|
833
|
+
if r2
|
834
|
+
r0 = r2
|
835
|
+
else
|
836
|
+
r3 = _nt_string
|
837
|
+
if r3
|
838
|
+
r0 = r3
|
839
|
+
else
|
840
|
+
r4 = _nt_number
|
841
|
+
if r4
|
842
|
+
r0 = r4
|
843
|
+
else
|
844
|
+
r5 = _nt_array
|
845
|
+
if r5
|
846
|
+
r0 = r5
|
847
|
+
else
|
848
|
+
r6 = _nt_hash
|
849
|
+
if r6
|
850
|
+
r0 = r6
|
851
|
+
else
|
852
|
+
@index = i0
|
853
|
+
r0 = nil
|
854
|
+
end
|
855
|
+
end
|
856
|
+
end
|
857
|
+
end
|
858
|
+
end
|
859
|
+
end
|
860
|
+
|
861
|
+
node_cache[:value][start_index] = r0
|
862
|
+
|
863
|
+
r0
|
864
|
+
end
|
865
|
+
|
866
|
+
def _nt_array_value
|
867
|
+
start_index = index
|
868
|
+
if node_cache[:array_value].has_key?(index)
|
869
|
+
cached = node_cache[:array_value][index]
|
870
|
+
if cached
|
871
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
872
|
+
@index = cached.interval.end
|
873
|
+
end
|
874
|
+
return cached
|
875
|
+
end
|
876
|
+
|
877
|
+
i0 = index
|
878
|
+
r1 = _nt_bareword
|
879
|
+
if r1
|
880
|
+
r0 = r1
|
881
|
+
else
|
882
|
+
r2 = _nt_string
|
883
|
+
if r2
|
884
|
+
r0 = r2
|
885
|
+
else
|
886
|
+
r3 = _nt_number
|
887
|
+
if r3
|
888
|
+
r0 = r3
|
889
|
+
else
|
890
|
+
r4 = _nt_array
|
891
|
+
if r4
|
892
|
+
r0 = r4
|
893
|
+
else
|
894
|
+
r5 = _nt_hash
|
895
|
+
if r5
|
896
|
+
r0 = r5
|
897
|
+
else
|
898
|
+
@index = i0
|
899
|
+
r0 = nil
|
900
|
+
end
|
901
|
+
end
|
902
|
+
end
|
903
|
+
end
|
904
|
+
end
|
905
|
+
|
906
|
+
node_cache[:array_value][start_index] = r0
|
907
|
+
|
908
|
+
r0
|
909
|
+
end
|
910
|
+
|
911
|
+
module Bareword0
|
912
|
+
end
|
913
|
+
|
914
|
+
def _nt_bareword
|
915
|
+
start_index = index
|
916
|
+
if node_cache[:bareword].has_key?(index)
|
917
|
+
cached = node_cache[:bareword][index]
|
918
|
+
if cached
|
919
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
920
|
+
@index = cached.interval.end
|
921
|
+
end
|
922
|
+
return cached
|
923
|
+
end
|
924
|
+
|
925
|
+
i0, s0 = index, []
|
926
|
+
if has_terminal?('\G[A-Za-z_]', true, index)
|
927
|
+
r1 = true
|
928
|
+
@index += 1
|
929
|
+
else
|
930
|
+
r1 = nil
|
931
|
+
end
|
932
|
+
s0 << r1
|
933
|
+
if r1
|
934
|
+
s2, i2 = [], index
|
935
|
+
loop do
|
936
|
+
if has_terminal?('\G[A-Za-z0-9_]', true, index)
|
937
|
+
r3 = true
|
938
|
+
@index += 1
|
939
|
+
else
|
940
|
+
r3 = nil
|
941
|
+
end
|
942
|
+
if r3
|
943
|
+
s2 << r3
|
944
|
+
else
|
945
|
+
break
|
946
|
+
end
|
947
|
+
end
|
948
|
+
if s2.empty?
|
949
|
+
@index = i2
|
950
|
+
r2 = nil
|
951
|
+
else
|
952
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
953
|
+
end
|
954
|
+
s0 << r2
|
955
|
+
end
|
956
|
+
if s0.last
|
957
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Bareword,input, i0...index, s0)
|
958
|
+
r0.extend(Bareword0)
|
959
|
+
else
|
960
|
+
@index = i0
|
961
|
+
r0 = nil
|
962
|
+
end
|
963
|
+
|
964
|
+
node_cache[:bareword][start_index] = r0
|
965
|
+
|
966
|
+
r0
|
967
|
+
end
|
968
|
+
|
969
|
+
module DoubleQuotedString0
|
970
|
+
end
|
971
|
+
|
972
|
+
module DoubleQuotedString1
|
973
|
+
end
|
974
|
+
|
975
|
+
def _nt_double_quoted_string
|
976
|
+
start_index = index
|
977
|
+
if node_cache[:double_quoted_string].has_key?(index)
|
978
|
+
cached = node_cache[:double_quoted_string][index]
|
979
|
+
if cached
|
980
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
981
|
+
@index = cached.interval.end
|
982
|
+
end
|
983
|
+
return cached
|
984
|
+
end
|
985
|
+
|
986
|
+
i0, s0 = index, []
|
987
|
+
if has_terminal?('"', false, index)
|
988
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
989
|
+
@index += 1
|
990
|
+
else
|
991
|
+
terminal_parse_failure('"')
|
992
|
+
r1 = nil
|
993
|
+
end
|
994
|
+
s0 << r1
|
995
|
+
if r1
|
996
|
+
s2, i2 = [], index
|
997
|
+
loop do
|
998
|
+
i3 = index
|
999
|
+
if has_terminal?('\"', false, index)
|
1000
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
1001
|
+
@index += 2
|
1002
|
+
else
|
1003
|
+
terminal_parse_failure('\"')
|
1004
|
+
r4 = nil
|
1005
|
+
end
|
1006
|
+
if r4
|
1007
|
+
r3 = r4
|
1008
|
+
else
|
1009
|
+
i5, s5 = index, []
|
1010
|
+
i6 = index
|
1011
|
+
if has_terminal?('"', false, index)
|
1012
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1013
|
+
@index += 1
|
1014
|
+
else
|
1015
|
+
terminal_parse_failure('"')
|
1016
|
+
r7 = nil
|
1017
|
+
end
|
1018
|
+
if r7
|
1019
|
+
r6 = nil
|
1020
|
+
else
|
1021
|
+
@index = i6
|
1022
|
+
r6 = instantiate_node(SyntaxNode,input, index...index)
|
1023
|
+
end
|
1024
|
+
s5 << r6
|
1025
|
+
if r6
|
1026
|
+
if index < input_length
|
1027
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1028
|
+
@index += 1
|
1029
|
+
else
|
1030
|
+
terminal_parse_failure("any character")
|
1031
|
+
r8 = nil
|
1032
|
+
end
|
1033
|
+
s5 << r8
|
1034
|
+
end
|
1035
|
+
if s5.last
|
1036
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
1037
|
+
r5.extend(DoubleQuotedString0)
|
1038
|
+
else
|
1039
|
+
@index = i5
|
1040
|
+
r5 = nil
|
1041
|
+
end
|
1042
|
+
if r5
|
1043
|
+
r3 = r5
|
1044
|
+
else
|
1045
|
+
@index = i3
|
1046
|
+
r3 = nil
|
1047
|
+
end
|
1048
|
+
end
|
1049
|
+
if r3
|
1050
|
+
s2 << r3
|
1051
|
+
else
|
1052
|
+
break
|
1053
|
+
end
|
1054
|
+
end
|
1055
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1056
|
+
s0 << r2
|
1057
|
+
if r2
|
1058
|
+
if has_terminal?('"', false, index)
|
1059
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1060
|
+
@index += 1
|
1061
|
+
else
|
1062
|
+
terminal_parse_failure('"')
|
1063
|
+
r9 = nil
|
1064
|
+
end
|
1065
|
+
s0 << r9
|
1066
|
+
end
|
1067
|
+
end
|
1068
|
+
if s0.last
|
1069
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::String,input, i0...index, s0)
|
1070
|
+
r0.extend(DoubleQuotedString1)
|
1071
|
+
else
|
1072
|
+
@index = i0
|
1073
|
+
r0 = nil
|
1074
|
+
end
|
1075
|
+
|
1076
|
+
node_cache[:double_quoted_string][start_index] = r0
|
1077
|
+
|
1078
|
+
r0
|
1079
|
+
end
|
1080
|
+
|
1081
|
+
module SingleQuotedString0
|
1082
|
+
end
|
1083
|
+
|
1084
|
+
module SingleQuotedString1
|
1085
|
+
end
|
1086
|
+
|
1087
|
+
def _nt_single_quoted_string
|
1088
|
+
start_index = index
|
1089
|
+
if node_cache[:single_quoted_string].has_key?(index)
|
1090
|
+
cached = node_cache[:single_quoted_string][index]
|
1091
|
+
if cached
|
1092
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1093
|
+
@index = cached.interval.end
|
1094
|
+
end
|
1095
|
+
return cached
|
1096
|
+
end
|
1097
|
+
|
1098
|
+
i0, s0 = index, []
|
1099
|
+
if has_terminal?("'", false, index)
|
1100
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1101
|
+
@index += 1
|
1102
|
+
else
|
1103
|
+
terminal_parse_failure("'")
|
1104
|
+
r1 = nil
|
1105
|
+
end
|
1106
|
+
s0 << r1
|
1107
|
+
if r1
|
1108
|
+
s2, i2 = [], index
|
1109
|
+
loop do
|
1110
|
+
i3 = index
|
1111
|
+
if has_terminal?("\\'", false, index)
|
1112
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
1113
|
+
@index += 2
|
1114
|
+
else
|
1115
|
+
terminal_parse_failure("\\'")
|
1116
|
+
r4 = nil
|
1117
|
+
end
|
1118
|
+
if r4
|
1119
|
+
r3 = r4
|
1120
|
+
else
|
1121
|
+
i5, s5 = index, []
|
1122
|
+
i6 = index
|
1123
|
+
if has_terminal?("'", false, index)
|
1124
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1125
|
+
@index += 1
|
1126
|
+
else
|
1127
|
+
terminal_parse_failure("'")
|
1128
|
+
r7 = nil
|
1129
|
+
end
|
1130
|
+
if r7
|
1131
|
+
r6 = nil
|
1132
|
+
else
|
1133
|
+
@index = i6
|
1134
|
+
r6 = instantiate_node(SyntaxNode,input, index...index)
|
1135
|
+
end
|
1136
|
+
s5 << r6
|
1137
|
+
if r6
|
1138
|
+
if index < input_length
|
1139
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1140
|
+
@index += 1
|
1141
|
+
else
|
1142
|
+
terminal_parse_failure("any character")
|
1143
|
+
r8 = nil
|
1144
|
+
end
|
1145
|
+
s5 << r8
|
1146
|
+
end
|
1147
|
+
if s5.last
|
1148
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
1149
|
+
r5.extend(SingleQuotedString0)
|
1150
|
+
else
|
1151
|
+
@index = i5
|
1152
|
+
r5 = nil
|
1153
|
+
end
|
1154
|
+
if r5
|
1155
|
+
r3 = r5
|
1156
|
+
else
|
1157
|
+
@index = i3
|
1158
|
+
r3 = nil
|
1159
|
+
end
|
1160
|
+
end
|
1161
|
+
if r3
|
1162
|
+
s2 << r3
|
1163
|
+
else
|
1164
|
+
break
|
1165
|
+
end
|
1166
|
+
end
|
1167
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1168
|
+
s0 << r2
|
1169
|
+
if r2
|
1170
|
+
if has_terminal?("'", false, index)
|
1171
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1172
|
+
@index += 1
|
1173
|
+
else
|
1174
|
+
terminal_parse_failure("'")
|
1175
|
+
r9 = nil
|
1176
|
+
end
|
1177
|
+
s0 << r9
|
1178
|
+
end
|
1179
|
+
end
|
1180
|
+
if s0.last
|
1181
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::String,input, i0...index, s0)
|
1182
|
+
r0.extend(SingleQuotedString1)
|
1183
|
+
else
|
1184
|
+
@index = i0
|
1185
|
+
r0 = nil
|
1186
|
+
end
|
1187
|
+
|
1188
|
+
node_cache[:single_quoted_string][start_index] = r0
|
1189
|
+
|
1190
|
+
r0
|
1191
|
+
end
|
1192
|
+
|
1193
|
+
def _nt_string
|
1194
|
+
start_index = index
|
1195
|
+
if node_cache[:string].has_key?(index)
|
1196
|
+
cached = node_cache[:string][index]
|
1197
|
+
if cached
|
1198
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1199
|
+
@index = cached.interval.end
|
1200
|
+
end
|
1201
|
+
return cached
|
1202
|
+
end
|
1203
|
+
|
1204
|
+
i0 = index
|
1205
|
+
r1 = _nt_double_quoted_string
|
1206
|
+
if r1
|
1207
|
+
r0 = r1
|
1208
|
+
else
|
1209
|
+
r2 = _nt_single_quoted_string
|
1210
|
+
if r2
|
1211
|
+
r0 = r2
|
1212
|
+
else
|
1213
|
+
@index = i0
|
1214
|
+
r0 = nil
|
1215
|
+
end
|
1216
|
+
end
|
1217
|
+
|
1218
|
+
node_cache[:string][start_index] = r0
|
1219
|
+
|
1220
|
+
r0
|
1221
|
+
end
|
1222
|
+
|
1223
|
+
module Regexp0
|
1224
|
+
end
|
1225
|
+
|
1226
|
+
module Regexp1
|
1227
|
+
end
|
1228
|
+
|
1229
|
+
def _nt_regexp
|
1230
|
+
start_index = index
|
1231
|
+
if node_cache[:regexp].has_key?(index)
|
1232
|
+
cached = node_cache[:regexp][index]
|
1233
|
+
if cached
|
1234
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1235
|
+
@index = cached.interval.end
|
1236
|
+
end
|
1237
|
+
return cached
|
1238
|
+
end
|
1239
|
+
|
1240
|
+
i0, s0 = index, []
|
1241
|
+
if has_terminal?('/', false, index)
|
1242
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1243
|
+
@index += 1
|
1244
|
+
else
|
1245
|
+
terminal_parse_failure('/')
|
1246
|
+
r1 = nil
|
1247
|
+
end
|
1248
|
+
s0 << r1
|
1249
|
+
if r1
|
1250
|
+
s2, i2 = [], index
|
1251
|
+
loop do
|
1252
|
+
i3 = index
|
1253
|
+
if has_terminal?('\/', false, index)
|
1254
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
1255
|
+
@index += 2
|
1256
|
+
else
|
1257
|
+
terminal_parse_failure('\/')
|
1258
|
+
r4 = nil
|
1259
|
+
end
|
1260
|
+
if r4
|
1261
|
+
r3 = r4
|
1262
|
+
else
|
1263
|
+
i5, s5 = index, []
|
1264
|
+
i6 = index
|
1265
|
+
if has_terminal?('/', false, index)
|
1266
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1267
|
+
@index += 1
|
1268
|
+
else
|
1269
|
+
terminal_parse_failure('/')
|
1270
|
+
r7 = nil
|
1271
|
+
end
|
1272
|
+
if r7
|
1273
|
+
r6 = nil
|
1274
|
+
else
|
1275
|
+
@index = i6
|
1276
|
+
r6 = instantiate_node(SyntaxNode,input, index...index)
|
1277
|
+
end
|
1278
|
+
s5 << r6
|
1279
|
+
if r6
|
1280
|
+
if index < input_length
|
1281
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1282
|
+
@index += 1
|
1283
|
+
else
|
1284
|
+
terminal_parse_failure("any character")
|
1285
|
+
r8 = nil
|
1286
|
+
end
|
1287
|
+
s5 << r8
|
1288
|
+
end
|
1289
|
+
if s5.last
|
1290
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
1291
|
+
r5.extend(Regexp0)
|
1292
|
+
else
|
1293
|
+
@index = i5
|
1294
|
+
r5 = nil
|
1295
|
+
end
|
1296
|
+
if r5
|
1297
|
+
r3 = r5
|
1298
|
+
else
|
1299
|
+
@index = i3
|
1300
|
+
r3 = nil
|
1301
|
+
end
|
1302
|
+
end
|
1303
|
+
if r3
|
1304
|
+
s2 << r3
|
1305
|
+
else
|
1306
|
+
break
|
1307
|
+
end
|
1308
|
+
end
|
1309
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1310
|
+
s0 << r2
|
1311
|
+
if r2
|
1312
|
+
if has_terminal?('/', false, index)
|
1313
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1314
|
+
@index += 1
|
1315
|
+
else
|
1316
|
+
terminal_parse_failure('/')
|
1317
|
+
r9 = nil
|
1318
|
+
end
|
1319
|
+
s0 << r9
|
1320
|
+
end
|
1321
|
+
end
|
1322
|
+
if s0.last
|
1323
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::RegExp,input, i0...index, s0)
|
1324
|
+
r0.extend(Regexp1)
|
1325
|
+
else
|
1326
|
+
@index = i0
|
1327
|
+
r0 = nil
|
1328
|
+
end
|
1329
|
+
|
1330
|
+
node_cache[:regexp][start_index] = r0
|
1331
|
+
|
1332
|
+
r0
|
1333
|
+
end
|
1334
|
+
|
1335
|
+
module Number0
|
1336
|
+
end
|
1337
|
+
|
1338
|
+
module Number1
|
1339
|
+
end
|
1340
|
+
|
1341
|
+
def _nt_number
|
1342
|
+
start_index = index
|
1343
|
+
if node_cache[:number].has_key?(index)
|
1344
|
+
cached = node_cache[:number][index]
|
1345
|
+
if cached
|
1346
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1347
|
+
@index = cached.interval.end
|
1348
|
+
end
|
1349
|
+
return cached
|
1350
|
+
end
|
1351
|
+
|
1352
|
+
i0, s0 = index, []
|
1353
|
+
if has_terminal?("-", false, index)
|
1354
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1355
|
+
@index += 1
|
1356
|
+
else
|
1357
|
+
terminal_parse_failure("-")
|
1358
|
+
r2 = nil
|
1359
|
+
end
|
1360
|
+
if r2
|
1361
|
+
r1 = r2
|
1362
|
+
else
|
1363
|
+
r1 = instantiate_node(SyntaxNode,input, index...index)
|
1364
|
+
end
|
1365
|
+
s0 << r1
|
1366
|
+
if r1
|
1367
|
+
s3, i3 = [], index
|
1368
|
+
loop do
|
1369
|
+
if has_terminal?('\G[0-9]', true, index)
|
1370
|
+
r4 = true
|
1371
|
+
@index += 1
|
1372
|
+
else
|
1373
|
+
r4 = nil
|
1374
|
+
end
|
1375
|
+
if r4
|
1376
|
+
s3 << r4
|
1377
|
+
else
|
1378
|
+
break
|
1379
|
+
end
|
1380
|
+
end
|
1381
|
+
if s3.empty?
|
1382
|
+
@index = i3
|
1383
|
+
r3 = nil
|
1384
|
+
else
|
1385
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
1386
|
+
end
|
1387
|
+
s0 << r3
|
1388
|
+
if r3
|
1389
|
+
i6, s6 = index, []
|
1390
|
+
if has_terminal?(".", false, index)
|
1391
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1392
|
+
@index += 1
|
1393
|
+
else
|
1394
|
+
terminal_parse_failure(".")
|
1395
|
+
r7 = nil
|
1396
|
+
end
|
1397
|
+
s6 << r7
|
1398
|
+
if r7
|
1399
|
+
s8, i8 = [], index
|
1400
|
+
loop do
|
1401
|
+
if has_terminal?('\G[0-9]', true, index)
|
1402
|
+
r9 = true
|
1403
|
+
@index += 1
|
1404
|
+
else
|
1405
|
+
r9 = nil
|
1406
|
+
end
|
1407
|
+
if r9
|
1408
|
+
s8 << r9
|
1409
|
+
else
|
1410
|
+
break
|
1411
|
+
end
|
1412
|
+
end
|
1413
|
+
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
1414
|
+
s6 << r8
|
1415
|
+
end
|
1416
|
+
if s6.last
|
1417
|
+
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
1418
|
+
r6.extend(Number0)
|
1419
|
+
else
|
1420
|
+
@index = i6
|
1421
|
+
r6 = nil
|
1422
|
+
end
|
1423
|
+
if r6
|
1424
|
+
r5 = r6
|
1425
|
+
else
|
1426
|
+
r5 = instantiate_node(SyntaxNode,input, index...index)
|
1427
|
+
end
|
1428
|
+
s0 << r5
|
1429
|
+
end
|
1430
|
+
end
|
1431
|
+
if s0.last
|
1432
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Number,input, i0...index, s0)
|
1433
|
+
r0.extend(Number1)
|
1434
|
+
else
|
1435
|
+
@index = i0
|
1436
|
+
r0 = nil
|
1437
|
+
end
|
1438
|
+
|
1439
|
+
node_cache[:number][start_index] = r0
|
1440
|
+
|
1441
|
+
r0
|
1442
|
+
end
|
1443
|
+
|
1444
|
+
module Array0
|
1445
|
+
def _1
|
1446
|
+
elements[0]
|
1447
|
+
end
|
1448
|
+
|
1449
|
+
def _2
|
1450
|
+
elements[2]
|
1451
|
+
end
|
1452
|
+
|
1453
|
+
def value
|
1454
|
+
elements[3]
|
1455
|
+
end
|
1456
|
+
end
|
1457
|
+
|
1458
|
+
module Array1
|
1459
|
+
def value
|
1460
|
+
elements[0]
|
1461
|
+
end
|
1462
|
+
|
1463
|
+
end
|
1464
|
+
|
1465
|
+
module Array2
|
1466
|
+
def _1
|
1467
|
+
elements[1]
|
1468
|
+
end
|
1469
|
+
|
1470
|
+
def _2
|
1471
|
+
elements[3]
|
1472
|
+
end
|
1473
|
+
|
1474
|
+
end
|
1475
|
+
|
1476
|
+
def _nt_array
|
1477
|
+
start_index = index
|
1478
|
+
if node_cache[:array].has_key?(index)
|
1479
|
+
cached = node_cache[:array][index]
|
1480
|
+
if cached
|
1481
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1482
|
+
@index = cached.interval.end
|
1483
|
+
end
|
1484
|
+
return cached
|
1485
|
+
end
|
1486
|
+
|
1487
|
+
i0, s0 = index, []
|
1488
|
+
if has_terminal?("[", false, index)
|
1489
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1490
|
+
@index += 1
|
1491
|
+
else
|
1492
|
+
terminal_parse_failure("[")
|
1493
|
+
r1 = nil
|
1494
|
+
end
|
1495
|
+
s0 << r1
|
1496
|
+
if r1
|
1497
|
+
r2 = _nt__
|
1498
|
+
s0 << r2
|
1499
|
+
if r2
|
1500
|
+
i4, s4 = index, []
|
1501
|
+
r5 = _nt_value
|
1502
|
+
s4 << r5
|
1503
|
+
if r5
|
1504
|
+
s6, i6 = [], index
|
1505
|
+
loop do
|
1506
|
+
i7, s7 = index, []
|
1507
|
+
r8 = _nt__
|
1508
|
+
s7 << r8
|
1509
|
+
if r8
|
1510
|
+
if has_terminal?(",", false, index)
|
1511
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1512
|
+
@index += 1
|
1513
|
+
else
|
1514
|
+
terminal_parse_failure(",")
|
1515
|
+
r9 = nil
|
1516
|
+
end
|
1517
|
+
s7 << r9
|
1518
|
+
if r9
|
1519
|
+
r10 = _nt__
|
1520
|
+
s7 << r10
|
1521
|
+
if r10
|
1522
|
+
r11 = _nt_value
|
1523
|
+
s7 << r11
|
1524
|
+
end
|
1525
|
+
end
|
1526
|
+
end
|
1527
|
+
if s7.last
|
1528
|
+
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
1529
|
+
r7.extend(Array0)
|
1530
|
+
else
|
1531
|
+
@index = i7
|
1532
|
+
r7 = nil
|
1533
|
+
end
|
1534
|
+
if r7
|
1535
|
+
s6 << r7
|
1536
|
+
else
|
1537
|
+
break
|
1538
|
+
end
|
1539
|
+
end
|
1540
|
+
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
1541
|
+
s4 << r6
|
1542
|
+
end
|
1543
|
+
if s4.last
|
1544
|
+
r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
|
1545
|
+
r4.extend(Array1)
|
1546
|
+
else
|
1547
|
+
@index = i4
|
1548
|
+
r4 = nil
|
1549
|
+
end
|
1550
|
+
if r4
|
1551
|
+
r3 = r4
|
1552
|
+
else
|
1553
|
+
r3 = instantiate_node(SyntaxNode,input, index...index)
|
1554
|
+
end
|
1555
|
+
s0 << r3
|
1556
|
+
if r3
|
1557
|
+
r12 = _nt__
|
1558
|
+
s0 << r12
|
1559
|
+
if r12
|
1560
|
+
if has_terminal?("]", false, index)
|
1561
|
+
r13 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1562
|
+
@index += 1
|
1563
|
+
else
|
1564
|
+
terminal_parse_failure("]")
|
1565
|
+
r13 = nil
|
1566
|
+
end
|
1567
|
+
s0 << r13
|
1568
|
+
end
|
1569
|
+
end
|
1570
|
+
end
|
1571
|
+
end
|
1572
|
+
if s0.last
|
1573
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Array,input, i0...index, s0)
|
1574
|
+
r0.extend(Array2)
|
1575
|
+
else
|
1576
|
+
@index = i0
|
1577
|
+
r0 = nil
|
1578
|
+
end
|
1579
|
+
|
1580
|
+
node_cache[:array][start_index] = r0
|
1581
|
+
|
1582
|
+
r0
|
1583
|
+
end
|
1584
|
+
|
1585
|
+
module Hash0
|
1586
|
+
def _1
|
1587
|
+
elements[1]
|
1588
|
+
end
|
1589
|
+
|
1590
|
+
def _2
|
1591
|
+
elements[3]
|
1592
|
+
end
|
1593
|
+
|
1594
|
+
end
|
1595
|
+
|
1596
|
+
def _nt_hash
|
1597
|
+
start_index = index
|
1598
|
+
if node_cache[:hash].has_key?(index)
|
1599
|
+
cached = node_cache[:hash][index]
|
1600
|
+
if cached
|
1601
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1602
|
+
@index = cached.interval.end
|
1603
|
+
end
|
1604
|
+
return cached
|
1605
|
+
end
|
1606
|
+
|
1607
|
+
i0, s0 = index, []
|
1608
|
+
if has_terminal?("{", false, index)
|
1609
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1610
|
+
@index += 1
|
1611
|
+
else
|
1612
|
+
terminal_parse_failure("{")
|
1613
|
+
r1 = nil
|
1614
|
+
end
|
1615
|
+
s0 << r1
|
1616
|
+
if r1
|
1617
|
+
r2 = _nt__
|
1618
|
+
s0 << r2
|
1619
|
+
if r2
|
1620
|
+
r4 = _nt_hashentries
|
1621
|
+
if r4
|
1622
|
+
r3 = r4
|
1623
|
+
else
|
1624
|
+
r3 = instantiate_node(SyntaxNode,input, index...index)
|
1625
|
+
end
|
1626
|
+
s0 << r3
|
1627
|
+
if r3
|
1628
|
+
r5 = _nt__
|
1629
|
+
s0 << r5
|
1630
|
+
if r5
|
1631
|
+
if has_terminal?("}", false, index)
|
1632
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1633
|
+
@index += 1
|
1634
|
+
else
|
1635
|
+
terminal_parse_failure("}")
|
1636
|
+
r6 = nil
|
1637
|
+
end
|
1638
|
+
s0 << r6
|
1639
|
+
end
|
1640
|
+
end
|
1641
|
+
end
|
1642
|
+
end
|
1643
|
+
if s0.last
|
1644
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Hash,input, i0...index, s0)
|
1645
|
+
r0.extend(Hash0)
|
1646
|
+
else
|
1647
|
+
@index = i0
|
1648
|
+
r0 = nil
|
1649
|
+
end
|
1650
|
+
|
1651
|
+
node_cache[:hash][start_index] = r0
|
1652
|
+
|
1653
|
+
r0
|
1654
|
+
end
|
1655
|
+
|
1656
|
+
module Hashentries0
|
1657
|
+
def whitespace
|
1658
|
+
elements[0]
|
1659
|
+
end
|
1660
|
+
|
1661
|
+
def hashentry
|
1662
|
+
elements[1]
|
1663
|
+
end
|
1664
|
+
end
|
1665
|
+
|
1666
|
+
module Hashentries1
|
1667
|
+
def hashentry
|
1668
|
+
elements[0]
|
1669
|
+
end
|
1670
|
+
|
1671
|
+
end
|
1672
|
+
|
1673
|
+
def _nt_hashentries
|
1674
|
+
start_index = index
|
1675
|
+
if node_cache[:hashentries].has_key?(index)
|
1676
|
+
cached = node_cache[:hashentries][index]
|
1677
|
+
if cached
|
1678
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1679
|
+
@index = cached.interval.end
|
1680
|
+
end
|
1681
|
+
return cached
|
1682
|
+
end
|
1683
|
+
|
1684
|
+
i0, s0 = index, []
|
1685
|
+
r1 = _nt_hashentry
|
1686
|
+
s0 << r1
|
1687
|
+
if r1
|
1688
|
+
s2, i2 = [], index
|
1689
|
+
loop do
|
1690
|
+
i3, s3 = index, []
|
1691
|
+
r4 = _nt_whitespace
|
1692
|
+
s3 << r4
|
1693
|
+
if r4
|
1694
|
+
r5 = _nt_hashentry
|
1695
|
+
s3 << r5
|
1696
|
+
end
|
1697
|
+
if s3.last
|
1698
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
1699
|
+
r3.extend(Hashentries0)
|
1700
|
+
else
|
1701
|
+
@index = i3
|
1702
|
+
r3 = nil
|
1703
|
+
end
|
1704
|
+
if r3
|
1705
|
+
s2 << r3
|
1706
|
+
else
|
1707
|
+
break
|
1708
|
+
end
|
1709
|
+
end
|
1710
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1711
|
+
s0 << r2
|
1712
|
+
end
|
1713
|
+
if s0.last
|
1714
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::HashEntries,input, i0...index, s0)
|
1715
|
+
r0.extend(Hashentries1)
|
1716
|
+
else
|
1717
|
+
@index = i0
|
1718
|
+
r0 = nil
|
1719
|
+
end
|
1720
|
+
|
1721
|
+
node_cache[:hashentries][start_index] = r0
|
1722
|
+
|
1723
|
+
r0
|
1724
|
+
end
|
1725
|
+
|
1726
|
+
module Hashentry0
|
1727
|
+
def name
|
1728
|
+
elements[0]
|
1729
|
+
end
|
1730
|
+
|
1731
|
+
def _1
|
1732
|
+
elements[1]
|
1733
|
+
end
|
1734
|
+
|
1735
|
+
def _2
|
1736
|
+
elements[3]
|
1737
|
+
end
|
1738
|
+
|
1739
|
+
def value
|
1740
|
+
elements[4]
|
1741
|
+
end
|
1742
|
+
end
|
1743
|
+
|
1744
|
+
def _nt_hashentry
|
1745
|
+
start_index = index
|
1746
|
+
if node_cache[:hashentry].has_key?(index)
|
1747
|
+
cached = node_cache[:hashentry][index]
|
1748
|
+
if cached
|
1749
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1750
|
+
@index = cached.interval.end
|
1751
|
+
end
|
1752
|
+
return cached
|
1753
|
+
end
|
1754
|
+
|
1755
|
+
i0, s0 = index, []
|
1756
|
+
i1 = index
|
1757
|
+
r2 = _nt_number
|
1758
|
+
if r2
|
1759
|
+
r1 = r2
|
1760
|
+
else
|
1761
|
+
r3 = _nt_bareword
|
1762
|
+
if r3
|
1763
|
+
r1 = r3
|
1764
|
+
else
|
1765
|
+
r4 = _nt_string
|
1766
|
+
if r4
|
1767
|
+
r1 = r4
|
1768
|
+
else
|
1769
|
+
@index = i1
|
1770
|
+
r1 = nil
|
1771
|
+
end
|
1772
|
+
end
|
1773
|
+
end
|
1774
|
+
s0 << r1
|
1775
|
+
if r1
|
1776
|
+
r5 = _nt__
|
1777
|
+
s0 << r5
|
1778
|
+
if r5
|
1779
|
+
if has_terminal?("=>", false, index)
|
1780
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
1781
|
+
@index += 2
|
1782
|
+
else
|
1783
|
+
terminal_parse_failure("=>")
|
1784
|
+
r6 = nil
|
1785
|
+
end
|
1786
|
+
s0 << r6
|
1787
|
+
if r6
|
1788
|
+
r7 = _nt__
|
1789
|
+
s0 << r7
|
1790
|
+
if r7
|
1791
|
+
r8 = _nt_value
|
1792
|
+
s0 << r8
|
1793
|
+
end
|
1794
|
+
end
|
1795
|
+
end
|
1796
|
+
end
|
1797
|
+
if s0.last
|
1798
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::HashEntry,input, i0...index, s0)
|
1799
|
+
r0.extend(Hashentry0)
|
1800
|
+
else
|
1801
|
+
@index = i0
|
1802
|
+
r0 = nil
|
1803
|
+
end
|
1804
|
+
|
1805
|
+
node_cache[:hashentry][start_index] = r0
|
1806
|
+
|
1807
|
+
r0
|
1808
|
+
end
|
1809
|
+
|
1810
|
+
module Branch0
|
1811
|
+
def _
|
1812
|
+
elements[0]
|
1813
|
+
end
|
1814
|
+
|
1815
|
+
def else_if
|
1816
|
+
elements[1]
|
1817
|
+
end
|
1818
|
+
end
|
1819
|
+
|
1820
|
+
module Branch1
|
1821
|
+
def _
|
1822
|
+
elements[0]
|
1823
|
+
end
|
1824
|
+
|
1825
|
+
def else
|
1826
|
+
elements[1]
|
1827
|
+
end
|
1828
|
+
end
|
1829
|
+
|
1830
|
+
module Branch2
|
1831
|
+
def if
|
1832
|
+
elements[0]
|
1833
|
+
end
|
1834
|
+
|
1835
|
+
end
|
1836
|
+
|
1837
|
+
def _nt_branch
|
1838
|
+
start_index = index
|
1839
|
+
if node_cache[:branch].has_key?(index)
|
1840
|
+
cached = node_cache[:branch][index]
|
1841
|
+
if cached
|
1842
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1843
|
+
@index = cached.interval.end
|
1844
|
+
end
|
1845
|
+
return cached
|
1846
|
+
end
|
1847
|
+
|
1848
|
+
i0, s0 = index, []
|
1849
|
+
r1 = _nt_if
|
1850
|
+
s0 << r1
|
1851
|
+
if r1
|
1852
|
+
s2, i2 = [], index
|
1853
|
+
loop do
|
1854
|
+
i3, s3 = index, []
|
1855
|
+
r4 = _nt__
|
1856
|
+
s3 << r4
|
1857
|
+
if r4
|
1858
|
+
r5 = _nt_else_if
|
1859
|
+
s3 << r5
|
1860
|
+
end
|
1861
|
+
if s3.last
|
1862
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
1863
|
+
r3.extend(Branch0)
|
1864
|
+
else
|
1865
|
+
@index = i3
|
1866
|
+
r3 = nil
|
1867
|
+
end
|
1868
|
+
if r3
|
1869
|
+
s2 << r3
|
1870
|
+
else
|
1871
|
+
break
|
1872
|
+
end
|
1873
|
+
end
|
1874
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
1875
|
+
s0 << r2
|
1876
|
+
if r2
|
1877
|
+
i7, s7 = index, []
|
1878
|
+
r8 = _nt__
|
1879
|
+
s7 << r8
|
1880
|
+
if r8
|
1881
|
+
r9 = _nt_else
|
1882
|
+
s7 << r9
|
1883
|
+
end
|
1884
|
+
if s7.last
|
1885
|
+
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
1886
|
+
r7.extend(Branch1)
|
1887
|
+
else
|
1888
|
+
@index = i7
|
1889
|
+
r7 = nil
|
1890
|
+
end
|
1891
|
+
if r7
|
1892
|
+
r6 = r7
|
1893
|
+
else
|
1894
|
+
r6 = instantiate_node(SyntaxNode,input, index...index)
|
1895
|
+
end
|
1896
|
+
s0 << r6
|
1897
|
+
end
|
1898
|
+
end
|
1899
|
+
if s0.last
|
1900
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Branch,input, i0...index, s0)
|
1901
|
+
r0.extend(Branch2)
|
1902
|
+
else
|
1903
|
+
@index = i0
|
1904
|
+
r0 = nil
|
1905
|
+
end
|
1906
|
+
|
1907
|
+
node_cache[:branch][start_index] = r0
|
1908
|
+
|
1909
|
+
r0
|
1910
|
+
end
|
1911
|
+
|
1912
|
+
module If0
|
1913
|
+
def branch_or_plugin
|
1914
|
+
elements[0]
|
1915
|
+
end
|
1916
|
+
|
1917
|
+
def _
|
1918
|
+
elements[1]
|
1919
|
+
end
|
1920
|
+
end
|
1921
|
+
|
1922
|
+
module If1
|
1923
|
+
def _1
|
1924
|
+
elements[1]
|
1925
|
+
end
|
1926
|
+
|
1927
|
+
def condition
|
1928
|
+
elements[2]
|
1929
|
+
end
|
1930
|
+
|
1931
|
+
def _2
|
1932
|
+
elements[3]
|
1933
|
+
end
|
1934
|
+
|
1935
|
+
def _3
|
1936
|
+
elements[5]
|
1937
|
+
end
|
1938
|
+
|
1939
|
+
end
|
1940
|
+
|
1941
|
+
def _nt_if
|
1942
|
+
start_index = index
|
1943
|
+
if node_cache[:if].has_key?(index)
|
1944
|
+
cached = node_cache[:if][index]
|
1945
|
+
if cached
|
1946
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
1947
|
+
@index = cached.interval.end
|
1948
|
+
end
|
1949
|
+
return cached
|
1950
|
+
end
|
1951
|
+
|
1952
|
+
i0, s0 = index, []
|
1953
|
+
if has_terminal?("if", false, index)
|
1954
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
1955
|
+
@index += 2
|
1956
|
+
else
|
1957
|
+
terminal_parse_failure("if")
|
1958
|
+
r1 = nil
|
1959
|
+
end
|
1960
|
+
s0 << r1
|
1961
|
+
if r1
|
1962
|
+
r2 = _nt__
|
1963
|
+
s0 << r2
|
1964
|
+
if r2
|
1965
|
+
r3 = _nt_condition
|
1966
|
+
s0 << r3
|
1967
|
+
if r3
|
1968
|
+
r4 = _nt__
|
1969
|
+
s0 << r4
|
1970
|
+
if r4
|
1971
|
+
if has_terminal?("{", false, index)
|
1972
|
+
r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
1973
|
+
@index += 1
|
1974
|
+
else
|
1975
|
+
terminal_parse_failure("{")
|
1976
|
+
r5 = nil
|
1977
|
+
end
|
1978
|
+
s0 << r5
|
1979
|
+
if r5
|
1980
|
+
r6 = _nt__
|
1981
|
+
s0 << r6
|
1982
|
+
if r6
|
1983
|
+
s7, i7 = [], index
|
1984
|
+
loop do
|
1985
|
+
i8, s8 = index, []
|
1986
|
+
r9 = _nt_branch_or_plugin
|
1987
|
+
s8 << r9
|
1988
|
+
if r9
|
1989
|
+
r10 = _nt__
|
1990
|
+
s8 << r10
|
1991
|
+
end
|
1992
|
+
if s8.last
|
1993
|
+
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
1994
|
+
r8.extend(If0)
|
1995
|
+
else
|
1996
|
+
@index = i8
|
1997
|
+
r8 = nil
|
1998
|
+
end
|
1999
|
+
if r8
|
2000
|
+
s7 << r8
|
2001
|
+
else
|
2002
|
+
break
|
2003
|
+
end
|
2004
|
+
end
|
2005
|
+
r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
|
2006
|
+
s0 << r7
|
2007
|
+
if r7
|
2008
|
+
if has_terminal?("}", false, index)
|
2009
|
+
r11 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2010
|
+
@index += 1
|
2011
|
+
else
|
2012
|
+
terminal_parse_failure("}")
|
2013
|
+
r11 = nil
|
2014
|
+
end
|
2015
|
+
s0 << r11
|
2016
|
+
end
|
2017
|
+
end
|
2018
|
+
end
|
2019
|
+
end
|
2020
|
+
end
|
2021
|
+
end
|
2022
|
+
end
|
2023
|
+
if s0.last
|
2024
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::If,input, i0...index, s0)
|
2025
|
+
r0.extend(If1)
|
2026
|
+
else
|
2027
|
+
@index = i0
|
2028
|
+
r0 = nil
|
2029
|
+
end
|
2030
|
+
|
2031
|
+
node_cache[:if][start_index] = r0
|
2032
|
+
|
2033
|
+
r0
|
2034
|
+
end
|
2035
|
+
|
2036
|
+
module ElseIf0
|
2037
|
+
def branch_or_plugin
|
2038
|
+
elements[0]
|
2039
|
+
end
|
2040
|
+
|
2041
|
+
def _
|
2042
|
+
elements[1]
|
2043
|
+
end
|
2044
|
+
end
|
2045
|
+
|
2046
|
+
module ElseIf1
|
2047
|
+
def _1
|
2048
|
+
elements[1]
|
2049
|
+
end
|
2050
|
+
|
2051
|
+
def _2
|
2052
|
+
elements[3]
|
2053
|
+
end
|
2054
|
+
|
2055
|
+
def condition
|
2056
|
+
elements[4]
|
2057
|
+
end
|
2058
|
+
|
2059
|
+
def _3
|
2060
|
+
elements[5]
|
2061
|
+
end
|
2062
|
+
|
2063
|
+
def _4
|
2064
|
+
elements[7]
|
2065
|
+
end
|
2066
|
+
|
2067
|
+
end
|
2068
|
+
|
2069
|
+
def _nt_else_if
|
2070
|
+
start_index = index
|
2071
|
+
if node_cache[:else_if].has_key?(index)
|
2072
|
+
cached = node_cache[:else_if][index]
|
2073
|
+
if cached
|
2074
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2075
|
+
@index = cached.interval.end
|
2076
|
+
end
|
2077
|
+
return cached
|
2078
|
+
end
|
2079
|
+
|
2080
|
+
i0, s0 = index, []
|
2081
|
+
if has_terminal?("else", false, index)
|
2082
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
2083
|
+
@index += 4
|
2084
|
+
else
|
2085
|
+
terminal_parse_failure("else")
|
2086
|
+
r1 = nil
|
2087
|
+
end
|
2088
|
+
s0 << r1
|
2089
|
+
if r1
|
2090
|
+
r2 = _nt__
|
2091
|
+
s0 << r2
|
2092
|
+
if r2
|
2093
|
+
if has_terminal?("if", false, index)
|
2094
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
2095
|
+
@index += 2
|
2096
|
+
else
|
2097
|
+
terminal_parse_failure("if")
|
2098
|
+
r3 = nil
|
2099
|
+
end
|
2100
|
+
s0 << r3
|
2101
|
+
if r3
|
2102
|
+
r4 = _nt__
|
2103
|
+
s0 << r4
|
2104
|
+
if r4
|
2105
|
+
r5 = _nt_condition
|
2106
|
+
s0 << r5
|
2107
|
+
if r5
|
2108
|
+
r6 = _nt__
|
2109
|
+
s0 << r6
|
2110
|
+
if r6
|
2111
|
+
if has_terminal?("{", false, index)
|
2112
|
+
r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2113
|
+
@index += 1
|
2114
|
+
else
|
2115
|
+
terminal_parse_failure("{")
|
2116
|
+
r7 = nil
|
2117
|
+
end
|
2118
|
+
s0 << r7
|
2119
|
+
if r7
|
2120
|
+
r8 = _nt__
|
2121
|
+
s0 << r8
|
2122
|
+
if r8
|
2123
|
+
s9, i9 = [], index
|
2124
|
+
loop do
|
2125
|
+
i10, s10 = index, []
|
2126
|
+
r11 = _nt_branch_or_plugin
|
2127
|
+
s10 << r11
|
2128
|
+
if r11
|
2129
|
+
r12 = _nt__
|
2130
|
+
s10 << r12
|
2131
|
+
end
|
2132
|
+
if s10.last
|
2133
|
+
r10 = instantiate_node(SyntaxNode,input, i10...index, s10)
|
2134
|
+
r10.extend(ElseIf0)
|
2135
|
+
else
|
2136
|
+
@index = i10
|
2137
|
+
r10 = nil
|
2138
|
+
end
|
2139
|
+
if r10
|
2140
|
+
s9 << r10
|
2141
|
+
else
|
2142
|
+
break
|
2143
|
+
end
|
2144
|
+
end
|
2145
|
+
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
|
2146
|
+
s0 << r9
|
2147
|
+
if r9
|
2148
|
+
if has_terminal?("}", false, index)
|
2149
|
+
r13 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2150
|
+
@index += 1
|
2151
|
+
else
|
2152
|
+
terminal_parse_failure("}")
|
2153
|
+
r13 = nil
|
2154
|
+
end
|
2155
|
+
s0 << r13
|
2156
|
+
end
|
2157
|
+
end
|
2158
|
+
end
|
2159
|
+
end
|
2160
|
+
end
|
2161
|
+
end
|
2162
|
+
end
|
2163
|
+
end
|
2164
|
+
end
|
2165
|
+
if s0.last
|
2166
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Elsif,input, i0...index, s0)
|
2167
|
+
r0.extend(ElseIf1)
|
2168
|
+
else
|
2169
|
+
@index = i0
|
2170
|
+
r0 = nil
|
2171
|
+
end
|
2172
|
+
|
2173
|
+
node_cache[:else_if][start_index] = r0
|
2174
|
+
|
2175
|
+
r0
|
2176
|
+
end
|
2177
|
+
|
2178
|
+
module Else0
|
2179
|
+
def branch_or_plugin
|
2180
|
+
elements[0]
|
2181
|
+
end
|
2182
|
+
|
2183
|
+
def _
|
2184
|
+
elements[1]
|
2185
|
+
end
|
2186
|
+
end
|
2187
|
+
|
2188
|
+
module Else1
|
2189
|
+
def _1
|
2190
|
+
elements[1]
|
2191
|
+
end
|
2192
|
+
|
2193
|
+
def _2
|
2194
|
+
elements[3]
|
2195
|
+
end
|
2196
|
+
|
2197
|
+
end
|
2198
|
+
|
2199
|
+
def _nt_else
|
2200
|
+
start_index = index
|
2201
|
+
if node_cache[:else].has_key?(index)
|
2202
|
+
cached = node_cache[:else][index]
|
2203
|
+
if cached
|
2204
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2205
|
+
@index = cached.interval.end
|
2206
|
+
end
|
2207
|
+
return cached
|
2208
|
+
end
|
2209
|
+
|
2210
|
+
i0, s0 = index, []
|
2211
|
+
if has_terminal?("else", false, index)
|
2212
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
2213
|
+
@index += 4
|
2214
|
+
else
|
2215
|
+
terminal_parse_failure("else")
|
2216
|
+
r1 = nil
|
2217
|
+
end
|
2218
|
+
s0 << r1
|
2219
|
+
if r1
|
2220
|
+
r2 = _nt__
|
2221
|
+
s0 << r2
|
2222
|
+
if r2
|
2223
|
+
if has_terminal?("{", false, index)
|
2224
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2225
|
+
@index += 1
|
2226
|
+
else
|
2227
|
+
terminal_parse_failure("{")
|
2228
|
+
r3 = nil
|
2229
|
+
end
|
2230
|
+
s0 << r3
|
2231
|
+
if r3
|
2232
|
+
r4 = _nt__
|
2233
|
+
s0 << r4
|
2234
|
+
if r4
|
2235
|
+
s5, i5 = [], index
|
2236
|
+
loop do
|
2237
|
+
i6, s6 = index, []
|
2238
|
+
r7 = _nt_branch_or_plugin
|
2239
|
+
s6 << r7
|
2240
|
+
if r7
|
2241
|
+
r8 = _nt__
|
2242
|
+
s6 << r8
|
2243
|
+
end
|
2244
|
+
if s6.last
|
2245
|
+
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
2246
|
+
r6.extend(Else0)
|
2247
|
+
else
|
2248
|
+
@index = i6
|
2249
|
+
r6 = nil
|
2250
|
+
end
|
2251
|
+
if r6
|
2252
|
+
s5 << r6
|
2253
|
+
else
|
2254
|
+
break
|
2255
|
+
end
|
2256
|
+
end
|
2257
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
2258
|
+
s0 << r5
|
2259
|
+
if r5
|
2260
|
+
if has_terminal?("}", false, index)
|
2261
|
+
r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2262
|
+
@index += 1
|
2263
|
+
else
|
2264
|
+
terminal_parse_failure("}")
|
2265
|
+
r9 = nil
|
2266
|
+
end
|
2267
|
+
s0 << r9
|
2268
|
+
end
|
2269
|
+
end
|
2270
|
+
end
|
2271
|
+
end
|
2272
|
+
end
|
2273
|
+
if s0.last
|
2274
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Else,input, i0...index, s0)
|
2275
|
+
r0.extend(Else1)
|
2276
|
+
else
|
2277
|
+
@index = i0
|
2278
|
+
r0 = nil
|
2279
|
+
end
|
2280
|
+
|
2281
|
+
node_cache[:else][start_index] = r0
|
2282
|
+
|
2283
|
+
r0
|
2284
|
+
end
|
2285
|
+
|
2286
|
+
module Condition0
|
2287
|
+
def _1
|
2288
|
+
elements[0]
|
2289
|
+
end
|
2290
|
+
|
2291
|
+
def boolean_operator
|
2292
|
+
elements[1]
|
2293
|
+
end
|
2294
|
+
|
2295
|
+
def _2
|
2296
|
+
elements[2]
|
2297
|
+
end
|
2298
|
+
|
2299
|
+
def expression
|
2300
|
+
elements[3]
|
2301
|
+
end
|
2302
|
+
end
|
2303
|
+
|
2304
|
+
module Condition1
|
2305
|
+
def expression
|
2306
|
+
elements[0]
|
2307
|
+
end
|
2308
|
+
|
2309
|
+
end
|
2310
|
+
|
2311
|
+
def _nt_condition
|
2312
|
+
start_index = index
|
2313
|
+
if node_cache[:condition].has_key?(index)
|
2314
|
+
cached = node_cache[:condition][index]
|
2315
|
+
if cached
|
2316
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2317
|
+
@index = cached.interval.end
|
2318
|
+
end
|
2319
|
+
return cached
|
2320
|
+
end
|
2321
|
+
|
2322
|
+
i0, s0 = index, []
|
2323
|
+
r1 = _nt_expression
|
2324
|
+
s0 << r1
|
2325
|
+
if r1
|
2326
|
+
s2, i2 = [], index
|
2327
|
+
loop do
|
2328
|
+
i3, s3 = index, []
|
2329
|
+
r4 = _nt__
|
2330
|
+
s3 << r4
|
2331
|
+
if r4
|
2332
|
+
r5 = _nt_boolean_operator
|
2333
|
+
s3 << r5
|
2334
|
+
if r5
|
2335
|
+
r6 = _nt__
|
2336
|
+
s3 << r6
|
2337
|
+
if r6
|
2338
|
+
r7 = _nt_expression
|
2339
|
+
s3 << r7
|
2340
|
+
end
|
2341
|
+
end
|
2342
|
+
end
|
2343
|
+
if s3.last
|
2344
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
2345
|
+
r3.extend(Condition0)
|
2346
|
+
else
|
2347
|
+
@index = i3
|
2348
|
+
r3 = nil
|
2349
|
+
end
|
2350
|
+
if r3
|
2351
|
+
s2 << r3
|
2352
|
+
else
|
2353
|
+
break
|
2354
|
+
end
|
2355
|
+
end
|
2356
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
2357
|
+
s0 << r2
|
2358
|
+
end
|
2359
|
+
if s0.last
|
2360
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Condition,input, i0...index, s0)
|
2361
|
+
r0.extend(Condition1)
|
2362
|
+
else
|
2363
|
+
@index = i0
|
2364
|
+
r0 = nil
|
2365
|
+
end
|
2366
|
+
|
2367
|
+
node_cache[:condition][start_index] = r0
|
2368
|
+
|
2369
|
+
r0
|
2370
|
+
end
|
2371
|
+
|
2372
|
+
module Expression0
|
2373
|
+
def _1
|
2374
|
+
elements[1]
|
2375
|
+
end
|
2376
|
+
|
2377
|
+
def condition
|
2378
|
+
elements[2]
|
2379
|
+
end
|
2380
|
+
|
2381
|
+
def _2
|
2382
|
+
elements[3]
|
2383
|
+
end
|
2384
|
+
|
2385
|
+
end
|
2386
|
+
|
2387
|
+
def _nt_expression
|
2388
|
+
start_index = index
|
2389
|
+
if node_cache[:expression].has_key?(index)
|
2390
|
+
cached = node_cache[:expression][index]
|
2391
|
+
if cached
|
2392
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2393
|
+
@index = cached.interval.end
|
2394
|
+
end
|
2395
|
+
return cached
|
2396
|
+
end
|
2397
|
+
|
2398
|
+
i0 = index
|
2399
|
+
i1, s1 = index, []
|
2400
|
+
if has_terminal?("(", false, index)
|
2401
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2402
|
+
@index += 1
|
2403
|
+
else
|
2404
|
+
terminal_parse_failure("(")
|
2405
|
+
r2 = nil
|
2406
|
+
end
|
2407
|
+
s1 << r2
|
2408
|
+
if r2
|
2409
|
+
r3 = _nt__
|
2410
|
+
s1 << r3
|
2411
|
+
if r3
|
2412
|
+
r4 = _nt_condition
|
2413
|
+
s1 << r4
|
2414
|
+
if r4
|
2415
|
+
r5 = _nt__
|
2416
|
+
s1 << r5
|
2417
|
+
if r5
|
2418
|
+
if has_terminal?(")", false, index)
|
2419
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2420
|
+
@index += 1
|
2421
|
+
else
|
2422
|
+
terminal_parse_failure(")")
|
2423
|
+
r6 = nil
|
2424
|
+
end
|
2425
|
+
s1 << r6
|
2426
|
+
end
|
2427
|
+
end
|
2428
|
+
end
|
2429
|
+
end
|
2430
|
+
if s1.last
|
2431
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
2432
|
+
r1.extend(Expression0)
|
2433
|
+
else
|
2434
|
+
@index = i1
|
2435
|
+
r1 = nil
|
2436
|
+
end
|
2437
|
+
if r1
|
2438
|
+
r0 = r1
|
2439
|
+
r0.extend(LogStash::Compiler::LSCL::AST::Expression)
|
2440
|
+
else
|
2441
|
+
r7 = _nt_negative_expression
|
2442
|
+
if r7
|
2443
|
+
r0 = r7
|
2444
|
+
r0.extend(LogStash::Compiler::LSCL::AST::Expression)
|
2445
|
+
else
|
2446
|
+
r8 = _nt_in_expression
|
2447
|
+
if r8
|
2448
|
+
r0 = r8
|
2449
|
+
r0.extend(LogStash::Compiler::LSCL::AST::Expression)
|
2450
|
+
else
|
2451
|
+
r9 = _nt_not_in_expression
|
2452
|
+
if r9
|
2453
|
+
r0 = r9
|
2454
|
+
r0.extend(LogStash::Compiler::LSCL::AST::Expression)
|
2455
|
+
else
|
2456
|
+
r10 = _nt_compare_expression
|
2457
|
+
if r10
|
2458
|
+
r0 = r10
|
2459
|
+
r0.extend(LogStash::Compiler::LSCL::AST::Expression)
|
2460
|
+
else
|
2461
|
+
r11 = _nt_regexp_expression
|
2462
|
+
if r11
|
2463
|
+
r0 = r11
|
2464
|
+
r0.extend(LogStash::Compiler::LSCL::AST::Expression)
|
2465
|
+
else
|
2466
|
+
r12 = _nt_rvalue
|
2467
|
+
if r12
|
2468
|
+
r0 = r12
|
2469
|
+
r0.extend(LogStash::Compiler::LSCL::AST::Expression)
|
2470
|
+
else
|
2471
|
+
@index = i0
|
2472
|
+
r0 = nil
|
2473
|
+
end
|
2474
|
+
end
|
2475
|
+
end
|
2476
|
+
end
|
2477
|
+
end
|
2478
|
+
end
|
2479
|
+
end
|
2480
|
+
|
2481
|
+
node_cache[:expression][start_index] = r0
|
2482
|
+
|
2483
|
+
r0
|
2484
|
+
end
|
2485
|
+
|
2486
|
+
module NegativeExpression0
|
2487
|
+
def _1
|
2488
|
+
elements[1]
|
2489
|
+
end
|
2490
|
+
|
2491
|
+
def _2
|
2492
|
+
elements[3]
|
2493
|
+
end
|
2494
|
+
|
2495
|
+
def condition
|
2496
|
+
elements[4]
|
2497
|
+
end
|
2498
|
+
|
2499
|
+
def _3
|
2500
|
+
elements[5]
|
2501
|
+
end
|
2502
|
+
|
2503
|
+
end
|
2504
|
+
|
2505
|
+
module NegativeExpression1
|
2506
|
+
def _
|
2507
|
+
elements[1]
|
2508
|
+
end
|
2509
|
+
|
2510
|
+
def selector
|
2511
|
+
elements[2]
|
2512
|
+
end
|
2513
|
+
end
|
2514
|
+
|
2515
|
+
def _nt_negative_expression
|
2516
|
+
start_index = index
|
2517
|
+
if node_cache[:negative_expression].has_key?(index)
|
2518
|
+
cached = node_cache[:negative_expression][index]
|
2519
|
+
if cached
|
2520
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2521
|
+
@index = cached.interval.end
|
2522
|
+
end
|
2523
|
+
return cached
|
2524
|
+
end
|
2525
|
+
|
2526
|
+
i0 = index
|
2527
|
+
i1, s1 = index, []
|
2528
|
+
if has_terminal?("!", false, index)
|
2529
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2530
|
+
@index += 1
|
2531
|
+
else
|
2532
|
+
terminal_parse_failure("!")
|
2533
|
+
r2 = nil
|
2534
|
+
end
|
2535
|
+
s1 << r2
|
2536
|
+
if r2
|
2537
|
+
r3 = _nt__
|
2538
|
+
s1 << r3
|
2539
|
+
if r3
|
2540
|
+
if has_terminal?("(", false, index)
|
2541
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2542
|
+
@index += 1
|
2543
|
+
else
|
2544
|
+
terminal_parse_failure("(")
|
2545
|
+
r4 = nil
|
2546
|
+
end
|
2547
|
+
s1 << r4
|
2548
|
+
if r4
|
2549
|
+
r5 = _nt__
|
2550
|
+
s1 << r5
|
2551
|
+
if r5
|
2552
|
+
r6 = _nt_condition
|
2553
|
+
s1 << r6
|
2554
|
+
if r6
|
2555
|
+
r7 = _nt__
|
2556
|
+
s1 << r7
|
2557
|
+
if r7
|
2558
|
+
if has_terminal?(")", false, index)
|
2559
|
+
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2560
|
+
@index += 1
|
2561
|
+
else
|
2562
|
+
terminal_parse_failure(")")
|
2563
|
+
r8 = nil
|
2564
|
+
end
|
2565
|
+
s1 << r8
|
2566
|
+
end
|
2567
|
+
end
|
2568
|
+
end
|
2569
|
+
end
|
2570
|
+
end
|
2571
|
+
end
|
2572
|
+
if s1.last
|
2573
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
2574
|
+
r1.extend(NegativeExpression0)
|
2575
|
+
else
|
2576
|
+
@index = i1
|
2577
|
+
r1 = nil
|
2578
|
+
end
|
2579
|
+
if r1
|
2580
|
+
r0 = r1
|
2581
|
+
r0.extend(LogStash::Compiler::LSCL::AST::NegativeExpression)
|
2582
|
+
else
|
2583
|
+
i9, s9 = index, []
|
2584
|
+
if has_terminal?("!", false, index)
|
2585
|
+
r10 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2586
|
+
@index += 1
|
2587
|
+
else
|
2588
|
+
terminal_parse_failure("!")
|
2589
|
+
r10 = nil
|
2590
|
+
end
|
2591
|
+
s9 << r10
|
2592
|
+
if r10
|
2593
|
+
r11 = _nt__
|
2594
|
+
s9 << r11
|
2595
|
+
if r11
|
2596
|
+
r12 = _nt_selector
|
2597
|
+
s9 << r12
|
2598
|
+
end
|
2599
|
+
end
|
2600
|
+
if s9.last
|
2601
|
+
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
|
2602
|
+
r9.extend(NegativeExpression1)
|
2603
|
+
else
|
2604
|
+
@index = i9
|
2605
|
+
r9 = nil
|
2606
|
+
end
|
2607
|
+
if r9
|
2608
|
+
r0 = r9
|
2609
|
+
r0.extend(LogStash::Compiler::LSCL::AST::NegativeExpression)
|
2610
|
+
else
|
2611
|
+
@index = i0
|
2612
|
+
r0 = nil
|
2613
|
+
end
|
2614
|
+
end
|
2615
|
+
|
2616
|
+
node_cache[:negative_expression][start_index] = r0
|
2617
|
+
|
2618
|
+
r0
|
2619
|
+
end
|
2620
|
+
|
2621
|
+
module InExpression0
|
2622
|
+
def rvalue1
|
2623
|
+
elements[0]
|
2624
|
+
end
|
2625
|
+
|
2626
|
+
def _1
|
2627
|
+
elements[1]
|
2628
|
+
end
|
2629
|
+
|
2630
|
+
def in_operator
|
2631
|
+
elements[2]
|
2632
|
+
end
|
2633
|
+
|
2634
|
+
def _2
|
2635
|
+
elements[3]
|
2636
|
+
end
|
2637
|
+
|
2638
|
+
def rvalue2
|
2639
|
+
elements[4]
|
2640
|
+
end
|
2641
|
+
end
|
2642
|
+
|
2643
|
+
def _nt_in_expression
|
2644
|
+
start_index = index
|
2645
|
+
if node_cache[:in_expression].has_key?(index)
|
2646
|
+
cached = node_cache[:in_expression][index]
|
2647
|
+
if cached
|
2648
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2649
|
+
@index = cached.interval.end
|
2650
|
+
end
|
2651
|
+
return cached
|
2652
|
+
end
|
2653
|
+
|
2654
|
+
i0, s0 = index, []
|
2655
|
+
r1 = _nt_rvalue
|
2656
|
+
s0 << r1
|
2657
|
+
if r1
|
2658
|
+
r2 = _nt__
|
2659
|
+
s0 << r2
|
2660
|
+
if r2
|
2661
|
+
r3 = _nt_in_operator
|
2662
|
+
s0 << r3
|
2663
|
+
if r3
|
2664
|
+
r4 = _nt__
|
2665
|
+
s0 << r4
|
2666
|
+
if r4
|
2667
|
+
r5 = _nt_rvalue
|
2668
|
+
s0 << r5
|
2669
|
+
end
|
2670
|
+
end
|
2671
|
+
end
|
2672
|
+
end
|
2673
|
+
if s0.last
|
2674
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::InExpression,input, i0...index, s0)
|
2675
|
+
r0.extend(InExpression0)
|
2676
|
+
else
|
2677
|
+
@index = i0
|
2678
|
+
r0 = nil
|
2679
|
+
end
|
2680
|
+
|
2681
|
+
node_cache[:in_expression][start_index] = r0
|
2682
|
+
|
2683
|
+
r0
|
2684
|
+
end
|
2685
|
+
|
2686
|
+
module NotInExpression0
|
2687
|
+
def rvalue1
|
2688
|
+
elements[0]
|
2689
|
+
end
|
2690
|
+
|
2691
|
+
def _1
|
2692
|
+
elements[1]
|
2693
|
+
end
|
2694
|
+
|
2695
|
+
def not_in_operator
|
2696
|
+
elements[2]
|
2697
|
+
end
|
2698
|
+
|
2699
|
+
def _2
|
2700
|
+
elements[3]
|
2701
|
+
end
|
2702
|
+
|
2703
|
+
def rvalue2
|
2704
|
+
elements[4]
|
2705
|
+
end
|
2706
|
+
end
|
2707
|
+
|
2708
|
+
def _nt_not_in_expression
|
2709
|
+
start_index = index
|
2710
|
+
if node_cache[:not_in_expression].has_key?(index)
|
2711
|
+
cached = node_cache[:not_in_expression][index]
|
2712
|
+
if cached
|
2713
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2714
|
+
@index = cached.interval.end
|
2715
|
+
end
|
2716
|
+
return cached
|
2717
|
+
end
|
2718
|
+
|
2719
|
+
i0, s0 = index, []
|
2720
|
+
r1 = _nt_rvalue
|
2721
|
+
s0 << r1
|
2722
|
+
if r1
|
2723
|
+
r2 = _nt__
|
2724
|
+
s0 << r2
|
2725
|
+
if r2
|
2726
|
+
r3 = _nt_not_in_operator
|
2727
|
+
s0 << r3
|
2728
|
+
if r3
|
2729
|
+
r4 = _nt__
|
2730
|
+
s0 << r4
|
2731
|
+
if r4
|
2732
|
+
r5 = _nt_rvalue
|
2733
|
+
s0 << r5
|
2734
|
+
end
|
2735
|
+
end
|
2736
|
+
end
|
2737
|
+
end
|
2738
|
+
if s0.last
|
2739
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::NotInExpression,input, i0...index, s0)
|
2740
|
+
r0.extend(NotInExpression0)
|
2741
|
+
else
|
2742
|
+
@index = i0
|
2743
|
+
r0 = nil
|
2744
|
+
end
|
2745
|
+
|
2746
|
+
node_cache[:not_in_expression][start_index] = r0
|
2747
|
+
|
2748
|
+
r0
|
2749
|
+
end
|
2750
|
+
|
2751
|
+
def _nt_in_operator
|
2752
|
+
start_index = index
|
2753
|
+
if node_cache[:in_operator].has_key?(index)
|
2754
|
+
cached = node_cache[:in_operator][index]
|
2755
|
+
if cached
|
2756
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2757
|
+
@index = cached.interval.end
|
2758
|
+
end
|
2759
|
+
return cached
|
2760
|
+
end
|
2761
|
+
|
2762
|
+
if has_terminal?("in", false, index)
|
2763
|
+
r0 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
2764
|
+
@index += 2
|
2765
|
+
else
|
2766
|
+
terminal_parse_failure("in")
|
2767
|
+
r0 = nil
|
2768
|
+
end
|
2769
|
+
|
2770
|
+
node_cache[:in_operator][start_index] = r0
|
2771
|
+
|
2772
|
+
r0
|
2773
|
+
end
|
2774
|
+
|
2775
|
+
module NotInOperator0
|
2776
|
+
def _
|
2777
|
+
elements[1]
|
2778
|
+
end
|
2779
|
+
|
2780
|
+
end
|
2781
|
+
|
2782
|
+
def _nt_not_in_operator
|
2783
|
+
start_index = index
|
2784
|
+
if node_cache[:not_in_operator].has_key?(index)
|
2785
|
+
cached = node_cache[:not_in_operator][index]
|
2786
|
+
if cached
|
2787
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2788
|
+
@index = cached.interval.end
|
2789
|
+
end
|
2790
|
+
return cached
|
2791
|
+
end
|
2792
|
+
|
2793
|
+
i0, s0 = index, []
|
2794
|
+
if has_terminal?("not ", false, index)
|
2795
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
2796
|
+
@index += 4
|
2797
|
+
else
|
2798
|
+
terminal_parse_failure("not ")
|
2799
|
+
r1 = nil
|
2800
|
+
end
|
2801
|
+
s0 << r1
|
2802
|
+
if r1
|
2803
|
+
r2 = _nt__
|
2804
|
+
s0 << r2
|
2805
|
+
if r2
|
2806
|
+
if has_terminal?("in", false, index)
|
2807
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
2808
|
+
@index += 2
|
2809
|
+
else
|
2810
|
+
terminal_parse_failure("in")
|
2811
|
+
r3 = nil
|
2812
|
+
end
|
2813
|
+
s0 << r3
|
2814
|
+
end
|
2815
|
+
end
|
2816
|
+
if s0.last
|
2817
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
2818
|
+
r0.extend(NotInOperator0)
|
2819
|
+
else
|
2820
|
+
@index = i0
|
2821
|
+
r0 = nil
|
2822
|
+
end
|
2823
|
+
|
2824
|
+
node_cache[:not_in_operator][start_index] = r0
|
2825
|
+
|
2826
|
+
r0
|
2827
|
+
end
|
2828
|
+
|
2829
|
+
def _nt_rvalue
|
2830
|
+
start_index = index
|
2831
|
+
if node_cache[:rvalue].has_key?(index)
|
2832
|
+
cached = node_cache[:rvalue][index]
|
2833
|
+
if cached
|
2834
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2835
|
+
@index = cached.interval.end
|
2836
|
+
end
|
2837
|
+
return cached
|
2838
|
+
end
|
2839
|
+
|
2840
|
+
i0 = index
|
2841
|
+
r1 = _nt_string
|
2842
|
+
if r1
|
2843
|
+
r0 = r1
|
2844
|
+
else
|
2845
|
+
r2 = _nt_number
|
2846
|
+
if r2
|
2847
|
+
r0 = r2
|
2848
|
+
else
|
2849
|
+
r3 = _nt_selector
|
2850
|
+
if r3
|
2851
|
+
r0 = r3
|
2852
|
+
else
|
2853
|
+
r4 = _nt_array
|
2854
|
+
if r4
|
2855
|
+
r0 = r4
|
2856
|
+
else
|
2857
|
+
r5 = _nt_method_call
|
2858
|
+
if r5
|
2859
|
+
r0 = r5
|
2860
|
+
else
|
2861
|
+
r6 = _nt_regexp
|
2862
|
+
if r6
|
2863
|
+
r0 = r6
|
2864
|
+
else
|
2865
|
+
@index = i0
|
2866
|
+
r0 = nil
|
2867
|
+
end
|
2868
|
+
end
|
2869
|
+
end
|
2870
|
+
end
|
2871
|
+
end
|
2872
|
+
end
|
2873
|
+
|
2874
|
+
node_cache[:rvalue][start_index] = r0
|
2875
|
+
|
2876
|
+
r0
|
2877
|
+
end
|
2878
|
+
|
2879
|
+
module MethodCall0
|
2880
|
+
def _1
|
2881
|
+
elements[0]
|
2882
|
+
end
|
2883
|
+
|
2884
|
+
def _2
|
2885
|
+
elements[2]
|
2886
|
+
end
|
2887
|
+
|
2888
|
+
def rvalue
|
2889
|
+
elements[3]
|
2890
|
+
end
|
2891
|
+
end
|
2892
|
+
|
2893
|
+
module MethodCall1
|
2894
|
+
def rvalue
|
2895
|
+
elements[0]
|
2896
|
+
end
|
2897
|
+
|
2898
|
+
end
|
2899
|
+
|
2900
|
+
module MethodCall2
|
2901
|
+
def method
|
2902
|
+
elements[0]
|
2903
|
+
end
|
2904
|
+
|
2905
|
+
def _1
|
2906
|
+
elements[1]
|
2907
|
+
end
|
2908
|
+
|
2909
|
+
def _2
|
2910
|
+
elements[3]
|
2911
|
+
end
|
2912
|
+
|
2913
|
+
def _3
|
2914
|
+
elements[5]
|
2915
|
+
end
|
2916
|
+
|
2917
|
+
end
|
2918
|
+
|
2919
|
+
def _nt_method_call
|
2920
|
+
start_index = index
|
2921
|
+
if node_cache[:method_call].has_key?(index)
|
2922
|
+
cached = node_cache[:method_call][index]
|
2923
|
+
if cached
|
2924
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2925
|
+
@index = cached.interval.end
|
2926
|
+
end
|
2927
|
+
return cached
|
2928
|
+
end
|
2929
|
+
|
2930
|
+
i0, s0 = index, []
|
2931
|
+
r1 = _nt_method
|
2932
|
+
s0 << r1
|
2933
|
+
if r1
|
2934
|
+
r2 = _nt__
|
2935
|
+
s0 << r2
|
2936
|
+
if r2
|
2937
|
+
if has_terminal?("(", false, index)
|
2938
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2939
|
+
@index += 1
|
2940
|
+
else
|
2941
|
+
terminal_parse_failure("(")
|
2942
|
+
r3 = nil
|
2943
|
+
end
|
2944
|
+
s0 << r3
|
2945
|
+
if r3
|
2946
|
+
r4 = _nt__
|
2947
|
+
s0 << r4
|
2948
|
+
if r4
|
2949
|
+
i6, s6 = index, []
|
2950
|
+
r7 = _nt_rvalue
|
2951
|
+
s6 << r7
|
2952
|
+
if r7
|
2953
|
+
s8, i8 = [], index
|
2954
|
+
loop do
|
2955
|
+
i9, s9 = index, []
|
2956
|
+
r10 = _nt__
|
2957
|
+
s9 << r10
|
2958
|
+
if r10
|
2959
|
+
if has_terminal?(",", false, index)
|
2960
|
+
r11 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
2961
|
+
@index += 1
|
2962
|
+
else
|
2963
|
+
terminal_parse_failure(",")
|
2964
|
+
r11 = nil
|
2965
|
+
end
|
2966
|
+
s9 << r11
|
2967
|
+
if r11
|
2968
|
+
r12 = _nt__
|
2969
|
+
s9 << r12
|
2970
|
+
if r12
|
2971
|
+
r13 = _nt_rvalue
|
2972
|
+
s9 << r13
|
2973
|
+
end
|
2974
|
+
end
|
2975
|
+
end
|
2976
|
+
if s9.last
|
2977
|
+
r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
|
2978
|
+
r9.extend(MethodCall0)
|
2979
|
+
else
|
2980
|
+
@index = i9
|
2981
|
+
r9 = nil
|
2982
|
+
end
|
2983
|
+
if r9
|
2984
|
+
s8 << r9
|
2985
|
+
else
|
2986
|
+
break
|
2987
|
+
end
|
2988
|
+
end
|
2989
|
+
r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
|
2990
|
+
s6 << r8
|
2991
|
+
end
|
2992
|
+
if s6.last
|
2993
|
+
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
|
2994
|
+
r6.extend(MethodCall1)
|
2995
|
+
else
|
2996
|
+
@index = i6
|
2997
|
+
r6 = nil
|
2998
|
+
end
|
2999
|
+
if r6
|
3000
|
+
r5 = r6
|
3001
|
+
else
|
3002
|
+
r5 = instantiate_node(SyntaxNode,input, index...index)
|
3003
|
+
end
|
3004
|
+
s0 << r5
|
3005
|
+
if r5
|
3006
|
+
r14 = _nt__
|
3007
|
+
s0 << r14
|
3008
|
+
if r14
|
3009
|
+
if has_terminal?(")", false, index)
|
3010
|
+
r15 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
3011
|
+
@index += 1
|
3012
|
+
else
|
3013
|
+
terminal_parse_failure(")")
|
3014
|
+
r15 = nil
|
3015
|
+
end
|
3016
|
+
s0 << r15
|
3017
|
+
end
|
3018
|
+
end
|
3019
|
+
end
|
3020
|
+
end
|
3021
|
+
end
|
3022
|
+
end
|
3023
|
+
if s0.last
|
3024
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::MethodCall,input, i0...index, s0)
|
3025
|
+
r0.extend(MethodCall2)
|
3026
|
+
else
|
3027
|
+
@index = i0
|
3028
|
+
r0 = nil
|
3029
|
+
end
|
3030
|
+
|
3031
|
+
node_cache[:method_call][start_index] = r0
|
3032
|
+
|
3033
|
+
r0
|
3034
|
+
end
|
3035
|
+
|
3036
|
+
def _nt_method
|
3037
|
+
start_index = index
|
3038
|
+
if node_cache[:method].has_key?(index)
|
3039
|
+
cached = node_cache[:method][index]
|
3040
|
+
if cached
|
3041
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
3042
|
+
@index = cached.interval.end
|
3043
|
+
end
|
3044
|
+
return cached
|
3045
|
+
end
|
3046
|
+
|
3047
|
+
r0 = _nt_bareword
|
3048
|
+
|
3049
|
+
node_cache[:method][start_index] = r0
|
3050
|
+
|
3051
|
+
r0
|
3052
|
+
end
|
3053
|
+
|
3054
|
+
module CompareExpression0
|
3055
|
+
def rvalue1
|
3056
|
+
elements[0]
|
3057
|
+
end
|
3058
|
+
|
3059
|
+
def _1
|
3060
|
+
elements[1]
|
3061
|
+
end
|
3062
|
+
|
3063
|
+
def compare_operator
|
3064
|
+
elements[2]
|
3065
|
+
end
|
3066
|
+
|
3067
|
+
def _2
|
3068
|
+
elements[3]
|
3069
|
+
end
|
3070
|
+
|
3071
|
+
def rvalue2
|
3072
|
+
elements[4]
|
3073
|
+
end
|
3074
|
+
end
|
3075
|
+
|
3076
|
+
def _nt_compare_expression
|
3077
|
+
start_index = index
|
3078
|
+
if node_cache[:compare_expression].has_key?(index)
|
3079
|
+
cached = node_cache[:compare_expression][index]
|
3080
|
+
if cached
|
3081
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
3082
|
+
@index = cached.interval.end
|
3083
|
+
end
|
3084
|
+
return cached
|
3085
|
+
end
|
3086
|
+
|
3087
|
+
i0, s0 = index, []
|
3088
|
+
r1 = _nt_rvalue
|
3089
|
+
s0 << r1
|
3090
|
+
if r1
|
3091
|
+
r2 = _nt__
|
3092
|
+
s0 << r2
|
3093
|
+
if r2
|
3094
|
+
r3 = _nt_compare_operator
|
3095
|
+
s0 << r3
|
3096
|
+
if r3
|
3097
|
+
r4 = _nt__
|
3098
|
+
s0 << r4
|
3099
|
+
if r4
|
3100
|
+
r5 = _nt_rvalue
|
3101
|
+
s0 << r5
|
3102
|
+
end
|
3103
|
+
end
|
3104
|
+
end
|
3105
|
+
end
|
3106
|
+
if s0.last
|
3107
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::ComparisonExpression,input, i0...index, s0)
|
3108
|
+
r0.extend(CompareExpression0)
|
3109
|
+
else
|
3110
|
+
@index = i0
|
3111
|
+
r0 = nil
|
3112
|
+
end
|
3113
|
+
|
3114
|
+
node_cache[:compare_expression][start_index] = r0
|
3115
|
+
|
3116
|
+
r0
|
3117
|
+
end
|
3118
|
+
|
3119
|
+
def _nt_compare_operator
|
3120
|
+
start_index = index
|
3121
|
+
if node_cache[:compare_operator].has_key?(index)
|
3122
|
+
cached = node_cache[:compare_operator][index]
|
3123
|
+
if cached
|
3124
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
3125
|
+
@index = cached.interval.end
|
3126
|
+
end
|
3127
|
+
return cached
|
3128
|
+
end
|
3129
|
+
|
3130
|
+
i0 = index
|
3131
|
+
if has_terminal?("==", false, index)
|
3132
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
3133
|
+
@index += 2
|
3134
|
+
else
|
3135
|
+
terminal_parse_failure("==")
|
3136
|
+
r1 = nil
|
3137
|
+
end
|
3138
|
+
if r1
|
3139
|
+
r0 = r1
|
3140
|
+
r0.extend(LogStash::Compiler::LSCL::AST::ComparisonOperator)
|
3141
|
+
else
|
3142
|
+
if has_terminal?("!=", false, index)
|
3143
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
3144
|
+
@index += 2
|
3145
|
+
else
|
3146
|
+
terminal_parse_failure("!=")
|
3147
|
+
r2 = nil
|
3148
|
+
end
|
3149
|
+
if r2
|
3150
|
+
r0 = r2
|
3151
|
+
r0.extend(LogStash::Compiler::LSCL::AST::ComparisonOperator)
|
3152
|
+
else
|
3153
|
+
if has_terminal?("<=", false, index)
|
3154
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
3155
|
+
@index += 2
|
3156
|
+
else
|
3157
|
+
terminal_parse_failure("<=")
|
3158
|
+
r3 = nil
|
3159
|
+
end
|
3160
|
+
if r3
|
3161
|
+
r0 = r3
|
3162
|
+
r0.extend(LogStash::Compiler::LSCL::AST::ComparisonOperator)
|
3163
|
+
else
|
3164
|
+
if has_terminal?(">=", false, index)
|
3165
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
3166
|
+
@index += 2
|
3167
|
+
else
|
3168
|
+
terminal_parse_failure(">=")
|
3169
|
+
r4 = nil
|
3170
|
+
end
|
3171
|
+
if r4
|
3172
|
+
r0 = r4
|
3173
|
+
r0.extend(LogStash::Compiler::LSCL::AST::ComparisonOperator)
|
3174
|
+
else
|
3175
|
+
if has_terminal?("<", false, index)
|
3176
|
+
r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
3177
|
+
@index += 1
|
3178
|
+
else
|
3179
|
+
terminal_parse_failure("<")
|
3180
|
+
r5 = nil
|
3181
|
+
end
|
3182
|
+
if r5
|
3183
|
+
r0 = r5
|
3184
|
+
r0.extend(LogStash::Compiler::LSCL::AST::ComparisonOperator)
|
3185
|
+
else
|
3186
|
+
if has_terminal?(">", false, index)
|
3187
|
+
r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
3188
|
+
@index += 1
|
3189
|
+
else
|
3190
|
+
terminal_parse_failure(">")
|
3191
|
+
r6 = nil
|
3192
|
+
end
|
3193
|
+
if r6
|
3194
|
+
r0 = r6
|
3195
|
+
r0.extend(LogStash::Compiler::LSCL::AST::ComparisonOperator)
|
3196
|
+
else
|
3197
|
+
@index = i0
|
3198
|
+
r0 = nil
|
3199
|
+
end
|
3200
|
+
end
|
3201
|
+
end
|
3202
|
+
end
|
3203
|
+
end
|
3204
|
+
end
|
3205
|
+
|
3206
|
+
node_cache[:compare_operator][start_index] = r0
|
3207
|
+
|
3208
|
+
r0
|
3209
|
+
end
|
3210
|
+
|
3211
|
+
module RegexpExpression0
|
3212
|
+
def rvalue
|
3213
|
+
elements[0]
|
3214
|
+
end
|
3215
|
+
|
3216
|
+
def _1
|
3217
|
+
elements[1]
|
3218
|
+
end
|
3219
|
+
|
3220
|
+
def regexp_operator
|
3221
|
+
elements[2]
|
3222
|
+
end
|
3223
|
+
|
3224
|
+
def _2
|
3225
|
+
elements[3]
|
3226
|
+
end
|
3227
|
+
|
3228
|
+
end
|
3229
|
+
|
3230
|
+
def _nt_regexp_expression
|
3231
|
+
start_index = index
|
3232
|
+
if node_cache[:regexp_expression].has_key?(index)
|
3233
|
+
cached = node_cache[:regexp_expression][index]
|
3234
|
+
if cached
|
3235
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
3236
|
+
@index = cached.interval.end
|
3237
|
+
end
|
3238
|
+
return cached
|
3239
|
+
end
|
3240
|
+
|
3241
|
+
i0, s0 = index, []
|
3242
|
+
r1 = _nt_rvalue
|
3243
|
+
s0 << r1
|
3244
|
+
if r1
|
3245
|
+
r2 = _nt__
|
3246
|
+
s0 << r2
|
3247
|
+
if r2
|
3248
|
+
r3 = _nt_regexp_operator
|
3249
|
+
s0 << r3
|
3250
|
+
if r3
|
3251
|
+
r4 = _nt__
|
3252
|
+
s0 << r4
|
3253
|
+
if r4
|
3254
|
+
i5 = index
|
3255
|
+
r6 = _nt_string
|
3256
|
+
if r6
|
3257
|
+
r5 = r6
|
3258
|
+
else
|
3259
|
+
r7 = _nt_regexp
|
3260
|
+
if r7
|
3261
|
+
r5 = r7
|
3262
|
+
else
|
3263
|
+
@index = i5
|
3264
|
+
r5 = nil
|
3265
|
+
end
|
3266
|
+
end
|
3267
|
+
s0 << r5
|
3268
|
+
end
|
3269
|
+
end
|
3270
|
+
end
|
3271
|
+
end
|
3272
|
+
if s0.last
|
3273
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::RegexpExpression,input, i0...index, s0)
|
3274
|
+
r0.extend(RegexpExpression0)
|
3275
|
+
else
|
3276
|
+
@index = i0
|
3277
|
+
r0 = nil
|
3278
|
+
end
|
3279
|
+
|
3280
|
+
node_cache[:regexp_expression][start_index] = r0
|
3281
|
+
|
3282
|
+
r0
|
3283
|
+
end
|
3284
|
+
|
3285
|
+
def _nt_regexp_operator
|
3286
|
+
start_index = index
|
3287
|
+
if node_cache[:regexp_operator].has_key?(index)
|
3288
|
+
cached = node_cache[:regexp_operator][index]
|
3289
|
+
if cached
|
3290
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
3291
|
+
@index = cached.interval.end
|
3292
|
+
end
|
3293
|
+
return cached
|
3294
|
+
end
|
3295
|
+
|
3296
|
+
i0 = index
|
3297
|
+
if has_terminal?("=~", false, index)
|
3298
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
3299
|
+
@index += 2
|
3300
|
+
else
|
3301
|
+
terminal_parse_failure("=~")
|
3302
|
+
r1 = nil
|
3303
|
+
end
|
3304
|
+
if r1
|
3305
|
+
r0 = r1
|
3306
|
+
r0.extend(LogStash::Compiler::LSCL::AST::RegExpOperator)
|
3307
|
+
else
|
3308
|
+
if has_terminal?("!~", false, index)
|
3309
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
3310
|
+
@index += 2
|
3311
|
+
else
|
3312
|
+
terminal_parse_failure("!~")
|
3313
|
+
r2 = nil
|
3314
|
+
end
|
3315
|
+
if r2
|
3316
|
+
r0 = r2
|
3317
|
+
r0.extend(LogStash::Compiler::LSCL::AST::RegExpOperator)
|
3318
|
+
else
|
3319
|
+
@index = i0
|
3320
|
+
r0 = nil
|
3321
|
+
end
|
3322
|
+
end
|
3323
|
+
|
3324
|
+
node_cache[:regexp_operator][start_index] = r0
|
3325
|
+
|
3326
|
+
r0
|
3327
|
+
end
|
3328
|
+
|
3329
|
+
def _nt_boolean_operator
|
3330
|
+
start_index = index
|
3331
|
+
if node_cache[:boolean_operator].has_key?(index)
|
3332
|
+
cached = node_cache[:boolean_operator][index]
|
3333
|
+
if cached
|
3334
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
3335
|
+
@index = cached.interval.end
|
3336
|
+
end
|
3337
|
+
return cached
|
3338
|
+
end
|
3339
|
+
|
3340
|
+
i0 = index
|
3341
|
+
if has_terminal?("and", false, index)
|
3342
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
3343
|
+
@index += 3
|
3344
|
+
else
|
3345
|
+
terminal_parse_failure("and")
|
3346
|
+
r1 = nil
|
3347
|
+
end
|
3348
|
+
if r1
|
3349
|
+
r0 = r1
|
3350
|
+
r0.extend(LogStash::Compiler::LSCL::AST::BooleanOperator)
|
3351
|
+
else
|
3352
|
+
if has_terminal?("or", false, index)
|
3353
|
+
r2 = instantiate_node(SyntaxNode,input, index...(index + 2))
|
3354
|
+
@index += 2
|
3355
|
+
else
|
3356
|
+
terminal_parse_failure("or")
|
3357
|
+
r2 = nil
|
3358
|
+
end
|
3359
|
+
if r2
|
3360
|
+
r0 = r2
|
3361
|
+
r0.extend(LogStash::Compiler::LSCL::AST::BooleanOperator)
|
3362
|
+
else
|
3363
|
+
if has_terminal?("xor", false, index)
|
3364
|
+
r3 = instantiate_node(SyntaxNode,input, index...(index + 3))
|
3365
|
+
@index += 3
|
3366
|
+
else
|
3367
|
+
terminal_parse_failure("xor")
|
3368
|
+
r3 = nil
|
3369
|
+
end
|
3370
|
+
if r3
|
3371
|
+
r0 = r3
|
3372
|
+
r0.extend(LogStash::Compiler::LSCL::AST::BooleanOperator)
|
3373
|
+
else
|
3374
|
+
if has_terminal?("nand", false, index)
|
3375
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 4))
|
3376
|
+
@index += 4
|
3377
|
+
else
|
3378
|
+
terminal_parse_failure("nand")
|
3379
|
+
r4 = nil
|
3380
|
+
end
|
3381
|
+
if r4
|
3382
|
+
r0 = r4
|
3383
|
+
r0.extend(LogStash::Compiler::LSCL::AST::BooleanOperator)
|
3384
|
+
else
|
3385
|
+
@index = i0
|
3386
|
+
r0 = nil
|
3387
|
+
end
|
3388
|
+
end
|
3389
|
+
end
|
3390
|
+
end
|
3391
|
+
|
3392
|
+
node_cache[:boolean_operator][start_index] = r0
|
3393
|
+
|
3394
|
+
r0
|
3395
|
+
end
|
3396
|
+
|
3397
|
+
def _nt_selector
|
3398
|
+
start_index = index
|
3399
|
+
if node_cache[:selector].has_key?(index)
|
3400
|
+
cached = node_cache[:selector][index]
|
3401
|
+
if cached
|
3402
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
3403
|
+
@index = cached.interval.end
|
3404
|
+
end
|
3405
|
+
return cached
|
3406
|
+
end
|
3407
|
+
|
3408
|
+
s0, i0 = [], index
|
3409
|
+
loop do
|
3410
|
+
r1 = _nt_selector_element
|
3411
|
+
if r1
|
3412
|
+
s0 << r1
|
3413
|
+
else
|
3414
|
+
break
|
3415
|
+
end
|
3416
|
+
end
|
3417
|
+
if s0.empty?
|
3418
|
+
@index = i0
|
3419
|
+
r0 = nil
|
3420
|
+
else
|
3421
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::Selector,input, i0...index, s0)
|
3422
|
+
end
|
3423
|
+
|
3424
|
+
node_cache[:selector][start_index] = r0
|
3425
|
+
|
3426
|
+
r0
|
3427
|
+
end
|
3428
|
+
|
3429
|
+
module SelectorElement0
|
3430
|
+
end
|
3431
|
+
|
3432
|
+
def _nt_selector_element
|
3433
|
+
start_index = index
|
3434
|
+
if node_cache[:selector_element].has_key?(index)
|
3435
|
+
cached = node_cache[:selector_element][index]
|
3436
|
+
if cached
|
3437
|
+
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
3438
|
+
@index = cached.interval.end
|
3439
|
+
end
|
3440
|
+
return cached
|
3441
|
+
end
|
3442
|
+
|
3443
|
+
i0, s0 = index, []
|
3444
|
+
if has_terminal?("[", false, index)
|
3445
|
+
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
3446
|
+
@index += 1
|
3447
|
+
else
|
3448
|
+
terminal_parse_failure("[")
|
3449
|
+
r1 = nil
|
3450
|
+
end
|
3451
|
+
s0 << r1
|
3452
|
+
if r1
|
3453
|
+
s2, i2 = [], index
|
3454
|
+
loop do
|
3455
|
+
if has_terminal?('\G[^\\],]', true, index)
|
3456
|
+
r3 = true
|
3457
|
+
@index += 1
|
3458
|
+
else
|
3459
|
+
r3 = nil
|
3460
|
+
end
|
3461
|
+
if r3
|
3462
|
+
s2 << r3
|
3463
|
+
else
|
3464
|
+
break
|
3465
|
+
end
|
3466
|
+
end
|
3467
|
+
if s2.empty?
|
3468
|
+
@index = i2
|
3469
|
+
r2 = nil
|
3470
|
+
else
|
3471
|
+
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
|
3472
|
+
end
|
3473
|
+
s0 << r2
|
3474
|
+
if r2
|
3475
|
+
if has_terminal?("]", false, index)
|
3476
|
+
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
|
3477
|
+
@index += 1
|
3478
|
+
else
|
3479
|
+
terminal_parse_failure("]")
|
3480
|
+
r4 = nil
|
3481
|
+
end
|
3482
|
+
s0 << r4
|
3483
|
+
end
|
3484
|
+
end
|
3485
|
+
if s0.last
|
3486
|
+
r0 = instantiate_node(LogStash::Compiler::LSCL::AST::SelectorElement,input, i0...index, s0)
|
3487
|
+
r0.extend(SelectorElement0)
|
3488
|
+
else
|
3489
|
+
@index = i0
|
3490
|
+
r0 = nil
|
3491
|
+
end
|
3492
|
+
|
3493
|
+
node_cache[:selector_element][start_index] = r0
|
3494
|
+
|
3495
|
+
r0
|
3496
|
+
end
|
3497
|
+
|
3498
|
+
end
|
3499
|
+
|
3500
|
+
class LogStashCompilerLSCLGrammarParser < Treetop::Runtime::CompiledParser
|
3501
|
+
include LogStashCompilerLSCLGrammar
|
3502
|
+
end
|
3503
|
+
|