ruby-puppetdb 1.6.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. checksums.yaml +8 -8
  2. data/bin/find-nodes +34 -21
  3. data/lib/hiera/backend/puppetdb_backend.rb +15 -12
  4. data/lib/puppet/application/query.rb +10 -4
  5. data/lib/puppet/face/query.rb +37 -31
  6. data/lib/puppet/parser/functions/query_facts.rb +9 -4
  7. data/lib/puppet/parser/functions/query_nodes.rb +13 -8
  8. data/lib/puppet/parser/functions/query_resources.rb +35 -6
  9. data/lib/puppetdb.rb +1 -1
  10. data/lib/puppetdb/astnode.rb +92 -44
  11. data/lib/puppetdb/connection.rb +14 -69
  12. data/lib/puppetdb/grammar.racc +75 -40
  13. data/lib/puppetdb/lexer.rb +23 -4
  14. data/lib/puppetdb/lexer.rex +30 -24
  15. data/lib/puppetdb/parser.rb +245 -223
  16. data/lib/puppetdb/parser_helper.rb +48 -0
  17. data/spec/unit/puppetdb/parser_spec.rb +129 -0
  18. metadata +7 -28
  19. data/lib/puppet/parser/functions/pdbfactquery.rb +0 -31
  20. data/lib/puppet/parser/functions/pdbnodequery.rb +0 -38
  21. data/lib/puppet/parser/functions/pdbnodequery_all.rb +0 -40
  22. data/lib/puppet/parser/functions/pdbquery.rb +0 -41
  23. data/lib/puppet/parser/functions/pdbresourcequery.rb +0 -39
  24. data/lib/puppet/parser/functions/pdbresourcequery_all.rb +0 -37
  25. data/lib/puppet/parser/functions/pdbstatusquery.rb +0 -31
  26. data/lib/puppetdb/util.rb +0 -18
  27. data/spec/unit/puppet/parser/functions/pdbfactquery_spec.rb +0 -19
  28. data/spec/unit/puppet/parser/functions/pdbnodequery_all_spec.rb +0 -19
  29. data/spec/unit/puppet/parser/functions/pdbnodequery_spec.rb +0 -19
  30. data/spec/unit/puppet/parser/functions/pdbquery_spec.rb +0 -19
  31. data/spec/unit/puppet/parser/functions/pdbresourcequery_all_spec.rb +0 -19
  32. data/spec/unit/puppet/parser/functions/pdbresourcequery_spec.rb +0 -19
  33. data/spec/unit/puppet/parser/functions/pdbstatusquery_spec.rb +0 -19
  34. data/spec/unit/puppetdb/connection_spec.rb +0 -67
@@ -5,29 +5,35 @@ require 'puppetdb'
5
5
 
6
6
  class PuppetDB::Lexer
7
7
  macro
8
- STR [\w_:]
8
+ STR [\w_:]
9
9
  rule
10
- \s # whitespace no action
11
- \( { [:LPAREN, text] }
12
- \) { [:RPAREN, text] }
13
- \[ { [:LBRACK, text] }
14
- \] { [:RBRACK, text] }
15
- \{ { [:LBRACE, text] }
16
- \} { [:RBRACE, text] }
17
- = { [:EQUALS, text] }
18
- \!= { [:NOTEQUALS, text] }
19
- ~ { [:MATCH, text] }
20
- < { [:LESSTHAN, text] }
21
- > { [:GREATERTHAN, text] }
22
- not(?!{STR}) { [:NOT, text] }
23
- and(?!{STR}) { [:AND, text] }
24
- or(?!{STR}) { [:OR, text] }
25
- true(?!{STR}) { [:BOOLEAN, true]}
26
- false(?!{STR}) { [:BOOLEAN, false]}
27
- -?\d+\.\d+ { [:NUMBER, text.to_f] }
28
- -?\d+ { [:NUMBER, text.to_i] }
29
- \"(\\.|[^\\"])*\" { [:STRING, YAML.load(text)] }
30
- \'(\\.|[^\\'])*\' { [:STRING, YAML.load(text)] }
31
- {STR}+ { [:STRING, text] }
32
- @@ { [:EXPORTED, text] }
10
+ \s # whitespace no action
11
+ \( { [:LPAREN, text] }
12
+ \) { [:RPAREN, text] }
13
+ \[ { [:LBRACK, text] }
14
+ \] { [:RBRACK, text] }
15
+ \{ { [:LBRACE, text] }
16
+ \} { [:RBRACE, text] }
17
+ = { [:EQUALS, text] }
18
+ \!= { [:NOTEQUALS, text] }
19
+ ~ { [:MATCH, text] }
20
+ \!~ { [:NOTMATCH, text] }
21
+ < { [:LESSTHAN, text] }
22
+ <= { [:LESSTHANEQ, text] }
23
+ > { [:GREATERTHAN, text] }
24
+ >= { [:GREATERTHANEQ, text] }
25
+ \* { [:ASTERISK, text] }
26
+ \# { [:HASH, text] }
27
+ \. { [:DOT, text] }
28
+ not(?!{STR}) { [:NOT, text] }
29
+ and(?!{STR}) { [:AND, text] }
30
+ or(?!{STR}) { [:OR, text] }
31
+ true(?!{STR}) { [:BOOLEAN, true]}
32
+ false(?!{STR}) { [:BOOLEAN, false]}
33
+ -?\d+ { [:NUMBER, text.to_i] }
34
+ \"(\\.|[^\\"])*\" { [:STRING, YAML.load(text)] }
35
+ \'(\\.|[^\\'])*\' { [:STRING, YAML.load(text)] }
36
+ {STR}+ { [:STRING, text] }
37
+ @@ { [:EXPORTED, text] }
38
+ @ { [:AT, text] }
33
39
  end
@@ -9,103 +9,137 @@ require 'racc/parser.rb'
9
9
  require 'puppetdb'
10
10
  require 'puppetdb/lexer'
11
11
  require 'puppetdb/astnode'
12
+ require 'puppetdb/parser_helper'
12
13
  module PuppetDB
13
14
  class Parser < PuppetDB::Lexer
15
+
16
+ module_eval(<<'...end grammar.racc/module_eval...', 'grammar.racc', 91)
17
+ include PuppetDB::ParserHelper
18
+
19
+ ...end grammar.racc/module_eval...
14
20
  ##### State transition tables begin ###
15
21
 
16
22
  racc_action_table = [
17
- 3, 3, 14, 14, 15, 15, 32, 42, 41, 43,
18
- 15, 4, 4, 31, 37, 13, 13, 12, 12, 3,
19
- 3, 14, 14, 15, 15, 17, 18, 14, 42, 15,
20
- 4, 4, 17, 18, 13, 13, 12, 12, 3, 3,
21
- 14, 14, 15, 15, 14, 42, 15, 41, 34, 4,
22
- 4, 53, 16, 13, 13, 12, 12, 27, 17, 18,
23
- 21, 25, 24, 23, 22, -31, -31, -31, -31, -31,
24
- 42, 41, 43, 51, 52, 15, 17, 54 ]
23
+ 5, 54, 19, 20, 58, 55, 19, 17, 11, 57,
24
+ 17, 5, 33, 17, 52, 14, 12, 17, 4, 11,
25
+ 63, 16, 17, 5, 15, 54, 14, 12, 37, 4,
26
+ 18, 11, 16, 17, 5, 15, 66, 54, 14, 12,
27
+ nil, 4, 11, nil, 16, 17, 5, 15, nil, 14,
28
+ 12, nil, 4, nil, 11, 16, 17, 5, 15, nil,
29
+ nil, 14, 12, 11, 4, 11, 50, 16, 17, nil,
30
+ 15, 12, 14, 12, 65, 4, 16, 17, 16, 17,
31
+ nil, 15, 11, nil, 19, 20, 11, nil, 19, 20,
32
+ 12, nil, nil, 11, 12, 16, 17, nil, nil, 16,
33
+ 17, 12, nil, nil, nil, nil, 16, 17, 23, 24,
34
+ 21, 22, 27, 28, 25, 26, nil, nil, nil, 30,
35
+ 23, 24, 21, 22, 27, 28, 25, 26, 44, nil,
36
+ nil, 30, nil, nil, nil, 47, 17, 46 ]
25
37
 
26
38
  racc_action_check = [
27
- 0, 18, 0, 18, 0, 18, 14, 25, 25, 25,
28
- 28, 0, 18, 14, 19, 0, 18, 0, 18, 15,
29
- 3, 15, 3, 15, 3, 19, 19, 9, 22, 9,
30
- 15, 3, 2, 2, 15, 3, 15, 3, 4, 17,
31
- 4, 17, 4, 17, 8, 23, 8, 24, 16, 4,
32
- 17, 33, 1, 4, 17, 4, 17, 8, 33, 33,
33
- 5, 5, 5, 5, 5, 13, 13, 13, 13, 13,
34
- 21, 21, 21, 31, 32, 10, 36, 52 ]
39
+ 0, 35, 2, 2, 51, 36, 39, 44, 0, 47,
40
+ 11, 20, 9, 14, 35, 0, 0, 15, 0, 20,
41
+ 57, 0, 0, 19, 0, 58, 20, 20, 18, 20,
42
+ 1, 19, 20, 20, 54, 20, 62, 66, 19, 19,
43
+ nil, 19, 54, nil, 19, 19, 4, 19, nil, 54,
44
+ 54, nil, 54, nil, 4, 54, 54, 5, 54, nil,
45
+ nil, 4, 4, 55, 4, 5, 32, 4, 4, nil,
46
+ 4, 55, 5, 5, 61, 5, 55, 55, 5, 5,
47
+ nil, 5, 30, nil, 32, 32, 52, nil, 61, 61,
48
+ 30, nil, nil, 33, 52, 30, 30, nil, nil, 52,
49
+ 52, 33, nil, nil, nil, nil, 33, 33, 59, 59,
50
+ 59, 59, 59, 59, 59, 59, nil, nil, nil, 59,
51
+ 3, 3, 3, 3, 3, 3, 3, 3, 29, nil,
52
+ nil, 3, nil, nil, nil, 29, 29, 29 ]
35
53
 
36
54
  racc_action_pointer = [
37
- -2, 52, 18, 18, 36, 52, nil, nil, 40, 23,
38
- 69, nil, nil, 57, -4, 17, 48, 37, -1, 11,
39
- nil, 54, 12, 29, 30, -9, nil, nil, 4, nil,
40
- nil, 68, 57, 44, nil, nil, 62, nil, nil, nil,
41
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
42
- nil, nil, 72, nil, nil ]
55
+ -2, 30, -19, 112, 44, 55, nil, nil, nil, 8,
56
+ nil, -14, nil, nil, -11, -7, nil, nil, 28, 21,
57
+ 9, nil, nil, nil, nil, nil, nil, nil, nil, 112,
58
+ 72, nil, 63, 83, nil, -5, 1, nil, nil, -15,
59
+ nil, nil, nil, nil, -17, nil, nil, -10, nil, nil,
60
+ nil, -1, 76, nil, 32, 53, nil, -3, 19, 100,
61
+ nil, 67, 31, nil, nil, nil, 31, nil ]
43
62
 
44
63
  racc_action_default = [
45
- -1, -34, -2, -34, -34, -34, -16, -17, -34, -19,
46
- -20, -21, -26, -27, -34, -34, -34, -34, -34, -34,
47
- -4, -34, -34, -34, -34, -34, -18, -27, -22, -24,
48
- -23, -34, -34, -34, 55, -5, -6, -3, -7, -8,
49
- -9, -31, -32, -33, -10, -11, -12, -13, -14, -15,
50
- -25, -28, -34, -30, -29 ]
64
+ -2, -42, -1, -3, -42, -42, -8, -9, -10, -25,
65
+ -26, -42, -28, -29, -42, -42, -39, -40, -42, -42,
66
+ -42, -16, -17, -18, -19, -20, -21, -22, -23, -42,
67
+ -42, -4, -42, -42, -27, -42, -42, 68, -5, -6,
68
+ -11, -12, -13, -14, -42, -24, -38, -39, -25, -30,
69
+ -7, -42, -42, -32, -42, -42, -15, -42, -34, -42,
70
+ -31, -42, -42, -41, -35, -33, -36, -37 ]
51
71
 
52
72
  racc_goto_table = [
53
- 29, 30, 26, 2, 28, 38, 19, 20, 46, 49,
54
- 39, 40, 44, 45, 48, 47, 1, nil, 33, 50,
55
- 35, 36 ]
73
+ 2, 53, 40, 34, 31, 32, 35, 36, 49, 45,
74
+ 60, 51, 42, 43, 59, 1, nil, nil, nil, 38,
75
+ 39, 41, 48, nil, 64, 48, nil, nil, nil, nil,
76
+ nil, nil, 67, 62, nil, nil, 56, nil, nil, nil,
77
+ nil, nil, nil, nil, 48, nil, nil, 48, nil, nil,
78
+ nil, nil, nil, nil, 61 ]
56
79
 
57
80
  racc_goto_check = [
58
- 11, 11, 7, 2, 10, 3, 2, 2, 3, 3,
59
- 4, 5, 5, 5, 4, 5, 1, nil, 2, 11,
60
- 2, 2 ]
81
+ 2, 14, 8, 9, 2, 2, 9, 9, 13, 7,
82
+ 5, 13, 10, 11, 3, 1, nil, nil, nil, 2,
83
+ 2, 9, 9, nil, 14, 9, nil, nil, nil, nil,
84
+ nil, nil, 14, 13, nil, nil, 9, nil, nil, nil,
85
+ nil, nil, nil, nil, 9, nil, nil, 9, nil, nil,
86
+ nil, nil, nil, nil, 2 ]
61
87
 
62
88
  racc_goto_pointer = [
63
- nil, 16, 3, -16, -11, -10, nil, -6, nil, nil,
64
- -5, -9 ]
89
+ nil, 15, 0, -38, nil, -42, nil, -20, -27, -8,
90
+ -17, -16, nil, -22, -34 ]
65
91
 
66
92
  racc_goto_default = [
67
- nil, nil, nil, 5, nil, nil, 6, 7, 8, 9,
68
- 10, 11 ]
93
+ nil, nil, nil, 3, 6, 7, 8, nil, nil, 9,
94
+ 10, nil, 29, 13, nil ]
69
95
 
70
96
  racc_reduce_table = [
71
97
  0, 0, :racc_error,
72
- 0, 21, :_reduce_none,
73
- 1, 21, :_reduce_none,
74
- 3, 22, :_reduce_3,
75
- 2, 22, :_reduce_4,
76
- 3, 22, :_reduce_5,
77
- 3, 22, :_reduce_6,
78
- 3, 22, :_reduce_7,
79
- 3, 22, :_reduce_8,
80
- 3, 22, :_reduce_9,
81
- 3, 22, :_reduce_10,
82
- 3, 22, :_reduce_11,
83
- 3, 22, :_reduce_12,
84
- 3, 22, :_reduce_13,
85
- 3, 22, :_reduce_14,
86
- 3, 22, :_reduce_15,
87
- 1, 22, :_reduce_none,
88
- 1, 26, :_reduce_17,
89
- 2, 26, :_reduce_18,
90
- 1, 27, :_reduce_19,
91
- 1, 27, :_reduce_20,
92
- 1, 27, :_reduce_21,
93
- 2, 27, :_reduce_22,
94
- 2, 27, :_reduce_23,
95
- 2, 27, :_reduce_24,
96
- 3, 27, :_reduce_25,
97
98
  1, 28, :_reduce_none,
98
- 1, 29, :_reduce_27,
99
- 3, 30, :_reduce_28,
100
- 4, 30, :_reduce_29,
101
- 3, 31, :_reduce_30,
102
- 1, 23, :_reduce_31,
103
- 1, 25, :_reduce_32,
104
- 1, 24, :_reduce_33 ]
105
-
106
- racc_reduce_n = 34
107
-
108
- racc_shift_n = 55
99
+ 0, 28, :_reduce_none,
100
+ 1, 29, :_reduce_3,
101
+ 2, 29, :_reduce_4,
102
+ 3, 29, :_reduce_5,
103
+ 3, 29, :_reduce_6,
104
+ 3, 29, :_reduce_7,
105
+ 1, 29, :_reduce_none,
106
+ 1, 29, :_reduce_none,
107
+ 1, 29, :_reduce_none,
108
+ 1, 34, :_reduce_11,
109
+ 1, 34, :_reduce_12,
110
+ 1, 34, :_reduce_13,
111
+ 1, 34, :_reduce_14,
112
+ 2, 34, :_reduce_15,
113
+ 1, 39, :_reduce_none,
114
+ 1, 39, :_reduce_none,
115
+ 1, 39, :_reduce_none,
116
+ 1, 39, :_reduce_none,
117
+ 1, 39, :_reduce_none,
118
+ 1, 39, :_reduce_none,
119
+ 1, 39, :_reduce_none,
120
+ 1, 39, :_reduce_none,
121
+ 3, 32, :_reduce_24,
122
+ 1, 40, :_reduce_25,
123
+ 1, 40, :_reduce_26,
124
+ 2, 40, :_reduce_27,
125
+ 1, 40, :_reduce_28,
126
+ 1, 30, :_reduce_29,
127
+ 3, 30, :_reduce_30,
128
+ 4, 33, :_reduce_31,
129
+ 3, 33, :_reduce_32,
130
+ 3, 41, :_reduce_33,
131
+ 4, 31, :_reduce_34,
132
+ 5, 31, :_reduce_35,
133
+ 5, 31, :_reduce_36,
134
+ 6, 31, :_reduce_37,
135
+ 1, 35, :_reduce_none,
136
+ 1, 37, :_reduce_none,
137
+ 1, 36, :_reduce_none,
138
+ 3, 38, :_reduce_41 ]
139
+
140
+ racc_reduce_n = 42
141
+
142
+ racc_shift_n = 68
109
143
 
110
144
  racc_token_table = {
111
145
  false => 0,
@@ -119,19 +153,26 @@ racc_token_table = {
119
153
  :EQUALS => 8,
120
154
  :NOTEQUALS => 9,
121
155
  :MATCH => 10,
122
- :LESSTHAN => 11,
123
- :GREATERTHAN => 12,
124
- :NOT => 13,
125
- :AND => 14,
126
- :OR => 15,
127
- :NUMBER => 16,
128
- :STRING => 17,
129
- :BOOLEAN => 18,
130
- :EXPORTED => 19 }
131
-
132
- racc_nt_base = 20
133
-
134
- racc_use_result_var = true
156
+ :NOTMATCH => 11,
157
+ :LESSTHAN => 12,
158
+ :LESSTHANEQ => 13,
159
+ :GREATERTHAN => 14,
160
+ :GREATERTHANEQ => 15,
161
+ :AT => 16,
162
+ :HASH => 17,
163
+ :ASTERISK => 18,
164
+ :DOT => 19,
165
+ :NOT => 20,
166
+ :AND => 21,
167
+ :OR => 22,
168
+ :NUMBER => 23,
169
+ :STRING => 24,
170
+ :BOOLEAN => 25,
171
+ :EXPORTED => 26 }
172
+
173
+ racc_nt_base = 27
174
+
175
+ racc_use_result_var = false
135
176
 
136
177
  Racc_arg = [
137
178
  racc_action_table,
@@ -161,8 +202,15 @@ Racc_token_to_s_table = [
161
202
  "EQUALS",
162
203
  "NOTEQUALS",
163
204
  "MATCH",
205
+ "NOTMATCH",
164
206
  "LESSTHAN",
207
+ "LESSTHANEQ",
165
208
  "GREATERTHAN",
209
+ "GREATERTHANEQ",
210
+ "AT",
211
+ "HASH",
212
+ "ASTERISK",
213
+ "DOT",
166
214
  "NOT",
167
215
  "AND",
168
216
  "OR",
@@ -172,16 +220,19 @@ Racc_token_to_s_table = [
172
220
  "EXPORTED",
173
221
  "$start",
174
222
  "query",
175
- "exp",
176
- "string",
223
+ "expression",
224
+ "identifier_path",
225
+ "resource_expression",
226
+ "comparison_expression",
227
+ "subquery",
228
+ "literal",
177
229
  "boolean",
178
- "number",
179
- "ressubquery",
180
- "resexp",
181
- "resexported",
182
- "restype",
183
- "restitle",
184
- "resparams" ]
230
+ "string",
231
+ "integer",
232
+ "float",
233
+ "comparison_op",
234
+ "identifier",
235
+ "block_expression" ]
185
236
 
186
237
  Racc_debug_parser = false
187
238
 
@@ -193,214 +244,185 @@ Racc_debug_parser = false
193
244
 
194
245
  # reduce 2 omitted
195
246
 
196
- module_eval(<<'.,.,', 'grammar.y', 21)
197
- def _reduce_3(val, _values, result)
198
- result = val[1]
199
- result
247
+ module_eval(<<'.,.,', 'grammar.racc', 27)
248
+ def _reduce_3(val, _values)
249
+ ASTNode.new :regexp_node_match, val[0]
200
250
  end
201
251
  .,.,
202
252
 
203
- module_eval(<<'.,.,', 'grammar.y', 22)
204
- def _reduce_4(val, _values, result)
205
- result = ASTNode.new :booleanop, :not, [val[1]]
206
- result
253
+ module_eval(<<'.,.,', 'grammar.racc', 28)
254
+ def _reduce_4(val, _values)
255
+ ASTNode.new :booleanop, :not, [val[1]]
207
256
  end
208
257
  .,.,
209
258
 
210
- module_eval(<<'.,.,', 'grammar.y', 23)
211
- def _reduce_5(val, _values, result)
212
- result = ASTNode.new :booleanop, :and, [val[0], val[2]]
213
- result
259
+ module_eval(<<'.,.,', 'grammar.racc', 29)
260
+ def _reduce_5(val, _values)
261
+ ASTNode.new :booleanop, :and, [val[0], val[2]]
214
262
  end
215
263
  .,.,
216
264
 
217
- module_eval(<<'.,.,', 'grammar.y', 24)
218
- def _reduce_6(val, _values, result)
219
- result = ASTNode.new :booleanop, :or, [val[0], val[2]]
220
- result
265
+ module_eval(<<'.,.,', 'grammar.racc', 30)
266
+ def _reduce_6(val, _values)
267
+ ASTNode.new :booleanop, :or, [val[0], val[2]]
221
268
  end
222
269
  .,.,
223
270
 
224
- module_eval(<<'.,.,', 'grammar.y', 25)
225
- def _reduce_7(val, _values, result)
226
- result = ASTNode.new :exp, :equals, [val[0], val[2]]
227
- result
271
+ module_eval(<<'.,.,', 'grammar.racc', 31)
272
+ def _reduce_7(val, _values)
273
+ val[1]
228
274
  end
229
275
  .,.,
230
276
 
231
- module_eval(<<'.,.,', 'grammar.y', 26)
232
- def _reduce_8(val, _values, result)
233
- result = ASTNode.new :exp, :equals, [val[0], val[2]]
234
- result
235
- end
236
- .,.,
277
+ # reduce 8 omitted
237
278
 
238
- module_eval(<<'.,.,', 'grammar.y', 27)
239
- def _reduce_9(val, _values, result)
240
- result = ASTNode.new :exp, :equals, [val[0], val[2]]
241
- result
242
- end
243
- .,.,
279
+ # reduce 9 omitted
244
280
 
245
- module_eval(<<'.,.,', 'grammar.y', 28)
246
- def _reduce_10(val, _values, result)
247
- result = ASTNode.new :exp, :greaterthan, [val[0], val[2]]
248
- result
249
- end
250
- .,.,
281
+ # reduce 10 omitted
251
282
 
252
- module_eval(<<'.,.,', 'grammar.y', 29)
253
- def _reduce_11(val, _values, result)
254
- result = ASTNode.new :exp, :lessthan, [val[0], val[2]]
255
- result
283
+ module_eval(<<'.,.,', 'grammar.racc', 37)
284
+ def _reduce_11(val, _values)
285
+ ASTNode.new :boolean, val[0]
256
286
  end
257
287
  .,.,
258
288
 
259
- module_eval(<<'.,.,', 'grammar.y', 30)
260
- def _reduce_12(val, _values, result)
261
- result = ASTNode.new :exp, :match, [val[0], val[2]]
262
- result
289
+ module_eval(<<'.,.,', 'grammar.racc', 38)
290
+ def _reduce_12(val, _values)
291
+ ASTNode.new :string, val[0]
263
292
  end
264
293
  .,.,
265
294
 
266
- module_eval(<<'.,.,', 'grammar.y', 31)
267
- def _reduce_13(val, _values, result)
268
- result = ASTNode.new :booleanop, :not, [ASTNode.new(:exp, :equals, [val[0], val[2]])]
269
- result
295
+ module_eval(<<'.,.,', 'grammar.racc', 39)
296
+ def _reduce_13(val, _values)
297
+ ASTNode.new :number, val[0]
270
298
  end
271
299
  .,.,
272
300
 
273
- module_eval(<<'.,.,', 'grammar.y', 32)
274
- def _reduce_14(val, _values, result)
275
- result = ASTNode.new :booleanop, :not, [ASTNode.new(:exp, :equals, [val[0], val[2]])]
276
- result
301
+ module_eval(<<'.,.,', 'grammar.racc', 40)
302
+ def _reduce_14(val, _values)
303
+ ASTNode.new :number, val[0]
277
304
  end
278
305
  .,.,
279
306
 
280
- module_eval(<<'.,.,', 'grammar.y', 33)
281
- def _reduce_15(val, _values, result)
282
- result = ASTNode.new :booleanop, :not, [ASTNode.new(:exp, :equals, [val[0], val[2]])]
283
- result
307
+ module_eval(<<'.,.,', 'grammar.racc', 41)
308
+ def _reduce_15(val, _values)
309
+ ASTNode.new :date, val[1]
284
310
  end
285
311
  .,.,
286
312
 
287
313
  # reduce 16 omitted
288
314
 
289
- module_eval(<<'.,.,', 'grammar.y', 36)
290
- def _reduce_17(val, _values, result)
291
- result = ASTNode.new :subquery, :resources, [ASTNode.new(:booleanop, :and, [ASTNode.new(:resexported, false), *val[0]])]
292
- result
293
- end
294
- .,.,
315
+ # reduce 17 omitted
316
+
317
+ # reduce 18 omitted
318
+
319
+ # reduce 19 omitted
320
+
321
+ # reduce 20 omitted
322
+
323
+ # reduce 21 omitted
295
324
 
296
- module_eval(<<'.,.,', 'grammar.y', 37)
297
- def _reduce_18(val, _values, result)
298
- result = ASTNode.new :subquery, :resources, [ASTNode.new(:booleanop, :and, [ASTNode.new(:resexported, true), *val[1]])]
299
- result
325
+ # reduce 22 omitted
326
+
327
+ # reduce 23 omitted
328
+
329
+ module_eval(<<'.,.,', 'grammar.racc', 54)
330
+ def _reduce_24(val, _values)
331
+ ASTNode.new :comparison, val[1], [val[0], val[2]]
300
332
  end
301
333
  .,.,
302
334
 
303
- module_eval(<<'.,.,', 'grammar.y', 39)
304
- def _reduce_19(val, _values, result)
305
- result = [val[0]]
306
- result
335
+ module_eval(<<'.,.,', 'grammar.racc', 57)
336
+ def _reduce_25(val, _values)
337
+ ASTNode.new :identifier, val[0]
307
338
  end
308
339
  .,.,
309
340
 
310
- module_eval(<<'.,.,', 'grammar.y', 40)
311
- def _reduce_20(val, _values, result)
312
- result = [val[0]]
313
- result
341
+ module_eval(<<'.,.,', 'grammar.racc', 58)
342
+ def _reduce_26(val, _values)
343
+ ASTNode.new :identifier, val[0]
314
344
  end
315
345
  .,.,
316
346
 
317
- module_eval(<<'.,.,', 'grammar.y', 41)
318
- def _reduce_21(val, _values, result)
319
- result = [val[0]]
320
- result
347
+ module_eval(<<'.,.,', 'grammar.racc', 59)
348
+ def _reduce_27(val, _values)
349
+ ASTNode.new :regexp_identifier, val[1]
321
350
  end
322
351
  .,.,
323
352
 
324
- module_eval(<<'.,.,', 'grammar.y', 42)
325
- def _reduce_22(val, _values, result)
326
- result = val[0].value == "Class" ? [val[0], val[1].capitalize!] : [val[0], val[1]]
327
- result
353
+ module_eval(<<'.,.,', 'grammar.racc', 60)
354
+ def _reduce_28(val, _values)
355
+ ASTNode.new :regexp_identifier, '.*'
328
356
  end
329
357
  .,.,
330
358
 
331
- module_eval(<<'.,.,', 'grammar.y', 43)
332
- def _reduce_23(val, _values, result)
333
- result = [val[0], val[1]]
334
- result
359
+ module_eval(<<'.,.,', 'grammar.racc', 63)
360
+ def _reduce_29(val, _values)
361
+ ASTNode.new :identifier_path, nil, [val[0]]
335
362
  end
336
363
  .,.,
337
364
 
338
- module_eval(<<'.,.,', 'grammar.y', 44)
339
- def _reduce_24(val, _values, result)
340
- result = [val[0], val[1]]
341
- result
365
+ module_eval(<<'.,.,', 'grammar.racc', 64)
366
+ def _reduce_30(val, _values)
367
+ val[0].children.push val[2]; val[0]
342
368
  end
343
369
  .,.,
344
370
 
345
- module_eval(<<'.,.,', 'grammar.y', 45)
346
- def _reduce_25(val, _values, result)
347
- result = val[0].value == "Class" ? [val[0], val[1].capitalize!, val[2]] : [val[0], val[1], val[2]]
348
- result
371
+ module_eval(<<'.,.,', 'grammar.racc', 67)
372
+ def _reduce_31(val, _values)
373
+ ASTNode.new :subquery, val[1], [val[3]]
349
374
  end
350
375
  .,.,
351
376
 
352
- # reduce 26 omitted
353
-
354
- module_eval(<<'.,.,', 'grammar.y', 48)
355
- def _reduce_27(val, _values, result)
356
- result = ASTNode.new(:resourcetype, val[0]).capitalize!
357
- result
377
+ module_eval(<<'.,.,', 'grammar.racc', 68)
378
+ def _reduce_32(val, _values)
379
+ ASTNode.new :subquery, val[1], [val[2]]
358
380
  end
359
381
  .,.,
360
382
 
361
- module_eval(<<'.,.,', 'grammar.y', 49)
362
- def _reduce_28(val, _values, result)
363
- result = ASTNode.new :resourcetitle, '=', [ASTNode.new(:string, val[1])]
364
- result
383
+ module_eval(<<'.,.,', 'grammar.racc', 71)
384
+ def _reduce_33(val, _values)
385
+ val[1]
365
386
  end
366
387
  .,.,
367
388
 
368
- module_eval(<<'.,.,', 'grammar.y', 50)
369
- def _reduce_29(val, _values, result)
370
- result = ASTNode.new :resourcetitle, '~', [ASTNode.new(:string, val[2])]
371
- result
389
+ module_eval(<<'.,.,', 'grammar.racc', 75)
390
+ def _reduce_34(val, _values)
391
+ ASTNode.new :resource, {:type => val[0], :title => val[2], :exported => false}
372
392
  end
373
393
  .,.,
374
394
 
375
- module_eval(<<'.,.,', 'grammar.y', 51)
376
- def _reduce_30(val, _values, result)
377
- result = val[1]
378
- result
395
+ module_eval(<<'.,.,', 'grammar.racc', 77)
396
+ def _reduce_35(val, _values)
397
+ ASTNode.new :resource, {:type => val[0], :title => val[2], :exported => false}, [val[4]]
379
398
  end
380
399
  .,.,
381
400
 
382
- module_eval(<<'.,.,', 'grammar.y', 53)
383
- def _reduce_31(val, _values, result)
384
- result = ASTNode.new :string, val[0]
385
- result
401
+ module_eval(<<'.,.,', 'grammar.racc', 79)
402
+ def _reduce_36(val, _values)
403
+ ASTNode.new :resource, {:type => val[1], :title => val[3], :exported => true}
386
404
  end
387
405
  .,.,
388
406
 
389
- module_eval(<<'.,.,', 'grammar.y', 54)
390
- def _reduce_32(val, _values, result)
391
- result = ASTNode.new :number, val[0]
392
- result
407
+ module_eval(<<'.,.,', 'grammar.racc', 81)
408
+ def _reduce_37(val, _values)
409
+ ASTNode.new :resource, {:type => val[1], :title => val[3], :exported => true}, [val[5]]
393
410
  end
394
411
  .,.,
395
412
 
396
- module_eval(<<'.,.,', 'grammar.y', 55)
397
- def _reduce_33(val, _values, result)
398
- result = ASTNode.new :boolean, val[0]
399
- result
413
+ # reduce 38 omitted
414
+
415
+ # reduce 39 omitted
416
+
417
+ # reduce 40 omitted
418
+
419
+ module_eval(<<'.,.,', 'grammar.racc', 86)
420
+ def _reduce_41(val, _values)
421
+ "#{val[0]}.#{val[2]}".to_f
400
422
  end
401
423
  .,.,
402
424
 
403
- def _reduce_none(val, _values, result)
425
+ def _reduce_none(val, _values)
404
426
  val[0]
405
427
  end
406
428