Class: Puppet::Pops::Model::ModelTreeDumper Private

Inherits:
TreeDumper show all
Defined in:
lib/puppet/pops/model/model_tree_dumper.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Dumps a Pops::Model in reverse polish notation; i.e. LISP style The intention is to use this for debugging output TODO: BAD NAME - A DUMP is a Ruby Serialization

Instance Attribute Summary

Attributes inherited from TreeDumper

#indent_count

Instance Method Summary collapse

Methods inherited from TreeDumper

#do_dump, #dump, #format, #format_r, #indent, #initialize

Constructor Details

This class inherits a constructor from Puppet::Pops::Model::TreeDumper

Instance Method Details

#dump_AccessExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

x prints as (slice x y)



44
45
46
47
48
49
50
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 44

def dump_AccessExpression o
  if o.keys.size <= 1
    ["slice", do_dump(o.left_expr), do_dump(o.keys[0])]
  else
    ["slice", do_dump(o.left_expr), do_dump(o.keys)]
  end
end

#dump_AndExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



96
97
98
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 96

def dump_AndExpression o
  ["&&", do_dump(o.left_expr), do_dump(o.right_expr)]
end

#dump_Application(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



35
36
37
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 35

def dump_Application o
  ["application", o.name, do_dump(o.parameters), do_dump(o.body)]
end

#dump_ArithmeticExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



39
40
41
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 39

def dump_ArithmeticExpression o
  [o.operator.to_s, do_dump(o.left_expr), do_dump(o.right_expr)]
end

#dump_Array(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



6
7
8
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 6

def dump_Array o
  o.collect {|e| do_dump(e) }
end

#dump_AssignmentExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



108
109
110
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 108

def dump_AssignmentExpression o
  [o.operator.to_s, do_dump(o.left_expr), do_dump(o.right_expr)]
end

#dump_AttributeOperation(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Produces (name => expr) or (name +> expr)



113
114
115
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 113

def dump_AttributeOperation o
  [o.attribute_name, o.operator, do_dump(o.value_expr)]
end

#dump_AttributesOperation(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



117
118
119
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 117

def dump_AttributesOperation o
  ['* =>', do_dump(o.expr)]
end

#dump_BlockExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



197
198
199
200
201
202
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 197

def dump_BlockExpression o
  result = ["block", :indent]
  o.statements.each {|x| result << :break; result << do_dump(x) }
  result << :dedent << :break
  result
end

#dump_CallMethodExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

def dump_CallNamedFunctionExpression o

  result = [o.rval_required ? "call" : "invoke", do_dump(o.functor_expr)]
  o.arguments.collect {|a| result << do_dump(a) }
  result
end


343
344
345
346
347
348
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 343

def dump_CallMethodExpression o
  result = [o.rval_required ? "call-method" : "invoke-method", do_dump(o.functor_expr)]
  o.arguments.collect {|a| result << do_dump(a) }
  result << do_dump(o.lambda) if o.lambda
  result
end

#dump_CallNamedFunctionExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Produces (invoke name args…) when not required to produce an rvalue, and (call name args … ) otherwise.



331
332
333
334
335
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 331

def dump_CallNamedFunctionExpression o
  result = [o.rval_required ? "call" : "invoke", do_dump(o.functor_expr)]
  o.arguments.collect {|a| result << do_dump(a) }
  result
end

#dump_CapabilityMapping(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



265
266
267
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 265

def dump_CapabilityMapping o
  [o.kind, do_dump(o.component), o.capability, do_dump(o.mappings)]
end

#dump_CaseExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



350
351
352
353
354
355
356
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 350

def dump_CaseExpression o
  result = ["case", do_dump(o.test), :indent]
  o.options.each do |s|
    result << :break << do_dump(s)
  end
  result << :dedent
end

#dump_CaseOption(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



358
359
360
361
362
363
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 358

def dump_CaseOption o
  result = ["when"]
  result << o.values.collect {|x| do_dump(x) }
  result << ["then", do_dump(o.then_expr) ]
  result
end

#dump_CollectExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



56
57
58
59
60
61
62
63
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 56

def dump_CollectExpression o
  result = ["collect", do_dump(o.type_expr), :indent, :break, do_dump(o.query), :indent]
  o.operations do |ao|
    result << :break << do_dump(ao)
  end
  result += [:dedent, :dedent ]
  result
end

#dump_ComparisonExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



92
93
94
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 92

def dump_ComparisonExpression o
  [o.operator.to_s, do_dump(o.left_expr), do_dump(o.right_expr)]
end

#dump_ConcatenatedString(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Interpolated strings are shown as (cat seg0 seg1 … segN)



205
206
207
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 205

def dump_ConcatenatedString o
  ["cat"] + o.segments.collect {|x| do_dump(x)}
end

#dump_EppExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



65
66
67
68
69
70
71
72
73
74
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 65

def dump_EppExpression o
  result = ["epp"]
#    result << ["parameters"] + o.parameters.collect {|p| do_dump(p) } if o.parameters.size() > 0
  if o.body
    result << do_dump(o.body)
  else
    result << []
  end
  result
end

#dump_ExportedQuery(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



76
77
78
79
80
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 76

def dump_ExportedQuery o
  result = ["<<| |>>"]
  result += dump_QueryExpression(o) unless is_nop?(o.expr)
  result
end

#dump_Factory(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



31
32
33
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 31

def dump_Factory o
  do_dump(o.current)
end

#dump_HeredocExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



209
210
211
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 209

def dump_HeredocExpression(o)
  result = ["@(#{o.syntax})", :indent, :break, do_dump(o.text_expr), :dedent, :break]
end

#dump_HostClassDefinition(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



213
214
215
216
217
218
219
220
221
222
223
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 213

def dump_HostClassDefinition o
  result = ["class", o.name]
  result << ["inherits", o.parent_class] if o.parent_class
  result << ["parameters"] + o.parameters.collect {|p| do_dump(p) } if o.parameters.size() > 0
  if o.body
    result << do_dump(o.body)
  else
    result << []
  end
  result
end

#dump_IfExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



308
309
310
311
312
313
314
315
316
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 308

def dump_IfExpression o
  result = ["if", do_dump(o.test), :indent, :break,
    ["then", :indent, do_dump(o.then_expr), :dedent]]
  result +=
  [:break,
    ["else", :indent, do_dump(o.else_expr), :dedent],
    :dedent] unless is_nop? o.else_expr
  result
end

#dump_InExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



104
105
106
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 104

def dump_InExpression o
  ["in", do_dump(o.left_expr), do_dump(o.right_expr)]
end

#dump_KeyedEntry(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



129
130
131
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 129

def dump_KeyedEntry o
  [do_dump(o.key), do_dump(o.value)]
end

#dump_LambdaExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



141
142
143
144
145
146
147
148
149
150
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 141

def dump_LambdaExpression o
  result = ["lambda"]
  result << ["parameters"] + o.parameters.collect {|p| do_dump(p) } if o.parameters.size() > 0
  if o.body
    result << do_dump(o.body)
  else
    result << []
  end
  result
end

#dump_LiteralDefault(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



152
153
154
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 152

def dump_LiteralDefault o
  ":default"
end

#dump_LiteralFloat(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



10
11
12
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 10

def dump_LiteralFloat o
  o.value.to_s
end

#dump_LiteralHash(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



125
126
127
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 125

def dump_LiteralHash o
  ["{}"] + o.entries.collect {|x| do_dump(x)}
end

#dump_LiteralInteger(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 14

def dump_LiteralInteger o
  case o.radix
  when 10
    o.value.to_s
  when 8
    "0%o" % o.value
  when 16
    "0x%X" % o.value
  else
    "bad radix:" + o.value.to_s
  end
end

#dump_LiteralList(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



121
122
123
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 121

def dump_LiteralList o
  ["[]"] + o.values.collect {|x| do_dump(x)}
end

#dump_LiteralRegularExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



160
161
162
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 160

def dump_LiteralRegularExpression o
  "/#{o.value.source}/"
end

#dump_LiteralString(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



137
138
139
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 137

def dump_LiteralString o
  "'#{o.value}'"
end

#dump_LiteralUndef(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



156
157
158
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 156

def dump_LiteralUndef o
  ":undef"
end

#dump_LiteralValue(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



27
28
29
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 27

def dump_LiteralValue o
  o.value.to_s
end

#dump_MatchesExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



52
53
54
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 52

def dump_MatchesExpression o
  [o.operator.to_s, do_dump(o.left_expr), do_dump(o.right_expr)]
end

#dump_MatchExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



133
134
135
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 133

def dump_MatchExpression o
  [o.operator.to_s, do_dump(o.left_expr), do_dump(o.right_expr)]
end

#dump_NamedAccessExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



168
169
170
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 168

def dump_NamedAccessExpression o
  [".", do_dump(o.left_expr), do_dump(o.right_expr)]
end

#dump_NamedDefinition(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



247
248
249
250
251
252
253
254
255
256
257
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 247

def dump_NamedDefinition o
  # the nil must be replaced with a string
  result = [nil, o.name]
  result << ["parameters"] + o.parameters.collect {|p| do_dump(p) } if o.parameters.size() > 0
  if o.body
    result << do_dump(o.body)
  else
    result << []
  end
  result
end

#dump_NilClass(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



172
173
174
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 172

def dump_NilClass o
  "()"
end

#dump_NodeDefinition(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



225
226
227
228
229
230
231
232
233
234
235
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 225

def dump_NodeDefinition o
  result = ["node"]
  result << ["matches"] + o.host_matches.collect {|m| do_dump(m) }
  result << ["parent", do_dump(o.parent)] if o.parent
  if o.body
    result << do_dump(o.body)
  else
    result << []
  end
  result
end

#dump_Nop(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



164
165
166
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 164

def dump_Nop o
  ":nop"
end

#dump_NotExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



176
177
178
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 176

def dump_NotExpression o
  ['!', dump(o.expr)]
end

#dump_Object(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



426
427
428
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 426

def dump_Object o
  [o.class.to_s, o.to_s]
end

#dump_OrExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



100
101
102
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 100

def dump_OrExpression o
  ["||", do_dump(o.left_expr), do_dump(o.right_expr)]
end

#dump_Parameter(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Produces parameters as name, or (= name value)



284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 284

def dump_Parameter o
  name_prefix = o.captures_rest ? '*' : ''
  name_part = "#{name_prefix}#{o.name}"
  if o.value && o.type_expr
    ["=t", do_dump(o.type_expr), name_part, do_dump(o.value)]
  elsif o.value
    ["=", name_part, do_dump(o.value)]
  elsif o.type_expr
    ["t", do_dump(o.type_expr), name_part]
  else
    name_part
  end
end

#dump_ParenthesizedExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



298
299
300
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 298

def dump_ParenthesizedExpression o
  do_dump(o.expr)
end

#dump_Program(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Hides that Program exists in the output (only its body is shown), the definitions are just references to contained classes, resource types, and nodes



304
305
306
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 304

def dump_Program(o)
  dump(o.body)
end

#dump_QueryExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



88
89
90
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 88

def dump_QueryExpression o
  [do_dump(o.expr)]
end

#dump_RelationshipExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



365
366
367
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 365

def dump_RelationshipExpression o
  [o.operator.to_s, do_dump(o.left_expr), do_dump(o.right_expr)]
end

#dump_RenderExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



373
374
375
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 373

def dump_RenderExpression o
  ["render", do_dump(o.expr)]
end

#dump_RenderStringExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



369
370
371
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 369

def dump_RenderStringExpression o
  ["render-s", " '#{o.value}'"]
end

#dump_ReservedWord(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



279
280
281
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 279

def dump_ReservedWord o
  [ 'reserved', o.word ]
end

#dump_ResourceBody(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



377
378
379
380
381
382
383
384
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 377

def dump_ResourceBody o
  result = [do_dump(o.title), :indent]
  o.operations.each do |p|
    result << :break << do_dump(p)
  end
  result << :dedent
  result
end

#dump_ResourceDefaultsExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



386
387
388
389
390
391
392
393
394
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 386

def dump_ResourceDefaultsExpression o
  form = o.form == :regular ? '' : o.form.to_s + "-"
  result = [form+"resource-defaults", do_dump(o.type_ref), :indent]
  o.operations.each do |p|
    result << :break << do_dump(p)
  end
  result << :dedent
  result
end

#dump_ResourceExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



396
397
398
399
400
401
402
403
404
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 396

def dump_ResourceExpression o
  form = o.form == :regular ? '' : o.form.to_s + "-"
  result = [form+"resource", do_dump(o.type_name), :indent]
  o.bodies.each do |b|
    result << :break << do_dump(b)
  end
  result << :dedent
  result
end

#dump_ResourceOverrideExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



269
270
271
272
273
274
275
276
277
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 269

def dump_ResourceOverrideExpression o
  form = o.form == :regular ? '' : o.form.to_s + "-"
  result = [form+"override", do_dump(o.resources), :indent]
  o.operations.each do |p|
    result << :break << do_dump(p)
  end
  result << :dedent
  result
end

#dump_ResourceTypeDefinition(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



259
260
261
262
263
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 259

def dump_ResourceTypeDefinition o
  result = dump_NamedDefinition(o)
  result[0] = 'define'
  result
end

#dump_SelectorEntry(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



410
411
412
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 410

def dump_SelectorEntry o
  [do_dump(o.matching_expr), "=>", do_dump(o.value_expr)]
end

#dump_SelectorExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



406
407
408
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 406

def dump_SelectorExpression o
  ["?", do_dump(o.left_expr)] + o.selectors.collect {|x| do_dump(x) }
end

#dump_SiteDefinition(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



237
238
239
240
241
242
243
244
245
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 237

def dump_SiteDefinition o
  result = ["site"]
  if o.body
    result << do_dump(o.body)
  else
    result << []
  end
  result
end

#dump_SubLocatedExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



414
415
416
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 414

def dump_SubLocatedExpression o
  ["sublocated", do_dump(o.expr)]
end

#dump_TextExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Interpolation (to string) shown as (str expr)



185
186
187
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 185

def dump_TextExpression o
  ["str", do_dump(o.expr)]
end

#dump_TypeAlias(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



418
419
420
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 418

def dump_TypeAlias(o)
  ['type-alias', o.name, do_dump(o.type_expr)]
end

#dump_TypeDefinition(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



422
423
424
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 422

def dump_TypeDefinition(o)
  ['type-definition', o.name, o.parent, do_dump(o.body)]
end

#dump_UnaryMinusExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



189
190
191
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 189

def dump_UnaryMinusExpression o
  ['-', do_dump(o.expr)]
end

#dump_UnfoldExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



193
194
195
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 193

def dump_UnfoldExpression o
  ['unfold', do_dump(o.expr)]
end

#dump_UnlessExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



318
319
320
321
322
323
324
325
326
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 318

def dump_UnlessExpression o
  result = ["unless", do_dump(o.test), :indent, :break,
    ["then", :indent, do_dump(o.then_expr), :dedent]]
  result +=
  [:break,
    ["else", :indent, do_dump(o.else_expr), :dedent],
    :dedent] unless is_nop? o.else_expr
  result
end

#dump_VariableExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



180
181
182
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 180

def dump_VariableExpression o
  "$#{dump(o.expr)}"
end

#dump_VirtualQuery(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



82
83
84
85
86
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 82

def dump_VirtualQuery o
  result = ["<| |>"]
  result += dump_QueryExpression(o) unless is_nop?(o.expr)
  result
end

#is_nop?(o) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


430
431
432
# File 'lib/puppet/pops/model/model_tree_dumper.rb', line 430

def is_nop? o
  o.nil? || o.is_a?(Puppet::Pops::Model::Nop)
end