puppet 4.10.12 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

Files changed (1112) hide show
  1. data/CONTRIBUTING.md +32 -15
  2. data/Gemfile +31 -14
  3. data/MAINTAINERS +0 -5
  4. data/README.md +11 -11
  5. data/Rakefile +2 -1
  6. data/conf/auth.conf +21 -0
  7. data/conf/fileserver.conf +7 -12
  8. data/conf/hiera.yaml +11 -0
  9. data/ext/debian/puppet-common.install +0 -1
  10. data/ext/debian/puppet-common.manpages +0 -2
  11. data/ext/hiera/hiera.yaml +15 -0
  12. data/ext/logcheck/puppet +1 -1
  13. data/ext/project_data.yaml +4 -9
  14. data/ext/puppet-test +0 -24
  15. data/ext/rack/config.ru +2 -2
  16. data/ext/redhat/puppet.spec.erb +0 -3
  17. data/ext/windows/service/daemon.rb +8 -14
  18. data/install.rb +1 -1
  19. data/lib/hiera/puppet_function.rb +1 -1
  20. data/lib/puppet.rb +7 -5
  21. data/lib/puppet/agent.rb +29 -38
  22. data/lib/puppet/agent/disabler.rb +3 -3
  23. data/lib/puppet/agent/locker.rb +3 -3
  24. data/lib/puppet/application.rb +12 -29
  25. data/lib/puppet/application/agent.rb +20 -18
  26. data/lib/puppet/application/apply.rb +22 -18
  27. data/lib/puppet/application/cert.rb +2 -7
  28. data/lib/puppet/application/config.rb +0 -1
  29. data/lib/puppet/application/describe.rb +1 -1
  30. data/lib/puppet/application/device.rb +94 -76
  31. data/lib/puppet/application/doc.rb +6 -6
  32. data/lib/puppet/application/face_base.rb +8 -13
  33. data/lib/puppet/application/filebucket.rb +12 -29
  34. data/lib/puppet/application/help.rb +0 -1
  35. data/lib/puppet/application/lookup.rb +106 -101
  36. data/lib/puppet/application/master.rb +14 -22
  37. data/lib/puppet/application/resource.rb +13 -10
  38. data/lib/puppet/application_support.rb +1 -6
  39. data/lib/puppet/configurer.rb +33 -45
  40. data/lib/puppet/configurer/downloader.rb +2 -2
  41. data/lib/puppet/configurer/fact_handler.rb +13 -4
  42. data/lib/puppet/context.rb +5 -5
  43. data/lib/puppet/context/trusted_information.rb +1 -1
  44. data/lib/puppet/defaults.rb +18 -131
  45. data/lib/puppet/environments.rb +1 -1
  46. data/lib/puppet/error.rb +1 -1
  47. data/lib/puppet/external/nagios/grammar.ry +1 -1
  48. data/lib/puppet/external/nagios/parser.rb +1 -1
  49. data/lib/puppet/external/pson/common.rb +4 -0
  50. data/lib/puppet/face/ca.rb +49 -42
  51. data/lib/puppet/face/catalog.rb +1 -1
  52. data/lib/puppet/face/catalog/select.rb +4 -4
  53. data/lib/puppet/face/certificate.rb +20 -20
  54. data/lib/puppet/face/config.rb +9 -22
  55. data/lib/puppet/face/epp.rb +59 -61
  56. data/lib/puppet/face/facts.rb +4 -4
  57. data/lib/puppet/face/generate.rb +8 -8
  58. data/lib/puppet/face/help.rb +7 -7
  59. data/lib/puppet/face/key.rb +2 -2
  60. data/lib/puppet/face/man.rb +5 -5
  61. data/lib/puppet/face/module.rb +2 -2
  62. data/lib/puppet/face/module/build.rb +7 -7
  63. data/lib/puppet/face/module/changes.rb +6 -6
  64. data/lib/puppet/face/module/generate.rb +24 -24
  65. data/lib/puppet/face/module/install.rb +13 -9
  66. data/lib/puppet/face/module/list.rb +16 -12
  67. data/lib/puppet/face/module/search.rb +4 -4
  68. data/lib/puppet/face/module/uninstall.rb +13 -10
  69. data/lib/puppet/face/module/upgrade.rb +11 -7
  70. data/lib/puppet/face/node.rb +5 -5
  71. data/lib/puppet/face/node/clean.rb +8 -8
  72. data/lib/puppet/face/parser.rb +16 -16
  73. data/lib/puppet/face/plugin.rb +6 -6
  74. data/lib/puppet/face/report.rb +9 -9
  75. data/lib/puppet/face/resource.rb +12 -12
  76. data/lib/puppet/face/status.rb +4 -4
  77. data/lib/puppet/feature/base.rb +3 -2
  78. data/lib/puppet/feature/eventlog.rb +1 -1
  79. data/lib/puppet/file_bucket/dipper.rb +9 -9
  80. data/lib/puppet/file_bucket/file.rb +4 -17
  81. data/lib/puppet/file_serving/base.rb +3 -3
  82. data/lib/puppet/file_serving/configuration.rb +3 -3
  83. data/lib/puppet/file_serving/configuration/parser.rb +12 -12
  84. data/lib/puppet/file_serving/content.rb +1 -1
  85. data/lib/puppet/file_serving/fileset.rb +7 -5
  86. data/lib/puppet/file_serving/http_metadata.rb +1 -1
  87. data/lib/puppet/file_serving/metadata.rb +7 -7
  88. data/lib/puppet/file_serving/mount.rb +1 -1
  89. data/lib/puppet/file_serving/mount/file.rb +6 -6
  90. data/lib/puppet/file_serving/mount/modules.rb +1 -1
  91. data/lib/puppet/file_serving/terminus_selector.rb +1 -1
  92. data/lib/puppet/file_system/file_impl.rb +2 -2
  93. data/lib/puppet/file_system/memory_impl.rb +1 -1
  94. data/lib/puppet/file_system/path_pattern.rb +6 -6
  95. data/lib/puppet/file_system/uniquefile.rb +2 -2
  96. data/lib/puppet/file_system/windows.rb +3 -3
  97. data/lib/puppet/forge.rb +8 -14
  98. data/lib/puppet/forge/errors.rb +12 -12
  99. data/lib/puppet/forge/repository.rb +1 -1
  100. data/lib/puppet/functions.rb +17 -45
  101. data/lib/puppet/functions/annotate.rb +108 -0
  102. data/lib/puppet/functions/binary_file.rb +1 -1
  103. data/lib/puppet/functions/call.rb +42 -0
  104. data/lib/puppet/functions/defined.rb +4 -4
  105. data/lib/puppet/functions/dig.rb +1 -1
  106. data/lib/puppet/functions/each.rb +4 -10
  107. data/lib/puppet/functions/epp.rb +0 -3
  108. data/lib/puppet/functions/hiera_include.rb +1 -1
  109. data/lib/puppet/functions/hocon_data.rb +2 -2
  110. data/lib/puppet/functions/json_data.rb +1 -1
  111. data/lib/puppet/functions/lookup.rb +2 -2
  112. data/lib/puppet/functions/map.rb +3 -13
  113. data/lib/puppet/functions/match.rb +2 -2
  114. data/lib/puppet/functions/reduce.rb +0 -31
  115. data/lib/puppet/functions/require.rb +1 -1
  116. data/lib/puppet/functions/slice.rb +3 -3
  117. data/lib/puppet/functions/strftime.rb +10 -2
  118. data/lib/puppet/functions/unique.rb +132 -0
  119. data/lib/puppet/generate/models/type/property.rb +1 -1
  120. data/lib/puppet/generate/type.rb +12 -12
  121. data/lib/puppet/graph/relationship_graph.rb +4 -7
  122. data/lib/puppet/graph/simple_graph.rb +45 -66
  123. data/lib/puppet/indirector.rb +2 -2
  124. data/lib/puppet/indirector/catalog/compiler.rb +58 -44
  125. data/lib/puppet/indirector/catalog/json.rb +18 -0
  126. data/lib/puppet/indirector/certificate/disabled_ca.rb +1 -1
  127. data/lib/puppet/indirector/certificate_request/ca.rb +3 -3
  128. data/lib/puppet/indirector/certificate_request/disabled_ca.rb +1 -1
  129. data/lib/puppet/indirector/certificate_revocation_list/disabled_ca.rb +1 -1
  130. data/lib/puppet/indirector/certificate_status/file.rb +6 -6
  131. data/lib/puppet/indirector/exec.rb +2 -2
  132. data/lib/puppet/indirector/face.rb +18 -18
  133. data/lib/puppet/indirector/file_bucket_file/file.rb +10 -9
  134. data/lib/puppet/indirector/file_metadata/http.rb +1 -1
  135. data/lib/puppet/indirector/file_server.rb +10 -2
  136. data/lib/puppet/indirector/hiera.rb +5 -3
  137. data/lib/puppet/indirector/indirection.rb +16 -18
  138. data/lib/puppet/indirector/json.rb +11 -12
  139. data/lib/puppet/indirector/key/disabled_ca.rb +1 -1
  140. data/lib/puppet/indirector/key/file.rb +2 -2
  141. data/lib/puppet/indirector/ldap.rb +6 -5
  142. data/lib/puppet/indirector/memory.rb +1 -1
  143. data/lib/puppet/indirector/msgpack.rb +8 -7
  144. data/lib/puppet/indirector/node/exec.rb +8 -6
  145. data/lib/puppet/indirector/node/ldap.rb +9 -7
  146. data/lib/puppet/indirector/node/plain.rb +2 -1
  147. data/lib/puppet/indirector/node/write_only_yaml.rb +6 -1
  148. data/lib/puppet/indirector/node/yaml.rb +0 -9
  149. data/lib/puppet/indirector/report/processor.rb +2 -2
  150. data/lib/puppet/indirector/report/rest.rb +13 -0
  151. data/lib/puppet/indirector/request.rb +11 -23
  152. data/lib/puppet/indirector/resource/ral.rb +1 -1
  153. data/lib/puppet/indirector/resource/validator.rb +1 -1
  154. data/lib/puppet/indirector/rest.rb +28 -10
  155. data/lib/puppet/indirector/ssl_file.rb +9 -9
  156. data/lib/puppet/indirector/terminus.rb +3 -3
  157. data/lib/puppet/indirector/yaml.rb +5 -5
  158. data/lib/puppet/info_service/class_information_service.rb +4 -5
  159. data/lib/puppet/interface.rb +2 -7
  160. data/lib/puppet/interface/face_collection.rb +6 -1
  161. data/lib/puppet/module.rb +10 -35
  162. data/lib/puppet/module_tool.rb +7 -3
  163. data/lib/puppet/module_tool/applications/application.rb +8 -9
  164. data/lib/puppet/module_tool/applications/builder.rb +5 -6
  165. data/lib/puppet/module_tool/applications/checksummer.rb +2 -2
  166. data/lib/puppet/module_tool/applications/installer.rb +11 -10
  167. data/lib/puppet/module_tool/applications/searcher.rb +1 -1
  168. data/lib/puppet/module_tool/applications/uninstaller.rb +2 -1
  169. data/lib/puppet/module_tool/applications/unpacker.rb +3 -3
  170. data/lib/puppet/module_tool/applications/upgrader.rb +10 -9
  171. data/lib/puppet/module_tool/contents_description.rb +1 -1
  172. data/lib/puppet/module_tool/dependency.rb +0 -1
  173. data/lib/puppet/module_tool/errors/installer.rb +22 -22
  174. data/lib/puppet/module_tool/errors/shared.rb +44 -42
  175. data/lib/puppet/module_tool/errors/uninstaller.rb +13 -9
  176. data/lib/puppet/module_tool/errors/upgrader.rb +11 -11
  177. data/lib/puppet/module_tool/install_directory.rb +1 -1
  178. data/lib/puppet/module_tool/installed_modules.rb +3 -3
  179. data/lib/puppet/module_tool/local_tarball.rb +4 -4
  180. data/lib/puppet/module_tool/metadata.rb +16 -13
  181. data/lib/puppet/module_tool/shared_behaviors.rb +6 -6
  182. data/lib/puppet/module_tool/skeleton/templates/generator/Gemfile +1 -1
  183. data/lib/puppet/module_tool/skeleton/templates/generator/README.md.erb +10 -4
  184. data/lib/puppet/module_tool/skeleton/templates/generator/Rakefile +2 -2
  185. data/lib/puppet/module_tool/tar.rb +2 -1
  186. data/lib/puppet/module_tool/tar/mini.rb +4 -57
  187. data/lib/puppet/network/auth_config_parser.rb +12 -11
  188. data/lib/puppet/network/authconfig.rb +2 -2
  189. data/lib/puppet/network/authstore.rb +2 -2
  190. data/lib/puppet/network/format.rb +7 -7
  191. data/lib/puppet/network/format_handler.rb +12 -9
  192. data/lib/puppet/network/format_support.rb +11 -5
  193. data/lib/puppet/network/formats.rb +38 -27
  194. data/lib/puppet/network/http/api/indirected_routes.rb +72 -33
  195. data/lib/puppet/network/http/api/master/v3/environment.rb +33 -14
  196. data/lib/puppet/network/http/compression.rb +10 -7
  197. data/lib/puppet/network/http/connection.rb +19 -23
  198. data/lib/puppet/network/http/error.rb +14 -10
  199. data/lib/puppet/network/http/factory.rb +0 -12
  200. data/lib/puppet/network/http/handler.rb +8 -4
  201. data/lib/puppet/network/http/issues.rb +1 -0
  202. data/lib/puppet/network/http/pool.rb +1 -1
  203. data/lib/puppet/network/http/rack.rb +2 -2
  204. data/lib/puppet/network/http/rack/rest.rb +1 -1
  205. data/lib/puppet/network/http/request.rb +34 -20
  206. data/lib/puppet/network/http/response.rb +13 -1
  207. data/lib/puppet/network/http/webrick.rb +8 -6
  208. data/lib/puppet/network/http/webrick/rest.rb +2 -2
  209. data/lib/puppet/network/rights.rb +6 -6
  210. data/lib/puppet/network/server.rb +2 -2
  211. data/lib/puppet/node.rb +25 -23
  212. data/lib/puppet/node/environment.rb +21 -4
  213. data/lib/puppet/node/facts.rb +0 -14
  214. data/lib/puppet/parameter.rb +3 -28
  215. data/lib/puppet/parameter/package_options.rb +1 -1
  216. data/lib/puppet/parameter/path.rb +3 -3
  217. data/lib/puppet/parameter/value_collection.rb +4 -4
  218. data/lib/puppet/parser/ast/leaf.rb +1 -1
  219. data/lib/puppet/parser/ast/node.rb +1 -1
  220. data/lib/puppet/parser/ast/pops_bridge.rb +3 -3
  221. data/lib/puppet/parser/ast/resource.rb +1 -1
  222. data/lib/puppet/parser/ast/resource_instance.rb +1 -1
  223. data/lib/puppet/parser/ast/resourceparam.rb +1 -1
  224. data/lib/puppet/parser/compiler.rb +44 -117
  225. data/lib/puppet/parser/compiler/catalog_validator/env_relationship_validator.rb +2 -2
  226. data/lib/puppet/parser/compiler/catalog_validator/relationship_validator.rb +6 -9
  227. data/lib/puppet/parser/compiler/catalog_validator/site_validator.rb +1 -1
  228. data/lib/puppet/parser/e4_parser_adapter.rb +1 -2
  229. data/lib/puppet/parser/environment_compiler.rb +13 -15
  230. data/lib/puppet/parser/functions.rb +6 -6
  231. data/lib/puppet/parser/functions/assert_type.rb +1 -1
  232. data/lib/puppet/parser/functions/binary_file.rb +1 -1
  233. data/lib/puppet/parser/functions/break.rb +1 -1
  234. data/lib/puppet/parser/functions/contain.rb +1 -1
  235. data/lib/puppet/parser/functions/create_resources.rb +3 -3
  236. data/lib/puppet/parser/functions/defined.rb +1 -1
  237. data/lib/puppet/parser/functions/dig.rb +1 -1
  238. data/lib/puppet/parser/functions/each.rb +1 -1
  239. data/lib/puppet/parser/functions/epp.rb +1 -4
  240. data/lib/puppet/parser/functions/file.rb +1 -1
  241. data/lib/puppet/parser/functions/filter.rb +1 -1
  242. data/lib/puppet/parser/functions/find_file.rb +1 -1
  243. data/lib/puppet/parser/functions/generate.rb +5 -4
  244. data/lib/puppet/parser/functions/hiera_include.rb +1 -1
  245. data/lib/puppet/parser/functions/include.rb +2 -1
  246. data/lib/puppet/parser/functions/inline_epp.rb +1 -1
  247. data/lib/puppet/parser/functions/inline_template.rb +1 -1
  248. data/lib/puppet/parser/functions/lest.rb +1 -1
  249. data/lib/puppet/parser/functions/map.rb +1 -1
  250. data/lib/puppet/parser/functions/match.rb +1 -1
  251. data/lib/puppet/parser/functions/new.rb +45 -30
  252. data/lib/puppet/parser/functions/next.rb +1 -1
  253. data/lib/puppet/parser/functions/reduce.rb +1 -1
  254. data/lib/puppet/parser/functions/require.rb +1 -1
  255. data/lib/puppet/parser/functions/return.rb +2 -23
  256. data/lib/puppet/parser/functions/reverse_each.rb +1 -1
  257. data/lib/puppet/parser/functions/slice.rb +1 -1
  258. data/lib/puppet/parser/functions/sprintf.rb +3 -17
  259. data/lib/puppet/parser/functions/step.rb +1 -1
  260. data/lib/puppet/parser/functions/strftime.rb +1 -1
  261. data/lib/puppet/parser/functions/then.rb +1 -1
  262. data/lib/puppet/parser/functions/type.rb +1 -1
  263. data/lib/puppet/parser/functions/with.rb +1 -1
  264. data/lib/puppet/parser/parser_factory.rb +0 -30
  265. data/lib/puppet/parser/relationship.rb +49 -20
  266. data/lib/puppet/parser/resource.rb +31 -30
  267. data/lib/puppet/parser/resource/param.rb +0 -3
  268. data/lib/puppet/parser/scope.rb +122 -168
  269. data/lib/puppet/parser/templatewrapper.rb +2 -2
  270. data/lib/puppet/parser/type_loader.rb +1 -1
  271. data/lib/puppet/plugins/configuration.rb +15 -67
  272. data/lib/puppet/plugins/syntax_checkers.rb +6 -11
  273. data/lib/puppet/pops.rb +7 -37
  274. data/lib/puppet/pops/adaptable.rb +8 -3
  275. data/lib/puppet/pops/adapters.rb +23 -83
  276. data/lib/puppet/pops/evaluator/access_operator.rb +10 -39
  277. data/lib/puppet/pops/evaluator/collector_transformer.rb +7 -12
  278. data/lib/puppet/pops/evaluator/collectors/exported_collector.rb +1 -1
  279. data/lib/puppet/pops/evaluator/compare_operator.rb +7 -7
  280. data/lib/puppet/pops/evaluator/epp_evaluator.rb +1 -1
  281. data/lib/puppet/pops/evaluator/evaluator_impl.rb +46 -38
  282. data/lib/puppet/pops/evaluator/external_syntax_support.rb +2 -9
  283. data/lib/puppet/pops/evaluator/json_strict_literal_evaluator.rb +0 -2
  284. data/lib/puppet/pops/evaluator/puppet_proc.rb +1 -1
  285. data/lib/puppet/pops/evaluator/relationship_operator.rb +26 -9
  286. data/lib/puppet/pops/evaluator/runtime3_converter.rb +17 -1
  287. data/lib/puppet/pops/evaluator/runtime3_support.rb +13 -30
  288. data/lib/puppet/pops/functions/dispatch.rb +1 -6
  289. data/lib/puppet/pops/issues.rb +182 -162
  290. data/lib/puppet/pops/loader/base_loader.rb +2 -2
  291. data/lib/puppet/pops/loader/gem_support.rb +2 -2
  292. data/lib/puppet/pops/loader/module_loaders.rb +59 -8
  293. data/lib/puppet/pops/loader/predefined_loader.rb +1 -6
  294. data/lib/puppet/pops/loader/puppet_function_instantiator.rb +8 -8
  295. data/lib/puppet/pops/loader/puppet_resource_type_impl_instantiator.rb +9 -10
  296. data/lib/puppet/pops/loader/ruby_function_instantiator.rb +3 -3
  297. data/lib/puppet/pops/loader/static_loader.rb +33 -64
  298. data/lib/puppet/pops/loader/type_definition_instantiator.rb +7 -7
  299. data/lib/puppet/pops/loader/typed_name.rb +5 -0
  300. data/lib/puppet/pops/loaders.rb +15 -5
  301. data/lib/puppet/pops/lookup.rb +4 -2
  302. data/lib/puppet/pops/lookup/context.rb +1 -1
  303. data/lib/puppet/pops/lookup/data_provider.rb +3 -18
  304. data/lib/puppet/pops/lookup/global_data_provider.rb +1 -1
  305. data/lib/puppet/pops/lookup/hiera_config.rb +12 -35
  306. data/lib/puppet/pops/lookup/interpolation.rb +1 -0
  307. data/lib/puppet/pops/lookup/invocation.rb +1 -1
  308. data/lib/puppet/pops/lookup/lookup_adapter.rb +20 -64
  309. data/lib/puppet/pops/lookup/lookup_key.rb +1 -1
  310. data/lib/puppet/pops/lookup/module_data_provider.rb +1 -1
  311. data/lib/puppet/pops/lookup/sub_lookup.rb +2 -1
  312. data/lib/puppet/pops/merge_strategy.rb +1 -1
  313. data/lib/puppet/pops/model/ast.pp +692 -0
  314. data/lib/puppet/pops/model/ast.rb +4833 -0
  315. data/lib/puppet/pops/model/ast_transformer.rb +9 -10
  316. data/lib/puppet/pops/model/factory.rb +454 -527
  317. data/lib/puppet/pops/model/model_label_provider.rb +3 -2
  318. data/lib/puppet/pops/model/model_tree_dumper.rb +9 -8
  319. data/lib/puppet/pops/parser/egrammar.ra +66 -60
  320. data/lib/puppet/pops/parser/eparser.rb +1483 -1578
  321. data/lib/puppet/pops/parser/evaluating_parser.rb +5 -5
  322. data/lib/puppet/pops/parser/heredoc_support.rb +1 -1
  323. data/lib/puppet/pops/parser/interpolation_support.rb +4 -4
  324. data/lib/puppet/pops/parser/lexer2.rb +7 -33
  325. data/lib/puppet/pops/parser/locator.rb +39 -16
  326. data/lib/puppet/pops/parser/parser_support.rb +25 -29
  327. data/lib/puppet/pops/patterns.rb +1 -2
  328. data/lib/puppet/pops/pcore.rb +26 -19
  329. data/lib/puppet/pops/resource/param.rb +1 -1
  330. data/lib/puppet/pops/resource/resource_type_impl.rb +2 -2
  331. data/lib/puppet/pops/serialization.rb +25 -1
  332. data/lib/puppet/pops/serialization/abstract_writer.rb +9 -1
  333. data/lib/puppet/pops/serialization/deserializer.rb +1 -1
  334. data/lib/puppet/pops/serialization/from_data_converter.rb +181 -0
  335. data/lib/puppet/pops/serialization/json.rb +4 -4
  336. data/lib/puppet/pops/serialization/json_path.rb +126 -0
  337. data/lib/puppet/pops/serialization/object.rb +5 -5
  338. data/lib/puppet/pops/serialization/serializer.rb +23 -9
  339. data/lib/puppet/pops/serialization/to_data_converter.rb +292 -0
  340. data/lib/puppet/pops/time/timespan.rb +11 -11
  341. data/lib/puppet/pops/time/timestamp.rb +8 -8
  342. data/lib/puppet/pops/types/annotatable.rb +7 -7
  343. data/lib/puppet/pops/types/annotation.rb +71 -0
  344. data/lib/puppet/pops/types/class_loader.rb +4 -6
  345. data/lib/puppet/pops/types/enumeration.rb +2 -2
  346. data/lib/puppet/pops/types/iterable.rb +2 -4
  347. data/lib/puppet/pops/types/p_binary_type.rb +7 -1
  348. data/lib/puppet/pops/types/p_meta_type.rb +16 -12
  349. data/lib/puppet/pops/types/p_object_type.rb +135 -96
  350. data/lib/puppet/pops/types/p_runtime_type.rb +1 -1
  351. data/lib/puppet/pops/types/p_sem_ver_range_type.rb +6 -2
  352. data/lib/puppet/pops/types/p_timespan_type.rb +55 -4
  353. data/lib/puppet/pops/types/p_type_set_type.rb +42 -34
  354. data/lib/puppet/pops/types/puppet_object.rb +13 -3
  355. data/lib/puppet/pops/types/ruby_generator.rb +291 -127
  356. data/lib/puppet/pops/types/ruby_method.rb +31 -0
  357. data/lib/puppet/pops/types/string_converter.rb +107 -30
  358. data/lib/puppet/pops/types/type_calculator.rb +56 -94
  359. data/lib/puppet/pops/types/type_factory.rb +34 -6
  360. data/lib/puppet/pops/types/type_formatter.rb +64 -16
  361. data/lib/puppet/pops/types/type_mismatch_describer.rb +13 -22
  362. data/lib/puppet/pops/types/type_parser.rb +28 -13
  363. data/lib/puppet/pops/types/type_set_reference.rb +6 -6
  364. data/lib/puppet/pops/types/types.rb +169 -245
  365. data/lib/puppet/pops/utils.rb +0 -24
  366. data/lib/puppet/pops/validation.rb +3 -9
  367. data/lib/puppet/pops/validation/checker4_0.rb +86 -76
  368. data/lib/puppet/pops/validation/validator_factory_4_0.rb +0 -1
  369. data/lib/puppet/pops/visitor.rb +21 -0
  370. data/lib/puppet/property.rb +17 -14
  371. data/lib/puppet/property/ensure.rb +3 -3
  372. data/lib/puppet/property/list.rb +1 -10
  373. data/lib/puppet/provider.rb +2 -0
  374. data/lib/puppet/provider/aixobject.rb +7 -7
  375. data/lib/puppet/provider/augeas/augeas.rb +37 -37
  376. data/lib/puppet/provider/command.rb +1 -1
  377. data/lib/puppet/provider/cron/crontab.rb +2 -2
  378. data/lib/puppet/provider/exec.rb +4 -4
  379. data/lib/puppet/provider/exec/posix.rb +4 -4
  380. data/lib/puppet/provider/exec/windows.rb +3 -3
  381. data/lib/puppet/provider/file/posix.rb +5 -5
  382. data/lib/puppet/provider/file/windows.rb +4 -4
  383. data/lib/puppet/provider/group/aix.rb +2 -2
  384. data/lib/puppet/provider/group/groupadd.rb +2 -2
  385. data/lib/puppet/provider/group/pw.rb +1 -1
  386. data/lib/puppet/provider/group/windows_adsi.rb +7 -4
  387. data/lib/puppet/provider/host/parsed.rb +1 -1
  388. data/lib/puppet/provider/macauthorization/macauthorization.rb +9 -9
  389. data/lib/puppet/provider/maillist/mailman.rb +2 -2
  390. data/lib/puppet/provider/mcx/mcxcontent.rb +3 -3
  391. data/lib/puppet/provider/mount.rb +2 -1
  392. data/lib/puppet/provider/mount/parsed.rb +10 -8
  393. data/lib/puppet/provider/naginator.rb +1 -1
  394. data/lib/puppet/provider/nameservice.rb +8 -10
  395. data/lib/puppet/provider/nameservice/directoryservice.rb +11 -11
  396. data/lib/puppet/provider/network_device.rb +2 -1
  397. data/lib/puppet/provider/package/aix.rb +6 -6
  398. data/lib/puppet/provider/package/appdmg.rb +2 -2
  399. data/lib/puppet/provider/package/apple.rb +1 -1
  400. data/lib/puppet/provider/package/apt.rb +4 -4
  401. data/lib/puppet/provider/package/aptitude.rb +1 -1
  402. data/lib/puppet/provider/package/aptrpm.rb +2 -2
  403. data/lib/puppet/provider/package/blastwave.rb +4 -4
  404. data/lib/puppet/provider/package/dnf.rb +1 -1
  405. data/lib/puppet/provider/package/dpkg.rb +3 -3
  406. data/lib/puppet/provider/package/fink.rb +3 -3
  407. data/lib/puppet/provider/package/freebsd.rb +1 -1
  408. data/lib/puppet/provider/package/gem.rb +6 -6
  409. data/lib/puppet/provider/package/hpux.rb +1 -1
  410. data/lib/puppet/provider/package/nim.rb +15 -12
  411. data/lib/puppet/provider/package/openbsd.rb +4 -4
  412. data/lib/puppet/provider/package/opkg.rb +1 -1
  413. data/lib/puppet/provider/package/pacman.rb +9 -9
  414. data/lib/puppet/provider/package/pkg.rb +9 -9
  415. data/lib/puppet/provider/package/pkgdmg.rb +4 -4
  416. data/lib/puppet/provider/package/pkgin.rb +3 -3
  417. data/lib/puppet/provider/package/pkgng.rb +1 -1
  418. data/lib/puppet/provider/package/pkgutil.rb +6 -6
  419. data/lib/puppet/provider/package/portage.rb +167 -59
  420. data/lib/puppet/provider/package/ports.rb +3 -3
  421. data/lib/puppet/provider/package/portupgrade.rb +4 -4
  422. data/lib/puppet/provider/package/rpm.rb +7 -4
  423. data/lib/puppet/provider/package/rug.rb +1 -1
  424. data/lib/puppet/provider/package/sun.rb +3 -2
  425. data/lib/puppet/provider/package/up2date.rb +1 -1
  426. data/lib/puppet/provider/package/urpmi.rb +1 -1
  427. data/lib/puppet/provider/package/windows.rb +4 -4
  428. data/lib/puppet/provider/package/windows/package.rb +3 -3
  429. data/lib/puppet/provider/package/yum.rb +5 -6
  430. data/lib/puppet/provider/package/zypper.rb +1 -1
  431. data/lib/puppet/provider/parsedfile.rb +1 -1
  432. data/lib/puppet/provider/service/base.rb +8 -21
  433. data/lib/puppet/provider/service/smf.rb +2 -2
  434. data/lib/puppet/provider/service/systemd.rb +1 -2
  435. data/lib/puppet/provider/service/upstart.rb +1 -3
  436. data/lib/puppet/provider/user/aix.rb +2 -2
  437. data/lib/puppet/provider/user/ldap.rb +1 -1
  438. data/lib/puppet/provider/user/windows_adsi.rb +1 -1
  439. data/lib/puppet/provider/yumrepo/inifile.rb +3 -3
  440. data/lib/puppet/provider/zfs/zfs.rb +1 -5
  441. data/lib/puppet/reference/configuration.rb +0 -2
  442. data/lib/puppet/reference/indirection.rb +1 -1
  443. data/lib/puppet/reference/metaparameter.rb +1 -1
  444. data/lib/puppet/reference/providers.rb +6 -6
  445. data/lib/puppet/reference/type.rb +2 -2
  446. data/lib/puppet/relationship.rb +7 -9
  447. data/lib/puppet/reports/http.rb +8 -6
  448. data/lib/puppet/resource.rb +75 -134
  449. data/lib/puppet/resource/capability_finder.rb +1 -1
  450. data/lib/puppet/resource/catalog.rb +26 -34
  451. data/lib/puppet/resource/status.rb +13 -24
  452. data/lib/puppet/resource/type.rb +13 -61
  453. data/lib/puppet/resource/type_collection.rb +29 -23
  454. data/lib/puppet/settings.rb +1 -1
  455. data/lib/puppet/settings/array_setting.rb +1 -1
  456. data/lib/puppet/settings/autosign_setting.rb +1 -1
  457. data/lib/puppet/settings/boolean_setting.rb +1 -1
  458. data/lib/puppet/settings/config_file.rb +2 -2
  459. data/lib/puppet/settings/duration_setting.rb +1 -1
  460. data/lib/puppet/settings/enum_setting.rb +1 -1
  461. data/lib/puppet/settings/environment_conf.rb +2 -10
  462. data/lib/puppet/settings/file_setting.rb +2 -2
  463. data/lib/puppet/settings/priority_setting.rb +1 -1
  464. data/lib/puppet/settings/server_list_setting.rb +1 -1
  465. data/lib/puppet/settings/symbolic_enum_setting.rb +1 -1
  466. data/lib/puppet/settings/terminus_setting.rb +1 -1
  467. data/lib/puppet/settings/ttl_setting.rb +2 -2
  468. data/lib/puppet/ssl/base.rb +2 -2
  469. data/lib/puppet/ssl/certificate_authority.rb +21 -21
  470. data/lib/puppet/ssl/certificate_authority/interface.rb +13 -13
  471. data/lib/puppet/ssl/certificate_factory.rb +2 -2
  472. data/lib/puppet/ssl/certificate_request.rb +14 -14
  473. data/lib/puppet/ssl/certificate_request_attributes.rb +3 -3
  474. data/lib/puppet/ssl/certificate_revocation_list.rb +3 -3
  475. data/lib/puppet/ssl/host.rb +29 -29
  476. data/lib/puppet/ssl/inventory.rb +1 -1
  477. data/lib/puppet/ssl/key.rb +1 -1
  478. data/lib/puppet/ssl/oids.rb +5 -5
  479. data/lib/puppet/ssl/validator/default_validator.rb +3 -4
  480. data/lib/puppet/syntax_checkers/base64.rb +7 -7
  481. data/lib/puppet/syntax_checkers/json.rb +5 -5
  482. data/lib/puppet/test/test_helper.rb +0 -4
  483. data/lib/puppet/transaction.rb +38 -23
  484. data/lib/puppet/transaction/additional_resource_generator.rb +4 -3
  485. data/lib/puppet/transaction/event.rb +19 -8
  486. data/lib/puppet/transaction/event_manager.rb +6 -6
  487. data/lib/puppet/transaction/persistence.rb +6 -6
  488. data/lib/puppet/transaction/report.rb +34 -47
  489. data/lib/puppet/transaction/resource_harness.rb +14 -12
  490. data/lib/puppet/type.rb +9 -7
  491. data/lib/puppet/type/augeas.rb +2 -2
  492. data/lib/puppet/type/cron.rb +14 -31
  493. data/lib/puppet/type/exec.rb +16 -16
  494. data/lib/puppet/type/file.rb +21 -22
  495. data/lib/puppet/type/file/content.rb +1 -1
  496. data/lib/puppet/type/file/group.rb +3 -3
  497. data/lib/puppet/type/file/mode.rb +6 -6
  498. data/lib/puppet/type/file/owner.rb +3 -3
  499. data/lib/puppet/type/file/selcontext.rb +18 -1
  500. data/lib/puppet/type/file/source.rb +5 -1
  501. data/lib/puppet/type/filebucket.rb +3 -8
  502. data/lib/puppet/type/group.rb +2 -2
  503. data/lib/puppet/type/host.rb +6 -6
  504. data/lib/puppet/type/interface.rb +1 -1
  505. data/lib/puppet/type/k5login.rb +1 -1
  506. data/lib/puppet/type/macauthorization.rb +1 -1
  507. data/lib/puppet/type/mailalias.rb +2 -18
  508. data/lib/puppet/type/maillist.rb +1 -1
  509. data/lib/puppet/type/mount.rb +8 -8
  510. data/lib/puppet/type/notify.rb +2 -0
  511. data/lib/puppet/type/package.rb +5 -5
  512. data/lib/puppet/type/resources.rb +6 -6
  513. data/lib/puppet/type/schedule.rb +9 -9
  514. data/lib/puppet/type/scheduled_task.rb +9 -8
  515. data/lib/puppet/type/service.rb +1 -1
  516. data/lib/puppet/type/ssh_authorized_key.rb +3 -19
  517. data/lib/puppet/type/sshkey.rb +4 -4
  518. data/lib/puppet/type/tidy.rb +16 -19
  519. data/lib/puppet/type/user.rb +35 -70
  520. data/lib/puppet/type/yumrepo.rb +8 -8
  521. data/lib/puppet/type/zone.rb +7 -7
  522. data/lib/puppet/type/zpool.rb +3 -3
  523. data/lib/puppet/util.rb +16 -12
  524. data/lib/puppet/util/at_fork.rb +35 -0
  525. data/lib/puppet/util/at_fork/noop.rb +18 -0
  526. data/lib/puppet/util/at_fork/solaris.rb +158 -0
  527. data/lib/puppet/util/autoload.rb +2 -2
  528. data/lib/puppet/util/backups.rb +6 -6
  529. data/lib/puppet/util/classgen.rb +4 -4
  530. data/lib/puppet/util/command_line.rb +4 -4
  531. data/lib/puppet/util/command_line/puppet_option_parser.rb +3 -3
  532. data/lib/puppet/util/command_line/trollop.rb +31 -31
  533. data/lib/puppet/util/diff.rb +1 -1
  534. data/lib/puppet/util/errors.rb +4 -4
  535. data/lib/puppet/util/execution.rb +9 -9
  536. data/lib/puppet/util/feature.rb +5 -5
  537. data/lib/puppet/util/fileparsing.rb +8 -8
  538. data/lib/puppet/util/filetype.rb +15 -15
  539. data/lib/puppet/util/http_proxy.rb +7 -15
  540. data/lib/puppet/util/inifile.rb +4 -4
  541. data/lib/puppet/util/instance_loader.rb +1 -1
  542. data/lib/puppet/util/json_lockfile.rb +4 -4
  543. data/lib/puppet/util/ldap/connection.rb +2 -2
  544. data/lib/puppet/util/ldap/manager.rb +2 -2
  545. data/lib/puppet/util/limits.rb +1 -1
  546. data/lib/puppet/util/log.rb +23 -16
  547. data/lib/puppet/util/log/destinations.rb +10 -16
  548. data/lib/puppet/util/logging.rb +11 -8
  549. data/lib/puppet/util/metric.rb +9 -6
  550. data/lib/puppet/util/monkey_patches.rb +27 -66
  551. data/lib/puppet/util/network_device.rb +1 -1
  552. data/lib/puppet/util/network_device/cisco/device.rb +7 -7
  553. data/lib/puppet/util/network_device/cisco/interface.rb +1 -1
  554. data/lib/puppet/util/network_device/config.rb +6 -6
  555. data/lib/puppet/util/network_device/transport/ssh.rb +6 -6
  556. data/lib/puppet/util/plist.rb +4 -2
  557. data/lib/puppet/util/posix.rb +5 -5
  558. data/lib/puppet/util/profiler/wall_clock.rb +1 -1
  559. data/lib/puppet/util/provider_features.rb +1 -1
  560. data/lib/puppet/util/psych_support.rb +3 -11
  561. data/lib/puppet/util/rdoc.rb +4 -4
  562. data/lib/puppet/util/reference.rb +14 -7
  563. data/lib/puppet/util/resource_template.rb +1 -1
  564. data/lib/puppet/util/retry_action.rb +2 -2
  565. data/lib/puppet/util/selinux.rb +54 -12
  566. data/lib/puppet/util/splayer.rb +1 -1
  567. data/lib/puppet/util/storage.rb +5 -5
  568. data/lib/puppet/util/suidmanager.rb +4 -4
  569. data/lib/puppet/util/symbolic_file_mode.rb +9 -9
  570. data/lib/puppet/util/tag_set.rb +1 -4
  571. data/lib/puppet/util/tagging.rb +2 -2
  572. data/lib/puppet/util/windows.rb +2 -0
  573. data/lib/puppet/util/windows/adsi.rb +19 -16
  574. data/lib/puppet/util/windows/api_types.rb +7 -11
  575. data/lib/puppet/util/windows/com.rb +4 -4
  576. data/lib/puppet/util/windows/error.rb +2 -2
  577. data/lib/puppet/util/windows/eventlog.rb +192 -0
  578. data/lib/puppet/util/windows/file.rb +13 -96
  579. data/lib/puppet/util/windows/principal.rb +6 -7
  580. data/lib/puppet/util/windows/process.rb +6 -14
  581. data/lib/puppet/util/windows/registry.rb +11 -11
  582. data/lib/puppet/util/windows/root_certs.rb +1 -1
  583. data/lib/puppet/util/windows/security.rb +14 -14
  584. data/lib/puppet/util/windows/sid.rb +13 -66
  585. data/lib/puppet/util/windows/taskscheduler.rb +62 -62
  586. data/lib/puppet/util/windows/user.rb +6 -6
  587. data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet.rb +2 -10
  588. data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/gem_version.rb +1 -1
  589. data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version.rb +122 -114
  590. data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb +678 -342
  591. data/lib/puppet/vendor/semantic_puppet/{lib/semantic_puppet/locales → locales}/config.yaml +0 -0
  592. data/lib/puppet/version.rb +1 -1
  593. data/locales/config.yaml +1 -1
  594. data/locales/puppet.pot +7847 -112
  595. data/man/man5/puppet.conf.5 +55 -296
  596. data/man/man8/puppet-agent.8 +10 -32
  597. data/man/man8/puppet-apply.8 +6 -21
  598. data/man/man8/puppet-ca.8 +34 -48
  599. data/man/man8/puppet-catalog.8 +4 -4
  600. data/man/man8/puppet-cert.8 +6 -23
  601. data/man/man8/puppet-certificate.8 +28 -44
  602. data/man/man8/puppet-certificate_request.8 +4 -4
  603. data/man/man8/puppet-certificate_revocation_list.8 +4 -4
  604. data/man/man8/puppet-config.8 +5 -5
  605. data/man/man8/puppet-describe.8 +3 -3
  606. data/man/man8/puppet-device.8 +13 -23
  607. data/man/man8/puppet-doc.8 +5 -5
  608. data/man/man8/puppet-epp.8 +10 -16
  609. data/man/man8/puppet-facts.8 +4 -4
  610. data/man/man8/puppet-filebucket.8 +6 -63
  611. data/man/man8/puppet-help.8 +4 -4
  612. data/man/man8/puppet-inspect.8 +5 -8
  613. data/man/man8/puppet-key.8 +4 -4
  614. data/man/man8/puppet-man.8 +5 -5
  615. data/man/man8/puppet-master.8 +5 -5
  616. data/man/man8/puppet-module.8 +13 -22
  617. data/man/man8/puppet-node.8 +4 -4
  618. data/man/man8/puppet-parser.8 +4 -4
  619. data/man/man8/puppet-plugin.8 +4 -4
  620. data/man/man8/puppet-report.8 +4 -4
  621. data/man/man8/puppet-resource.8 +8 -4
  622. data/man/man8/puppet-status.8 +5 -5
  623. data/man/man8/puppet.8 +3 -12
  624. data/spec/fixtures/unit/application/environments/production/data/common.yaml +0 -2
  625. data/spec/fixtures/unit/data_providers/environments/production/modules/abc/metadata.json +9 -0
  626. data/spec/fixtures/unit/data_providers/environments/production/modules/xyz/metadata.json +9 -0
  627. data/spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/abc/metadata.json +9 -0
  628. data/spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/bad_data/metadata.json +9 -0
  629. data/spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/bca/metadata.json +9 -0
  630. data/spec/integration/agent/logging_spec.rb +0 -2
  631. data/spec/integration/application/apply_spec.rb +19 -23
  632. data/spec/integration/application/lookup_spec.rb +0 -21
  633. data/spec/integration/configurer_spec.rb +1 -1
  634. data/spec/integration/defaults_spec.rb +2 -2
  635. data/spec/integration/file_bucket/file_spec.rb +5 -20
  636. data/spec/integration/indirector/file_content/file_server_spec.rb +1 -0
  637. data/spec/integration/indirector/file_metadata/file_server_spec.rb +1 -0
  638. data/spec/integration/parser/catalog_spec.rb +1 -1
  639. data/spec/integration/parser/class_spec.rb +6 -6
  640. data/spec/integration/parser/compiler_spec.rb +184 -142
  641. data/spec/integration/parser/dynamic_scoping_spec.rb +0 -1
  642. data/spec/integration/parser/pcore_resource_spec.rb +1 -1
  643. data/spec/integration/parser/scope_spec.rb +53 -4
  644. data/spec/integration/provider/cron/crontab_spec.rb +0 -1
  645. data/spec/integration/resource/catalog_spec.rb +0 -4
  646. data/spec/integration/transaction/report_spec.rb +2 -2
  647. data/spec/integration/transaction_spec.rb +4 -37
  648. data/spec/integration/type/package_spec.rb +7 -1
  649. data/spec/integration/util/execution_spec.rb +0 -8
  650. data/spec/integration/util/windows/adsi_spec.rb +1 -86
  651. data/spec/integration/util/windows/principal_spec.rb +1 -10
  652. data/spec/integration/util/windows/process_spec.rb +0 -45
  653. data/spec/lib/matchers/json.rb +3 -3
  654. data/spec/lib/puppet/indirector_testing.rb +4 -0
  655. data/spec/lib/puppet_spec/compiler.rb +1 -1
  656. data/spec/lib/puppet_spec/modules.rb +2 -2
  657. data/spec/lib/puppet_spec/network.rb +10 -6
  658. data/spec/shared_contexts/types_setup.rb +28 -9
  659. data/spec/spec_helper.rb +0 -11
  660. data/spec/unit/agent_spec.rb +12 -34
  661. data/spec/unit/application/agent_spec.rb +16 -0
  662. data/spec/unit/application/apply_spec.rb +37 -13
  663. data/spec/unit/application/cert_spec.rb +1 -40
  664. data/spec/unit/application/config_spec.rb +0 -4
  665. data/spec/unit/application/describe_spec.rb +19 -0
  666. data/spec/unit/application/device_spec.rb +41 -2
  667. data/spec/unit/application/face_base_spec.rb +6 -6
  668. data/spec/unit/application/lookup_spec.rb +1 -31
  669. data/spec/unit/application/master_spec.rb +22 -6
  670. data/spec/unit/application/resource_spec.rb +17 -0
  671. data/spec/unit/application_spec.rb +0 -24
  672. data/spec/unit/capability_spec.rb +2 -6
  673. data/spec/unit/configurer/fact_handler_spec.rb +74 -41
  674. data/spec/unit/configurer/plugin_handler_spec.rb +13 -19
  675. data/spec/unit/configurer_spec.rb +36 -33
  676. data/spec/unit/defaults_spec.rb +0 -44
  677. data/spec/unit/environments_spec.rb +0 -15
  678. data/spec/unit/face/config_spec.rb +2 -1
  679. data/spec/unit/face/epp_face_spec.rb +0 -9
  680. data/spec/unit/face/module/list_spec.rb +60 -0
  681. data/spec/unit/file_bucket/file_spec.rb +3 -3
  682. data/spec/unit/file_serving/http_metadata_spec.rb +1 -1
  683. data/spec/unit/file_serving/metadata_spec.rb +14 -9
  684. data/spec/unit/forge/forge_spec.rb +2 -2
  685. data/spec/unit/forge_spec.rb +0 -105
  686. data/spec/unit/functions/annotate_spec.rb +175 -0
  687. data/spec/unit/functions/break_spec.rb +52 -83
  688. data/spec/unit/functions/call_spec.rb +77 -0
  689. data/spec/unit/functions/contain_spec.rb +1 -1
  690. data/spec/unit/functions/defined_spec.rb +2 -2
  691. data/spec/unit/functions/epp_spec.rb +0 -10
  692. data/spec/unit/functions/hiera_spec.rb +0 -5
  693. data/spec/unit/functions/lookup_fixture_spec.rb +1 -6
  694. data/spec/unit/functions/lookup_spec.rb +4 -97
  695. data/spec/unit/functions/new_spec.rb +1 -1
  696. data/spec/unit/functions/unique_spec.rb +111 -0
  697. data/spec/unit/functions4_spec.rb +2 -43
  698. data/spec/unit/graph/relationship_graph_spec.rb +0 -15
  699. data/spec/unit/graph/simple_graph_spec.rb +58 -55
  700. data/spec/unit/indirector/catalog/compiler_spec.rb +206 -174
  701. data/spec/unit/indirector/catalog/json_spec.rb +50 -1
  702. data/spec/unit/indirector/facts/facter_spec.rb +1 -2
  703. data/spec/unit/indirector/file_bucket_file/file_spec.rb +4 -4
  704. data/spec/unit/indirector/file_server_spec.rb +17 -2
  705. data/spec/unit/indirector/indirection_spec.rb +3 -60
  706. data/spec/unit/indirector/json_spec.rb +27 -6
  707. data/spec/unit/indirector/node/exec_spec.rb +12 -12
  708. data/spec/unit/indirector/node/ldap_spec.rb +29 -8
  709. data/spec/unit/indirector/node/plain_spec.rb +16 -6
  710. data/spec/unit/indirector/node/write_only_yaml_spec.rb +12 -0
  711. data/spec/unit/indirector/report/processor_spec.rb +2 -2
  712. data/spec/unit/indirector/report/rest_spec.rb +29 -3
  713. data/spec/unit/indirector/request_spec.rb +0 -45
  714. data/spec/unit/indirector/rest_spec.rb +57 -15
  715. data/spec/unit/interface/face_collection_spec.rb +7 -7
  716. data/spec/unit/interface_spec.rb +0 -12
  717. data/spec/unit/module_spec.rb +10 -31
  718. data/spec/unit/module_tool/applications/installer_spec.rb +0 -1
  719. data/spec/unit/module_tool/applications/upgrader_spec.rb +0 -1
  720. data/spec/unit/module_tool/tar/mini_spec.rb +5 -34
  721. data/spec/unit/network/format_handler_spec.rb +11 -11
  722. data/spec/unit/network/format_spec.rb +9 -0
  723. data/spec/unit/network/formats_spec.rb +322 -138
  724. data/spec/unit/network/http/api/indirected_routes_spec.rb +62 -52
  725. data/spec/unit/network/http/api/master/v3/environment_spec.rb +128 -2
  726. data/spec/unit/network/http/api/master/v3_spec.rb +1 -1
  727. data/spec/unit/network/http/api_spec.rb +1 -1
  728. data/spec/unit/network/http/compression_spec.rb +105 -88
  729. data/spec/unit/network/http/error_spec.rb +1 -2
  730. data/spec/unit/network/http/factory_spec.rb +9 -38
  731. data/spec/unit/network/http/handler_spec.rb +8 -12
  732. data/spec/unit/network/http/request_spec.rb +110 -0
  733. data/spec/unit/network/http/response_spec.rb +108 -0
  734. data/spec/unit/network/http/webrick_spec.rb +29 -30
  735. data/spec/unit/node/facts_spec.rb +13 -13
  736. data/spec/unit/node_spec.rb +33 -10
  737. data/spec/unit/parameter_spec.rb +73 -5
  738. data/spec/unit/parser/ast/leaf_spec.rb +4 -3
  739. data/spec/unit/parser/compiler_spec.rb +1 -1
  740. data/spec/unit/parser/environment_compiler_spec.rb +0 -2
  741. data/spec/unit/parser/functions/sprintf_spec.rb +0 -26
  742. data/spec/unit/parser/resource_spec.rb +86 -24
  743. data/spec/unit/parser/scope_spec.rb +4 -81
  744. data/spec/unit/pops/benchmark_spec.rb +8 -26
  745. data/spec/unit/pops/containment_spec.rb +0 -26
  746. data/spec/unit/pops/evaluator/access_ops_spec.rb +103 -103
  747. data/spec/unit/pops/evaluator/arithmetic_ops_spec.rb +59 -6
  748. data/spec/unit/pops/evaluator/basic_expressions_spec.rb +5 -5
  749. data/spec/unit/pops/evaluator/comparison_ops_spec.rb +26 -26
  750. data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +19 -7
  751. data/spec/unit/pops/evaluator/evaluator_rspec_helper.rb +7 -7
  752. data/spec/unit/pops/evaluator/runtime3_converter_spec.rb +36 -1
  753. data/spec/unit/pops/evaluator/string_interpolation_spec.rb +10 -10
  754. data/spec/unit/pops/evaluator/variables_spec.rb +1 -1
  755. data/spec/unit/pops/factory_rspec_helper.rb +0 -4
  756. data/spec/unit/pops/factory_spec.rb +83 -83
  757. data/spec/unit/pops/loaders/loaders_spec.rb +69 -1
  758. data/spec/unit/pops/loaders/static_loader_spec.rb +3 -7
  759. data/spec/unit/pops/model/model_spec.rb +10 -10
  760. data/spec/unit/pops/parser/epp_parser_spec.rb +1 -1
  761. data/spec/unit/pops/parser/lexer2_spec.rb +4 -59
  762. data/spec/unit/pops/parser/{source_pos_adapter_spec.rb → locator_spec.rb} +9 -11
  763. data/spec/unit/pops/parser/parse_application_spec.rb +0 -3
  764. data/spec/unit/pops/parser/parse_basic_expressions_spec.rb +4 -4
  765. data/spec/unit/pops/parser/parse_capabilities_spec.rb +0 -3
  766. data/spec/unit/pops/parser/parse_containers_spec.rb +17 -19
  767. data/spec/unit/pops/parser/parse_site_spec.rb +0 -3
  768. data/spec/unit/pops/parser/parser_spec.rb +8 -10
  769. data/spec/unit/pops/resource/resource_type_impl_spec.rb +1 -3
  770. data/spec/unit/pops/serialization/serialization_spec.rb +87 -1
  771. data/spec/unit/pops/serialization/to_from_hr_spec.rb +494 -0
  772. data/spec/unit/pops/time/timestamp_spec.rb +13 -0
  773. data/spec/unit/pops/types/iterable_spec.rb +1 -1
  774. data/spec/unit/pops/types/p_object_type_spec.rb +99 -13
  775. data/spec/unit/pops/types/p_timestamp_type_spec.rb +8 -8
  776. data/spec/unit/pops/types/p_type_set_type_spec.rb +1 -9
  777. data/spec/unit/pops/types/ruby_generator_spec.rb +57 -20
  778. data/spec/unit/pops/types/string_converter_spec.rb +78 -30
  779. data/spec/unit/pops/types/type_acceptor_spec.rb +2 -2
  780. data/spec/unit/pops/types/type_calculator_spec.rb +207 -123
  781. data/spec/unit/pops/types/type_factory_spec.rb +9 -9
  782. data/spec/unit/pops/types/type_formatter_spec.rb +32 -19
  783. data/spec/unit/pops/types/type_mismatch_describer_spec.rb +0 -9
  784. data/spec/unit/pops/types/type_parser_spec.rb +6 -6
  785. data/spec/unit/pops/types/types_spec.rb +42 -2
  786. data/spec/unit/pops/validator/validator_spec.rb +25 -86
  787. data/spec/unit/pops/visitor_spec.rb +1 -1
  788. data/spec/unit/property/list_spec.rb +2 -2
  789. data/spec/unit/provider/augeas/augeas_spec.rb +1 -1
  790. data/spec/unit/provider/group/windows_adsi_spec.rb +22 -79
  791. data/spec/unit/provider/package/aix_spec.rb +0 -8
  792. data/spec/unit/provider/package/portage_spec.rb +103 -17
  793. data/spec/unit/provider/package/rpm_spec.rb +14 -1
  794. data/spec/unit/provider/package/yum_spec.rb +0 -10
  795. data/spec/unit/provider/service/base_spec.rb +0 -20
  796. data/spec/unit/provider/service/smf_spec.rb +4 -2
  797. data/spec/unit/provider/service/systemd_spec.rb +1 -15
  798. data/spec/unit/provider/user/directoryservice_spec.rb +7 -7
  799. data/spec/unit/provider/user/windows_adsi_spec.rb +4 -4
  800. data/spec/unit/provider/zfs/zfs_spec.rb +1 -7
  801. data/spec/unit/puppet_spec.rb +2 -3
  802. data/spec/unit/relationship_spec.rb +15 -36
  803. data/spec/unit/reports/http_spec.rb +11 -8
  804. data/spec/unit/resource/catalog_spec.rb +47 -49
  805. data/spec/unit/resource/status_spec.rb +114 -103
  806. data/spec/unit/resource/type_collection_spec.rb +5 -5
  807. data/spec/unit/resource/type_spec.rb +4 -71
  808. data/spec/unit/resource_spec.rb +30 -34
  809. data/spec/unit/settings_spec.rb +4 -2
  810. data/spec/unit/ssl/host_spec.rb +34 -34
  811. data/spec/unit/status_spec.rb +7 -7
  812. data/spec/unit/transaction/event_spec.rb +18 -15
  813. data/spec/unit/transaction/report_spec.rb +100 -81
  814. data/spec/unit/transaction/resource_harness_spec.rb +3 -3
  815. data/spec/unit/transaction_spec.rb +53 -8
  816. data/spec/unit/type/file/group_spec.rb +2 -2
  817. data/spec/unit/type/file/mode_spec.rb +9 -9
  818. data/spec/unit/type/file/owner_spec.rb +2 -2
  819. data/spec/unit/type/file/selinux_spec.rb +2 -0
  820. data/spec/unit/type/file/source_spec.rb +13 -0
  821. data/spec/unit/type/nagios_spec.rb +1 -21
  822. data/spec/unit/type/ssh_authorized_key_spec.rb +2 -2
  823. data/spec/unit/type/tidy_spec.rb +0 -14
  824. data/spec/unit/type/user_spec.rb +2 -4
  825. data/spec/unit/util/at_fork_spec.rb +150 -0
  826. data/spec/unit/util/execution_spec.rb +31 -2
  827. data/spec/unit/util/http_proxy_spec.rb +0 -37
  828. data/spec/unit/util/log/destinations_spec.rb +5 -6
  829. data/spec/unit/util/log_spec.rb +62 -17
  830. data/spec/unit/util/metric_spec.rb +9 -2
  831. data/spec/unit/util/monkey_patches_spec.rb +6 -188
  832. data/spec/unit/util/run_mode_spec.rb +17 -10
  833. data/spec/unit/util/tag_set_spec.rb +2 -2
  834. data/spec/unit/util/tagging_spec.rb +55 -0
  835. data/spec/unit/util/windows/adsi_spec.rb +27 -31
  836. data/spec/unit/util/windows/api_types_spec.rb +0 -51
  837. data/spec/unit/util/windows/eventlog_spec.rb +123 -0
  838. data/spec/unit/util/windows/sid_spec.rb +15 -86
  839. data/spec/unit/util_spec.rb +7 -1
  840. data/tasks/benchmark.rake +3 -3
  841. data/tasks/cfpropertylist.rake +1 -1
  842. data/tasks/generate_ast_model.rake +78 -0
  843. data/tasks/manpages.rake +1 -1
  844. data/tasks/parallel.rake +7 -12
  845. metadata +3436 -3695
  846. checksums.yaml +0 -7
  847. data/bin/extlookup2hiera +0 -56
  848. data/ext/emacs/puppet-mode-init.el +0 -6
  849. data/ext/emacs/puppet-mode.el +0 -433
  850. data/ext/vim/README +0 -3
  851. data/ext/vim/ftdetect/puppet.vim +0 -2
  852. data/ext/vim/ftplugin/puppet.vim +0 -94
  853. data/ext/vim/indent/puppet.vim +0 -76
  854. data/ext/vim/syntax/puppet.vim +0 -115
  855. data/lib/puppet/application/file.rb +0 -4
  856. data/lib/puppet/application/inspect.rb +0 -184
  857. data/lib/puppet/application/resource_type.rb +0 -7
  858. data/lib/puppet/data_providers.rb +0 -34
  859. data/lib/puppet/data_providers/data_adapter.rb +0 -37
  860. data/lib/puppet/data_providers/data_function_support.rb +0 -32
  861. data/lib/puppet/data_providers/function_env_data_provider.rb +0 -26
  862. data/lib/puppet/data_providers/function_module_data_provider.rb +0 -24
  863. data/lib/puppet/data_providers/hiera_config.rb +0 -151
  864. data/lib/puppet/data_providers/hiera_env_data_provider.rb +0 -25
  865. data/lib/puppet/data_providers/hiera_interpolate.rb +0 -21
  866. data/lib/puppet/data_providers/hiera_module_data_provider.rb +0 -30
  867. data/lib/puppet/data_providers/hiera_support.rb +0 -42
  868. data/lib/puppet/data_providers/json_data_provider_factory.rb +0 -38
  869. data/lib/puppet/data_providers/yaml_data_provider_factory.rb +0 -40
  870. data/lib/puppet/face/file.rb +0 -50
  871. data/lib/puppet/face/file/download.rb +0 -56
  872. data/lib/puppet/face/file/store.rb +0 -21
  873. data/lib/puppet/face/resource_type.rb +0 -84
  874. data/lib/puppet/feature/cfacter.rb +0 -15
  875. data/lib/puppet/feature/external_facts.rb +0 -5
  876. data/lib/puppet/indirector/catalog/static_compiler.rb +0 -232
  877. data/lib/puppet/indirector/resource_type.rb +0 -5
  878. data/lib/puppet/indirector/resource_type/parser.rb +0 -108
  879. data/lib/puppet/indirector/resource_type/rest.rb +0 -7
  880. data/lib/puppet/parser/yaml_trimmer.rb +0 -7
  881. data/lib/puppet/plugins/binding_schemes.rb +0 -140
  882. data/lib/puppet/plugins/data_providers.rb +0 -45
  883. data/lib/puppet/plugins/data_providers/data_provider.rb +0 -406
  884. data/lib/puppet/plugins/data_providers/registry.rb +0 -51
  885. data/lib/puppet/pops/binder/binder.rb +0 -398
  886. data/lib/puppet/pops/binder/binder_issues.rb +0 -124
  887. data/lib/puppet/pops/binder/bindings_checker.rb +0 -201
  888. data/lib/puppet/pops/binder/bindings_composer.rb +0 -181
  889. data/lib/puppet/pops/binder/bindings_factory.rb +0 -813
  890. data/lib/puppet/pops/binder/bindings_label_provider.rb +0 -45
  891. data/lib/puppet/pops/binder/bindings_loader.rb +0 -87
  892. data/lib/puppet/pops/binder/bindings_model.rb +0 -70
  893. data/lib/puppet/pops/binder/bindings_model_dumper.rb +0 -215
  894. data/lib/puppet/pops/binder/bindings_model_meta.rb +0 -215
  895. data/lib/puppet/pops/binder/bindings_validator_factory.rb +0 -28
  896. data/lib/puppet/pops/binder/config/binder_config.rb +0 -107
  897. data/lib/puppet/pops/binder/config/binder_config_checker.rb +0 -142
  898. data/lib/puppet/pops/binder/config/diagnostic_producer.rb +0 -36
  899. data/lib/puppet/pops/binder/config/issues.rb +0 -90
  900. data/lib/puppet/pops/binder/injector.rb +0 -771
  901. data/lib/puppet/pops/binder/injector_entry.rb +0 -57
  902. data/lib/puppet/pops/binder/key_factory.rb +0 -65
  903. data/lib/puppet/pops/binder/producers.rb +0 -831
  904. data/lib/puppet/pops/binder/scheme_handler/confdir_scheme.rb +0 -34
  905. data/lib/puppet/pops/binder/scheme_handler/module_scheme.rb +0 -143
  906. data/lib/puppet/pops/binder/scheme_handler/symbolic_scheme.rb +0 -53
  907. data/lib/puppet/pops/binder/system_bindings.rb +0 -60
  908. data/lib/puppet/pops/containment.rb +0 -104
  909. data/lib/puppet/pops/model/model.rb +0 -131
  910. data/lib/puppet/pops/model/model_meta.rb +0 -629
  911. data/lib/puppet/pops/serialization/rgen.rb +0 -152
  912. data/lib/puppet/vendor/load_rgen.rb +0 -2
  913. data/lib/puppet/vendor/rgen/CHANGELOG +0 -197
  914. data/lib/puppet/vendor/rgen/MIT-LICENSE +0 -20
  915. data/lib/puppet/vendor/rgen/PUPPET_README.md +0 -6
  916. data/lib/puppet/vendor/rgen/README.rdoc +0 -78
  917. data/lib/puppet/vendor/rgen/Rakefile +0 -41
  918. data/lib/puppet/vendor/rgen/TODO +0 -41
  919. data/lib/puppet/vendor/rgen/anounce.txt +0 -61
  920. data/lib/puppet/vendor/rgen/design_rationale.txt +0 -71
  921. data/lib/puppet/vendor/rgen/lib/ea_support/ea_support.rb +0 -54
  922. data/lib/puppet/vendor/rgen/lib/ea_support/id_store.rb +0 -32
  923. data/lib/puppet/vendor/rgen/lib/ea_support/uml13_ea_metamodel.rb +0 -562
  924. data/lib/puppet/vendor/rgen/lib/ea_support/uml13_ea_metamodel_ext.rb +0 -45
  925. data/lib/puppet/vendor/rgen/lib/ea_support/uml13_ea_metamodel_generator.rb +0 -43
  926. data/lib/puppet/vendor/rgen/lib/ea_support/uml13_ea_to_uml13.rb +0 -103
  927. data/lib/puppet/vendor/rgen/lib/ea_support/uml13_to_uml13_ea.rb +0 -89
  928. data/lib/puppet/vendor/rgen/lib/metamodels/uml13_metamodel.rb +0 -559
  929. data/lib/puppet/vendor/rgen/lib/metamodels/uml13_metamodel_ext.rb +0 -26
  930. data/lib/puppet/vendor/rgen/lib/mmgen/metamodel_generator.rb +0 -20
  931. data/lib/puppet/vendor/rgen/lib/mmgen/mm_ext/ecore_mmgen_ext.rb +0 -91
  932. data/lib/puppet/vendor/rgen/lib/mmgen/mmgen.rb +0 -28
  933. data/lib/puppet/vendor/rgen/lib/mmgen/templates/annotations.tpl +0 -37
  934. data/lib/puppet/vendor/rgen/lib/mmgen/templates/metamodel_generator.tpl +0 -172
  935. data/lib/puppet/vendor/rgen/lib/rgen/array_extensions.rb +0 -45
  936. data/lib/puppet/vendor/rgen/lib/rgen/ecore/ecore.rb +0 -218
  937. data/lib/puppet/vendor/rgen/lib/rgen/ecore/ecore_builder_methods.rb +0 -81
  938. data/lib/puppet/vendor/rgen/lib/rgen/ecore/ecore_ext.rb +0 -69
  939. data/lib/puppet/vendor/rgen/lib/rgen/ecore/ecore_interface.rb +0 -47
  940. data/lib/puppet/vendor/rgen/lib/rgen/ecore/ecore_to_ruby.rb +0 -167
  941. data/lib/puppet/vendor/rgen/lib/rgen/ecore/ruby_to_ecore.rb +0 -91
  942. data/lib/puppet/vendor/rgen/lib/rgen/environment.rb +0 -129
  943. data/lib/puppet/vendor/rgen/lib/rgen/fragment/dump_file_cache.rb +0 -63
  944. data/lib/puppet/vendor/rgen/lib/rgen/fragment/fragmented_model.rb +0 -140
  945. data/lib/puppet/vendor/rgen/lib/rgen/fragment/model_fragment.rb +0 -289
  946. data/lib/puppet/vendor/rgen/lib/rgen/instantiator/abstract_instantiator.rb +0 -66
  947. data/lib/puppet/vendor/rgen/lib/rgen/instantiator/abstract_xml_instantiator.rb +0 -66
  948. data/lib/puppet/vendor/rgen/lib/rgen/instantiator/default_xml_instantiator.rb +0 -117
  949. data/lib/puppet/vendor/rgen/lib/rgen/instantiator/ecore_xml_instantiator.rb +0 -169
  950. data/lib/puppet/vendor/rgen/lib/rgen/instantiator/json_instantiator.rb +0 -126
  951. data/lib/puppet/vendor/rgen/lib/rgen/instantiator/json_parser.rb +0 -331
  952. data/lib/puppet/vendor/rgen/lib/rgen/instantiator/json_parser.y +0 -94
  953. data/lib/puppet/vendor/rgen/lib/rgen/instantiator/nodebased_xml_instantiator.rb +0 -137
  954. data/lib/puppet/vendor/rgen/lib/rgen/instantiator/qualified_name_resolver.rb +0 -97
  955. data/lib/puppet/vendor/rgen/lib/rgen/instantiator/reference_resolver.rb +0 -128
  956. data/lib/puppet/vendor/rgen/lib/rgen/instantiator/resolution_helper.rb +0 -47
  957. data/lib/puppet/vendor/rgen/lib/rgen/instantiator/xmi11_instantiator.rb +0 -168
  958. data/lib/puppet/vendor/rgen/lib/rgen/metamodel_builder.rb +0 -224
  959. data/lib/puppet/vendor/rgen/lib/rgen/metamodel_builder/builder_extensions.rb +0 -556
  960. data/lib/puppet/vendor/rgen/lib/rgen/metamodel_builder/builder_runtime.rb +0 -174
  961. data/lib/puppet/vendor/rgen/lib/rgen/metamodel_builder/constant_order_helper.rb +0 -89
  962. data/lib/puppet/vendor/rgen/lib/rgen/metamodel_builder/data_types.rb +0 -77
  963. data/lib/puppet/vendor/rgen/lib/rgen/metamodel_builder/intermediate/annotation.rb +0 -30
  964. data/lib/puppet/vendor/rgen/lib/rgen/metamodel_builder/intermediate/feature.rb +0 -168
  965. data/lib/puppet/vendor/rgen/lib/rgen/metamodel_builder/mm_multiple.rb +0 -23
  966. data/lib/puppet/vendor/rgen/lib/rgen/metamodel_builder/module_extension.rb +0 -42
  967. data/lib/puppet/vendor/rgen/lib/rgen/model_builder.rb +0 -32
  968. data/lib/puppet/vendor/rgen/lib/rgen/model_builder/builder_context.rb +0 -334
  969. data/lib/puppet/vendor/rgen/lib/rgen/model_builder/model_serializer.rb +0 -225
  970. data/lib/puppet/vendor/rgen/lib/rgen/model_builder/reference_resolver.rb +0 -156
  971. data/lib/puppet/vendor/rgen/lib/rgen/serializer/json_serializer.rb +0 -121
  972. data/lib/puppet/vendor/rgen/lib/rgen/serializer/opposite_reference_filter.rb +0 -18
  973. data/lib/puppet/vendor/rgen/lib/rgen/serializer/qualified_name_provider.rb +0 -47
  974. data/lib/puppet/vendor/rgen/lib/rgen/serializer/xmi11_serializer.rb +0 -116
  975. data/lib/puppet/vendor/rgen/lib/rgen/serializer/xmi20_serializer.rb +0 -71
  976. data/lib/puppet/vendor/rgen/lib/rgen/serializer/xml_serializer.rb +0 -98
  977. data/lib/puppet/vendor/rgen/lib/rgen/template_language.rb +0 -297
  978. data/lib/puppet/vendor/rgen/lib/rgen/template_language/directory_template_container.rb +0 -83
  979. data/lib/puppet/vendor/rgen/lib/rgen/template_language/output_handler.rb +0 -87
  980. data/lib/puppet/vendor/rgen/lib/rgen/template_language/template_container.rb +0 -234
  981. data/lib/puppet/vendor/rgen/lib/rgen/template_language/template_helper.rb +0 -26
  982. data/lib/puppet/vendor/rgen/lib/rgen/transformer.rb +0 -475
  983. data/lib/puppet/vendor/rgen/lib/rgen/util/auto_class_creator.rb +0 -61
  984. data/lib/puppet/vendor/rgen/lib/rgen/util/cached_glob.rb +0 -67
  985. data/lib/puppet/vendor/rgen/lib/rgen/util/file_cache_map.rb +0 -124
  986. data/lib/puppet/vendor/rgen/lib/rgen/util/file_change_detector.rb +0 -84
  987. data/lib/puppet/vendor/rgen/lib/rgen/util/method_delegation.rb +0 -114
  988. data/lib/puppet/vendor/rgen/lib/rgen/util/model_comparator.rb +0 -68
  989. data/lib/puppet/vendor/rgen/lib/rgen/util/model_comparator_base.rb +0 -142
  990. data/lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb +0 -29
  991. data/lib/puppet/vendor/rgen/lib/rgen/util/name_helper.rb +0 -42
  992. data/lib/puppet/vendor/rgen/lib/rgen/util/pattern_matcher.rb +0 -329
  993. data/lib/puppet/vendor/rgen/lib/transformers/ecore_to_uml13.rb +0 -79
  994. data/lib/puppet/vendor/rgen/lib/transformers/uml13_to_ecore.rb +0 -127
  995. data/lib/puppet/vendor/rgen/test/array_extensions_test.rb +0 -64
  996. data/lib/puppet/vendor/rgen/test/ea_instantiator_test.rb +0 -35
  997. data/lib/puppet/vendor/rgen/test/ea_serializer_test.rb +0 -23
  998. data/lib/puppet/vendor/rgen/test/ecore_self_test.rb +0 -54
  999. data/lib/puppet/vendor/rgen/test/environment_test.rb +0 -90
  1000. data/lib/puppet/vendor/rgen/test/json_test.rb +0 -171
  1001. data/lib/puppet/vendor/rgen/test/metamodel_builder_test.rb +0 -1482
  1002. data/lib/puppet/vendor/rgen/test/metamodel_from_ecore_test.rb +0 -57
  1003. data/lib/puppet/vendor/rgen/test/metamodel_order_test.rb +0 -131
  1004. data/lib/puppet/vendor/rgen/test/metamodel_roundtrip_test.rb +0 -98
  1005. data/lib/puppet/vendor/rgen/test/metamodel_roundtrip_test/TestModel.rb +0 -70
  1006. data/lib/puppet/vendor/rgen/test/metamodel_roundtrip_test/houseMetamodel.ecore +0 -42
  1007. data/lib/puppet/vendor/rgen/test/metamodel_roundtrip_test/houseMetamodel_from_ecore.rb +0 -44
  1008. data/lib/puppet/vendor/rgen/test/metamodel_roundtrip_test/using_builtin_types.ecore +0 -9
  1009. data/lib/puppet/vendor/rgen/test/method_delegation_test.rb +0 -178
  1010. data/lib/puppet/vendor/rgen/test/model_builder/builder_context_test.rb +0 -59
  1011. data/lib/puppet/vendor/rgen/test/model_builder/builder_test.rb +0 -242
  1012. data/lib/puppet/vendor/rgen/test/model_builder/ecore_original.rb +0 -163
  1013. data/lib/puppet/vendor/rgen/test/model_builder/ecore_original_regenerated.rb +0 -163
  1014. data/lib/puppet/vendor/rgen/test/model_builder/reference_resolver_test.rb +0 -156
  1015. data/lib/puppet/vendor/rgen/test/model_builder/serializer_test.rb +0 -94
  1016. data/lib/puppet/vendor/rgen/test/model_builder/statemachine_metamodel.rb +0 -42
  1017. data/lib/puppet/vendor/rgen/test/model_builder/test_model/statemachine1.rb +0 -23
  1018. data/lib/puppet/vendor/rgen/test/model_builder_test.rb +0 -6
  1019. data/lib/puppet/vendor/rgen/test/model_fragment_test.rb +0 -30
  1020. data/lib/puppet/vendor/rgen/test/output_handler_test.rb +0 -58
  1021. data/lib/puppet/vendor/rgen/test/qualified_name_provider_test.rb +0 -48
  1022. data/lib/puppet/vendor/rgen/test/qualified_name_resolver_test.rb +0 -102
  1023. data/lib/puppet/vendor/rgen/test/reference_resolver_test.rb +0 -117
  1024. data/lib/puppet/vendor/rgen/test/rgen_test.rb +0 -26
  1025. data/lib/puppet/vendor/rgen/test/template_language_test.rb +0 -163
  1026. data/lib/puppet/vendor/rgen/test/template_language_test/expected_result1.txt +0 -29
  1027. data/lib/puppet/vendor/rgen/test/template_language_test/expected_result2.txt +0 -9
  1028. data/lib/puppet/vendor/rgen/test/template_language_test/expected_result3.txt +0 -4
  1029. data/lib/puppet/vendor/rgen/test/template_language_test/indentStringTestDefaultIndent.out +0 -1
  1030. data/lib/puppet/vendor/rgen/test/template_language_test/indentStringTestTabIndent.out +0 -1
  1031. data/lib/puppet/vendor/rgen/test/template_language_test/templates/callback_indent_test/a.tpl +0 -12
  1032. data/lib/puppet/vendor/rgen/test/template_language_test/templates/callback_indent_test/b.tpl +0 -5
  1033. data/lib/puppet/vendor/rgen/test/template_language_test/templates/code/array.tpl +0 -11
  1034. data/lib/puppet/vendor/rgen/test/template_language_test/templates/content/author.tpl +0 -7
  1035. data/lib/puppet/vendor/rgen/test/template_language_test/templates/content/chapter.tpl +0 -5
  1036. data/lib/puppet/vendor/rgen/test/template_language_test/templates/define_local_test/local.tpl +0 -8
  1037. data/lib/puppet/vendor/rgen/test/template_language_test/templates/define_local_test/test.tpl +0 -8
  1038. data/lib/puppet/vendor/rgen/test/template_language_test/templates/evaluate_test/test.tpl +0 -7
  1039. data/lib/puppet/vendor/rgen/test/template_language_test/templates/indent_string_test.tpl +0 -12
  1040. data/lib/puppet/vendor/rgen/test/template_language_test/templates/index/c/cmod.tpl +0 -1
  1041. data/lib/puppet/vendor/rgen/test/template_language_test/templates/index/chapter.tpl +0 -3
  1042. data/lib/puppet/vendor/rgen/test/template_language_test/templates/no_backslash_r_test.tpl +0 -5
  1043. data/lib/puppet/vendor/rgen/test/template_language_test/templates/no_indent_test/no_indent.tpl +0 -3
  1044. data/lib/puppet/vendor/rgen/test/template_language_test/templates/no_indent_test/sub1/no_indent.tpl +0 -3
  1045. data/lib/puppet/vendor/rgen/test/template_language_test/templates/no_indent_test/test.tpl +0 -24
  1046. data/lib/puppet/vendor/rgen/test/template_language_test/templates/no_indent_test/test2.tpl +0 -13
  1047. data/lib/puppet/vendor/rgen/test/template_language_test/templates/no_indent_test/test3.tpl +0 -10
  1048. data/lib/puppet/vendor/rgen/test/template_language_test/templates/null_context_test.tpl +0 -17
  1049. data/lib/puppet/vendor/rgen/test/template_language_test/templates/root.tpl +0 -31
  1050. data/lib/puppet/vendor/rgen/test/template_language_test/templates/template_resolution_test/sub1.tpl +0 -9
  1051. data/lib/puppet/vendor/rgen/test/template_language_test/templates/template_resolution_test/sub1/sub1.tpl +0 -3
  1052. data/lib/puppet/vendor/rgen/test/template_language_test/templates/template_resolution_test/test.tpl +0 -4
  1053. data/lib/puppet/vendor/rgen/test/template_language_test/testout.txt +0 -29
  1054. data/lib/puppet/vendor/rgen/test/testmodel/class_model_checker.rb +0 -119
  1055. data/lib/puppet/vendor/rgen/test/testmodel/ea_testmodel.eap +0 -0
  1056. data/lib/puppet/vendor/rgen/test/testmodel/ea_testmodel.xml +0 -1029
  1057. data/lib/puppet/vendor/rgen/test/testmodel/ea_testmodel_partial.xml +0 -317
  1058. data/lib/puppet/vendor/rgen/test/testmodel/ecore_model_checker.rb +0 -101
  1059. data/lib/puppet/vendor/rgen/test/testmodel/manual_testmodel.xml +0 -22
  1060. data/lib/puppet/vendor/rgen/test/testmodel/object_model_checker.rb +0 -67
  1061. data/lib/puppet/vendor/rgen/test/transformer_test.rb +0 -254
  1062. data/lib/puppet/vendor/rgen/test/util/file_cache_map_test.rb +0 -99
  1063. data/lib/puppet/vendor/rgen/test/util/pattern_matcher_test.rb +0 -97
  1064. data/lib/puppet/vendor/rgen/test/util_test.rb +0 -5
  1065. data/lib/puppet/vendor/rgen/test/xml_instantiator_test.rb +0 -160
  1066. data/lib/puppet/vendor/rgen/test/xml_instantiator_test/simple_ecore_model_checker.rb +0 -94
  1067. data/lib/puppet/vendor/rgen/test/xml_instantiator_test/simple_xmi_ecore_instantiator.rb +0 -53
  1068. data/lib/puppet/vendor/rgen/test/xml_instantiator_test/simple_xmi_metamodel.rb +0 -49
  1069. data/lib/puppet/vendor/rgen/test/xml_instantiator_test/simple_xmi_to_ecore.rb +0 -75
  1070. data/lib/puppet/vendor/rgen_patch.rb +0 -132
  1071. data/lib/semver.rb +0 -146
  1072. data/man/man8/extlookup2hiera.8 +0 -10
  1073. data/man/man8/puppet-file.8 +0 -189
  1074. data/man/man8/puppet-generate.8 +0 -84
  1075. data/man/man8/puppet-lookup.8 +0 -87
  1076. data/man/man8/puppet-resource_type.8 +0 -188
  1077. data/spec/fixtures/unit/data_providers/environments/production/modules/abc/lib/puppet/bindings/abc/default.rb +0 -9
  1078. data/spec/fixtures/unit/data_providers/environments/production/modules/xyz/lib/puppet/bindings/xyz/default.rb +0 -9
  1079. data/spec/fixtures/unit/data_providers/environments/sample/environment.conf +0 -2
  1080. data/spec/fixtures/unit/data_providers/environments/sample/modules/backend/hiera.yaml +0 -5
  1081. data/spec/fixtures/unit/data_providers/environments/sample/modules/backend/lib/puppet/bindings/backend/default.rb +0 -9
  1082. data/spec/fixtures/unit/data_providers/environments/sample/modules/backend/lib/puppet_x/backend/special_data_provider_factory.rb +0 -23
  1083. data/spec/fixtures/unit/data_providers/environments/sample/modules/backend/manifests/init.pp +0 -5
  1084. data/spec/fixtures/unit/data_providers/environments/sample/modules/backend/metadata.json +0 -9
  1085. data/spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet/bindings/dataprovider/default.rb +0 -54
  1086. data/spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb +0 -33
  1087. data/spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_module_data.rb +0 -33
  1088. data/spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/manifests/init.pp +0 -5
  1089. data/spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/abc/lib/puppet/bindings/abc/default.rb +0 -9
  1090. data/spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/bad_data/lib/puppet/bindings/bad_data/default.rb +0 -9
  1091. data/spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/bca/lib/puppet/bindings/bca/default.rb +0 -9
  1092. data/spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/metawcp/lib/puppet/bindings/metawcp/default.rb +0 -10
  1093. data/spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/metawcp/lib/puppet_x/thallgren/sample_module_data.rb +0 -23
  1094. data/spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/metawcp/manifests/init.pp +0 -3
  1095. data/spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/metawcp/metadata.json +0 -9
  1096. data/spec/fixtures/unit/provider/package/yum/yum-check-update-plugin-output.txt +0 -36
  1097. data/spec/fixtures/unit/provider/service/base/ps_ef.mixed_encoding +0 -3
  1098. data/spec/unit/application/inspect_spec.rb +0 -316
  1099. data/spec/unit/data_providers/custom_data_provider_spec.rb +0 -50
  1100. data/spec/unit/face/file_spec.rb +0 -14
  1101. data/spec/unit/indirector/catalog/static_compiler_spec.rb +0 -255
  1102. data/spec/unit/indirector/resource_type/parser_spec.rb +0 -259
  1103. data/spec/unit/indirector/resource_type/rest_spec.rb +0 -14
  1104. data/spec/unit/pops/binder/binder_spec.rb +0 -43
  1105. data/spec/unit/pops/binder/bindings_checker_spec.rb +0 -155
  1106. data/spec/unit/pops/binder/bindings_composer_spec.rb +0 -64
  1107. data/spec/unit/pops/binder/bindings_validator_factory_spec.rb +0 -18
  1108. data/spec/unit/pops/binder/config/binder_config_spec.rb +0 -42
  1109. data/spec/unit/pops/binder/injector_spec.rb +0 -768
  1110. data/spec/unit/pops/parser/rgen_sanitycheck_spec.rb +0 -23
  1111. data/spec/unit/pops/serialization/rgen_spec.rb +0 -88
  1112. data/spec/unit/semver_spec.rb +0 -546
@@ -0,0 +1,4833 @@
1
+ # # Generated by Puppet::Pops::Types::RubyGenerator from TypeSet Puppet::AST on -4712-01-01
2
+
3
+ module Puppet
4
+ module Pops
5
+ module Model
6
+ class PopsObject
7
+ def self._pcore_type
8
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::PopsObject', {
9
+ })
10
+ end
11
+
12
+ include Types::PuppetObject
13
+
14
+ def self.from_hash(i12n)
15
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::PopsObject initializer', _pcore_type.i12n_type, i12n))
16
+ end
17
+
18
+ def self.from_asserted_hash(i12n)
19
+ new
20
+ end
21
+
22
+ def self.create
23
+ new
24
+ end
25
+ attr_reader :hash
26
+
27
+ def initialize
28
+ @hash = -1052386662549381418
29
+ end
30
+ def _pcore_init_hash
31
+ {}
32
+ end
33
+
34
+ def _pcore_contents
35
+ end
36
+
37
+ def _pcore_all_contents(path)
38
+ end
39
+
40
+ def to_s
41
+ Types::TypeFormatter.string(self)
42
+ end
43
+
44
+ def eql?(o)
45
+ o.instance_of?(self.class)
46
+ end
47
+ alias == eql?
48
+ end
49
+
50
+ class Positioned < PopsObject
51
+ def self._pcore_type
52
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::Positioned', {
53
+ 'parent' => PopsObject._pcore_type,
54
+ 'attributes' => {
55
+ 'locator' => {
56
+ 'type' => Parser::Locator::Locator19._pcore_type,
57
+ 'kind' => 'reference'
58
+ },
59
+ 'offset' => Types::PIntegerType::DEFAULT,
60
+ 'length' => Types::PIntegerType::DEFAULT,
61
+ 'file' => {
62
+ 'type' => Types::PStringType::DEFAULT,
63
+ 'kind' => 'derived'
64
+ },
65
+ 'line' => {
66
+ 'type' => Types::PIntegerType::DEFAULT,
67
+ 'kind' => 'derived'
68
+ },
69
+ 'pos' => {
70
+ 'type' => Types::PIntegerType::DEFAULT,
71
+ 'kind' => 'derived'
72
+ }
73
+ },
74
+ 'equality' => []
75
+ })
76
+ end
77
+
78
+ def self.from_hash(i12n)
79
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::Positioned initializer', _pcore_type.i12n_type, i12n))
80
+ end
81
+
82
+ def self.from_asserted_hash(i12n)
83
+ new(
84
+ i12n['locator'],
85
+ i12n['offset'],
86
+ i12n['length'])
87
+ end
88
+
89
+ def self.create(locator, offset, length)
90
+ ta = Types::TypeAsserter
91
+ attrs = _pcore_type.attributes(true)
92
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
93
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
94
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
95
+ new(locator, offset, length)
96
+ end
97
+
98
+ attr_reader :locator
99
+ attr_reader :offset
100
+ attr_reader :length
101
+
102
+ def file
103
+ @locator.file
104
+ end
105
+
106
+ def line
107
+ @locator.line_for_offset(@offset)
108
+ end
109
+
110
+ def pos
111
+ @locator.pos_on_line(@offset)
112
+ end
113
+
114
+ def initialize(locator, offset, length)
115
+ super()
116
+ @locator = locator
117
+ @offset = offset
118
+ @length = length
119
+ end
120
+
121
+ def _pcore_init_hash
122
+ result = super
123
+ result['locator'] = @locator
124
+ result['offset'] = @offset
125
+ result['length'] = @length
126
+ result
127
+ end
128
+ end
129
+
130
+ class Expression < Positioned
131
+ def self._pcore_type
132
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::Expression', {
133
+ 'parent' => Positioned._pcore_type
134
+ })
135
+ end
136
+ end
137
+
138
+ class Nop < Expression
139
+ def self._pcore_type
140
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::Nop', {
141
+ 'parent' => Expression._pcore_type
142
+ })
143
+ end
144
+ end
145
+
146
+ class BinaryExpression < Expression
147
+ def self._pcore_type
148
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::BinaryExpression', {
149
+ 'parent' => Expression._pcore_type,
150
+ 'attributes' => {
151
+ 'left_expr' => Expression._pcore_type,
152
+ 'right_expr' => Expression._pcore_type
153
+ }
154
+ })
155
+ end
156
+
157
+ def self.from_hash(i12n)
158
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::BinaryExpression initializer', _pcore_type.i12n_type, i12n))
159
+ end
160
+
161
+ def self.from_asserted_hash(i12n)
162
+ new(
163
+ i12n['locator'],
164
+ i12n['offset'],
165
+ i12n['length'],
166
+ i12n['left_expr'],
167
+ i12n['right_expr'])
168
+ end
169
+
170
+ def self.create(locator, offset, length, left_expr, right_expr)
171
+ ta = Types::TypeAsserter
172
+ attrs = _pcore_type.attributes(true)
173
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
174
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
175
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
176
+ ta.assert_instance_of('Puppet::AST::BinaryExpression[left_expr]', attrs['left_expr'].type, left_expr)
177
+ ta.assert_instance_of('Puppet::AST::BinaryExpression[right_expr]', attrs['right_expr'].type, right_expr)
178
+ new(locator, offset, length, left_expr, right_expr)
179
+ end
180
+
181
+ attr_reader :left_expr
182
+ attr_reader :right_expr
183
+
184
+ def initialize(locator, offset, length, left_expr, right_expr)
185
+ super(locator, offset, length)
186
+ @hash = @hash ^ left_expr.hash ^ right_expr.hash
187
+ @left_expr = left_expr
188
+ @right_expr = right_expr
189
+ end
190
+
191
+ def _pcore_init_hash
192
+ result = super
193
+ result['left_expr'] = @left_expr
194
+ result['right_expr'] = @right_expr
195
+ result
196
+ end
197
+
198
+ def _pcore_contents
199
+ yield(@left_expr) unless @left_expr.nil?
200
+ yield(@right_expr) unless @right_expr.nil?
201
+ end
202
+
203
+ def _pcore_all_contents(path, &block)
204
+ path << self
205
+ unless @left_expr.nil?
206
+ block.call(@left_expr, path)
207
+ @left_expr._pcore_all_contents(path, &block)
208
+ end
209
+ unless @right_expr.nil?
210
+ block.call(@right_expr, path)
211
+ @right_expr._pcore_all_contents(path, &block)
212
+ end
213
+ path.pop
214
+ end
215
+
216
+ def eql?(o)
217
+ super &&
218
+ @left_expr.eql?(o.left_expr) &&
219
+ @right_expr.eql?(o.right_expr)
220
+ end
221
+ alias == eql?
222
+ end
223
+
224
+ class UnaryExpression < Expression
225
+ def self._pcore_type
226
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::UnaryExpression', {
227
+ 'parent' => Expression._pcore_type,
228
+ 'attributes' => {
229
+ 'expr' => Expression._pcore_type
230
+ }
231
+ })
232
+ end
233
+
234
+ def self.from_hash(i12n)
235
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::UnaryExpression initializer', _pcore_type.i12n_type, i12n))
236
+ end
237
+
238
+ def self.from_asserted_hash(i12n)
239
+ new(
240
+ i12n['locator'],
241
+ i12n['offset'],
242
+ i12n['length'],
243
+ i12n['expr'])
244
+ end
245
+
246
+ def self.create(locator, offset, length, expr)
247
+ ta = Types::TypeAsserter
248
+ attrs = _pcore_type.attributes(true)
249
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
250
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
251
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
252
+ ta.assert_instance_of('Puppet::AST::UnaryExpression[expr]', attrs['expr'].type, expr)
253
+ new(locator, offset, length, expr)
254
+ end
255
+
256
+ attr_reader :expr
257
+
258
+ def initialize(locator, offset, length, expr)
259
+ super(locator, offset, length)
260
+ @hash = @hash ^ expr.hash
261
+ @expr = expr
262
+ end
263
+
264
+ def _pcore_init_hash
265
+ result = super
266
+ result['expr'] = @expr
267
+ result
268
+ end
269
+
270
+ def _pcore_contents
271
+ yield(@expr) unless @expr.nil?
272
+ end
273
+
274
+ def _pcore_all_contents(path, &block)
275
+ path << self
276
+ unless @expr.nil?
277
+ block.call(@expr, path)
278
+ @expr._pcore_all_contents(path, &block)
279
+ end
280
+ path.pop
281
+ end
282
+
283
+ def eql?(o)
284
+ super &&
285
+ @expr.eql?(o.expr)
286
+ end
287
+ alias == eql?
288
+ end
289
+
290
+ class ParenthesizedExpression < UnaryExpression
291
+ def self._pcore_type
292
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ParenthesizedExpression', {
293
+ 'parent' => UnaryExpression._pcore_type
294
+ })
295
+ end
296
+
297
+ def _pcore_contents
298
+ yield(@expr) unless @expr.nil?
299
+ end
300
+
301
+ def _pcore_all_contents(path, &block)
302
+ path << self
303
+ unless @expr.nil?
304
+ block.call(@expr, path)
305
+ @expr._pcore_all_contents(path, &block)
306
+ end
307
+ path.pop
308
+ end
309
+ end
310
+
311
+ class NotExpression < UnaryExpression
312
+ def self._pcore_type
313
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::NotExpression', {
314
+ 'parent' => UnaryExpression._pcore_type
315
+ })
316
+ end
317
+
318
+ def _pcore_contents
319
+ yield(@expr) unless @expr.nil?
320
+ end
321
+
322
+ def _pcore_all_contents(path, &block)
323
+ path << self
324
+ unless @expr.nil?
325
+ block.call(@expr, path)
326
+ @expr._pcore_all_contents(path, &block)
327
+ end
328
+ path.pop
329
+ end
330
+ end
331
+
332
+ class UnaryMinusExpression < UnaryExpression
333
+ def self._pcore_type
334
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::UnaryMinusExpression', {
335
+ 'parent' => UnaryExpression._pcore_type
336
+ })
337
+ end
338
+
339
+ def _pcore_contents
340
+ yield(@expr) unless @expr.nil?
341
+ end
342
+
343
+ def _pcore_all_contents(path, &block)
344
+ path << self
345
+ unless @expr.nil?
346
+ block.call(@expr, path)
347
+ @expr._pcore_all_contents(path, &block)
348
+ end
349
+ path.pop
350
+ end
351
+ end
352
+
353
+ class UnfoldExpression < UnaryExpression
354
+ def self._pcore_type
355
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::UnfoldExpression', {
356
+ 'parent' => UnaryExpression._pcore_type
357
+ })
358
+ end
359
+
360
+ def _pcore_contents
361
+ yield(@expr) unless @expr.nil?
362
+ end
363
+
364
+ def _pcore_all_contents(path, &block)
365
+ path << self
366
+ unless @expr.nil?
367
+ block.call(@expr, path)
368
+ @expr._pcore_all_contents(path, &block)
369
+ end
370
+ path.pop
371
+ end
372
+ end
373
+
374
+ class AssignmentExpression < BinaryExpression
375
+ def self._pcore_type
376
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::AssignmentExpression', {
377
+ 'parent' => BinaryExpression._pcore_type,
378
+ 'attributes' => {
379
+ 'operator' => Types::PEnumType.new(['+=', '-=', '='])
380
+ }
381
+ })
382
+ end
383
+
384
+ def self.from_hash(i12n)
385
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::AssignmentExpression initializer', _pcore_type.i12n_type, i12n))
386
+ end
387
+
388
+ def self.from_asserted_hash(i12n)
389
+ new(
390
+ i12n['locator'],
391
+ i12n['offset'],
392
+ i12n['length'],
393
+ i12n['left_expr'],
394
+ i12n['right_expr'],
395
+ i12n['operator'])
396
+ end
397
+
398
+ def self.create(locator, offset, length, left_expr, right_expr, operator)
399
+ ta = Types::TypeAsserter
400
+ attrs = _pcore_type.attributes(true)
401
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
402
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
403
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
404
+ ta.assert_instance_of('Puppet::AST::BinaryExpression[left_expr]', attrs['left_expr'].type, left_expr)
405
+ ta.assert_instance_of('Puppet::AST::BinaryExpression[right_expr]', attrs['right_expr'].type, right_expr)
406
+ ta.assert_instance_of('Puppet::AST::AssignmentExpression[operator]', attrs['operator'].type, operator)
407
+ new(locator, offset, length, left_expr, right_expr, operator)
408
+ end
409
+
410
+ attr_reader :operator
411
+
412
+ def initialize(locator, offset, length, left_expr, right_expr, operator)
413
+ super(locator, offset, length, left_expr, right_expr)
414
+ @hash = @hash ^ operator.hash
415
+ @operator = operator
416
+ end
417
+
418
+ def _pcore_init_hash
419
+ result = super
420
+ result['operator'] = @operator
421
+ result
422
+ end
423
+
424
+ def _pcore_contents
425
+ yield(@left_expr) unless @left_expr.nil?
426
+ yield(@right_expr) unless @right_expr.nil?
427
+ end
428
+
429
+ def _pcore_all_contents(path, &block)
430
+ path << self
431
+ unless @left_expr.nil?
432
+ block.call(@left_expr, path)
433
+ @left_expr._pcore_all_contents(path, &block)
434
+ end
435
+ unless @right_expr.nil?
436
+ block.call(@right_expr, path)
437
+ @right_expr._pcore_all_contents(path, &block)
438
+ end
439
+ path.pop
440
+ end
441
+
442
+ def eql?(o)
443
+ super &&
444
+ @operator.eql?(o.operator)
445
+ end
446
+ alias == eql?
447
+ end
448
+
449
+ class ArithmeticExpression < BinaryExpression
450
+ def self._pcore_type
451
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ArithmeticExpression', {
452
+ 'parent' => BinaryExpression._pcore_type,
453
+ 'attributes' => {
454
+ 'operator' => Types::PEnumType.new(['%', '*', '+', '-', '/', '<<', '>>'])
455
+ }
456
+ })
457
+ end
458
+
459
+ def self.from_hash(i12n)
460
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::ArithmeticExpression initializer', _pcore_type.i12n_type, i12n))
461
+ end
462
+
463
+ def self.from_asserted_hash(i12n)
464
+ new(
465
+ i12n['locator'],
466
+ i12n['offset'],
467
+ i12n['length'],
468
+ i12n['left_expr'],
469
+ i12n['right_expr'],
470
+ i12n['operator'])
471
+ end
472
+
473
+ def self.create(locator, offset, length, left_expr, right_expr, operator)
474
+ ta = Types::TypeAsserter
475
+ attrs = _pcore_type.attributes(true)
476
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
477
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
478
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
479
+ ta.assert_instance_of('Puppet::AST::BinaryExpression[left_expr]', attrs['left_expr'].type, left_expr)
480
+ ta.assert_instance_of('Puppet::AST::BinaryExpression[right_expr]', attrs['right_expr'].type, right_expr)
481
+ ta.assert_instance_of('Puppet::AST::ArithmeticExpression[operator]', attrs['operator'].type, operator)
482
+ new(locator, offset, length, left_expr, right_expr, operator)
483
+ end
484
+
485
+ attr_reader :operator
486
+
487
+ def initialize(locator, offset, length, left_expr, right_expr, operator)
488
+ super(locator, offset, length, left_expr, right_expr)
489
+ @hash = @hash ^ operator.hash
490
+ @operator = operator
491
+ end
492
+
493
+ def _pcore_init_hash
494
+ result = super
495
+ result['operator'] = @operator
496
+ result
497
+ end
498
+
499
+ def _pcore_contents
500
+ yield(@left_expr) unless @left_expr.nil?
501
+ yield(@right_expr) unless @right_expr.nil?
502
+ end
503
+
504
+ def _pcore_all_contents(path, &block)
505
+ path << self
506
+ unless @left_expr.nil?
507
+ block.call(@left_expr, path)
508
+ @left_expr._pcore_all_contents(path, &block)
509
+ end
510
+ unless @right_expr.nil?
511
+ block.call(@right_expr, path)
512
+ @right_expr._pcore_all_contents(path, &block)
513
+ end
514
+ path.pop
515
+ end
516
+
517
+ def eql?(o)
518
+ super &&
519
+ @operator.eql?(o.operator)
520
+ end
521
+ alias == eql?
522
+ end
523
+
524
+ class RelationshipExpression < BinaryExpression
525
+ def self._pcore_type
526
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::RelationshipExpression', {
527
+ 'parent' => BinaryExpression._pcore_type,
528
+ 'attributes' => {
529
+ 'operator' => Types::PEnumType.new(['->', '<-', '<~', '~>'])
530
+ }
531
+ })
532
+ end
533
+
534
+ def self.from_hash(i12n)
535
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::RelationshipExpression initializer', _pcore_type.i12n_type, i12n))
536
+ end
537
+
538
+ def self.from_asserted_hash(i12n)
539
+ new(
540
+ i12n['locator'],
541
+ i12n['offset'],
542
+ i12n['length'],
543
+ i12n['left_expr'],
544
+ i12n['right_expr'],
545
+ i12n['operator'])
546
+ end
547
+
548
+ def self.create(locator, offset, length, left_expr, right_expr, operator)
549
+ ta = Types::TypeAsserter
550
+ attrs = _pcore_type.attributes(true)
551
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
552
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
553
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
554
+ ta.assert_instance_of('Puppet::AST::BinaryExpression[left_expr]', attrs['left_expr'].type, left_expr)
555
+ ta.assert_instance_of('Puppet::AST::BinaryExpression[right_expr]', attrs['right_expr'].type, right_expr)
556
+ ta.assert_instance_of('Puppet::AST::RelationshipExpression[operator]', attrs['operator'].type, operator)
557
+ new(locator, offset, length, left_expr, right_expr, operator)
558
+ end
559
+
560
+ attr_reader :operator
561
+
562
+ def initialize(locator, offset, length, left_expr, right_expr, operator)
563
+ super(locator, offset, length, left_expr, right_expr)
564
+ @hash = @hash ^ operator.hash
565
+ @operator = operator
566
+ end
567
+
568
+ def _pcore_init_hash
569
+ result = super
570
+ result['operator'] = @operator
571
+ result
572
+ end
573
+
574
+ def _pcore_contents
575
+ yield(@left_expr) unless @left_expr.nil?
576
+ yield(@right_expr) unless @right_expr.nil?
577
+ end
578
+
579
+ def _pcore_all_contents(path, &block)
580
+ path << self
581
+ unless @left_expr.nil?
582
+ block.call(@left_expr, path)
583
+ @left_expr._pcore_all_contents(path, &block)
584
+ end
585
+ unless @right_expr.nil?
586
+ block.call(@right_expr, path)
587
+ @right_expr._pcore_all_contents(path, &block)
588
+ end
589
+ path.pop
590
+ end
591
+
592
+ def eql?(o)
593
+ super &&
594
+ @operator.eql?(o.operator)
595
+ end
596
+ alias == eql?
597
+ end
598
+
599
+ class AccessExpression < Expression
600
+ def self._pcore_type
601
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::AccessExpression', {
602
+ 'parent' => Expression._pcore_type,
603
+ 'attributes' => {
604
+ 'left_expr' => Expression._pcore_type,
605
+ 'keys' => {
606
+ 'type' => Types::PArrayType.new(Expression._pcore_type),
607
+ 'value' => []
608
+ }
609
+ }
610
+ })
611
+ end
612
+
613
+ def self.from_hash(i12n)
614
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::AccessExpression initializer', _pcore_type.i12n_type, i12n))
615
+ end
616
+
617
+ def self.from_asserted_hash(i12n)
618
+ new(
619
+ i12n['locator'],
620
+ i12n['offset'],
621
+ i12n['length'],
622
+ i12n['left_expr'],
623
+ i12n.fetch('keys') { _pcore_type['keys'].value })
624
+ end
625
+
626
+ def self.create(locator, offset, length, left_expr, keys = _pcore_type['keys'].value)
627
+ ta = Types::TypeAsserter
628
+ attrs = _pcore_type.attributes(true)
629
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
630
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
631
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
632
+ ta.assert_instance_of('Puppet::AST::AccessExpression[left_expr]', attrs['left_expr'].type, left_expr)
633
+ ta.assert_instance_of('Puppet::AST::AccessExpression[keys]', attrs['keys'].type, keys)
634
+ new(locator, offset, length, left_expr, keys)
635
+ end
636
+
637
+ attr_reader :left_expr
638
+ attr_reader :keys
639
+
640
+ def initialize(locator, offset, length, left_expr, keys = _pcore_type['keys'].value)
641
+ super(locator, offset, length)
642
+ @hash = @hash ^ left_expr.hash ^ keys.hash
643
+ @left_expr = left_expr
644
+ @keys = keys
645
+ end
646
+
647
+ def _pcore_init_hash
648
+ result = super
649
+ result['left_expr'] = @left_expr
650
+ result['keys'] = @keys unless _pcore_type['keys'].default_value?(@keys)
651
+ result
652
+ end
653
+
654
+ def _pcore_contents
655
+ yield(@left_expr) unless @left_expr.nil?
656
+ @keys.each { |value| yield(value) }
657
+ end
658
+
659
+ def _pcore_all_contents(path, &block)
660
+ path << self
661
+ unless @left_expr.nil?
662
+ block.call(@left_expr, path)
663
+ @left_expr._pcore_all_contents(path, &block)
664
+ end
665
+ @keys.each do |value|
666
+ block.call(value, path)
667
+ value._pcore_all_contents(path, &block)
668
+ end
669
+ path.pop
670
+ end
671
+
672
+ def eql?(o)
673
+ super &&
674
+ @left_expr.eql?(o.left_expr) &&
675
+ @keys.eql?(o.keys)
676
+ end
677
+ alias == eql?
678
+ end
679
+
680
+ class ComparisonExpression < BinaryExpression
681
+ def self._pcore_type
682
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ComparisonExpression', {
683
+ 'parent' => BinaryExpression._pcore_type,
684
+ 'attributes' => {
685
+ 'operator' => Types::PEnumType.new(['!=', '<', '<=', '==', '>', '>='])
686
+ }
687
+ })
688
+ end
689
+
690
+ def self.from_hash(i12n)
691
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::ComparisonExpression initializer', _pcore_type.i12n_type, i12n))
692
+ end
693
+
694
+ def self.from_asserted_hash(i12n)
695
+ new(
696
+ i12n['locator'],
697
+ i12n['offset'],
698
+ i12n['length'],
699
+ i12n['left_expr'],
700
+ i12n['right_expr'],
701
+ i12n['operator'])
702
+ end
703
+
704
+ def self.create(locator, offset, length, left_expr, right_expr, operator)
705
+ ta = Types::TypeAsserter
706
+ attrs = _pcore_type.attributes(true)
707
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
708
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
709
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
710
+ ta.assert_instance_of('Puppet::AST::BinaryExpression[left_expr]', attrs['left_expr'].type, left_expr)
711
+ ta.assert_instance_of('Puppet::AST::BinaryExpression[right_expr]', attrs['right_expr'].type, right_expr)
712
+ ta.assert_instance_of('Puppet::AST::ComparisonExpression[operator]', attrs['operator'].type, operator)
713
+ new(locator, offset, length, left_expr, right_expr, operator)
714
+ end
715
+
716
+ attr_reader :operator
717
+
718
+ def initialize(locator, offset, length, left_expr, right_expr, operator)
719
+ super(locator, offset, length, left_expr, right_expr)
720
+ @hash = @hash ^ operator.hash
721
+ @operator = operator
722
+ end
723
+
724
+ def _pcore_init_hash
725
+ result = super
726
+ result['operator'] = @operator
727
+ result
728
+ end
729
+
730
+ def _pcore_contents
731
+ yield(@left_expr) unless @left_expr.nil?
732
+ yield(@right_expr) unless @right_expr.nil?
733
+ end
734
+
735
+ def _pcore_all_contents(path, &block)
736
+ path << self
737
+ unless @left_expr.nil?
738
+ block.call(@left_expr, path)
739
+ @left_expr._pcore_all_contents(path, &block)
740
+ end
741
+ unless @right_expr.nil?
742
+ block.call(@right_expr, path)
743
+ @right_expr._pcore_all_contents(path, &block)
744
+ end
745
+ path.pop
746
+ end
747
+
748
+ def eql?(o)
749
+ super &&
750
+ @operator.eql?(o.operator)
751
+ end
752
+ alias == eql?
753
+ end
754
+
755
+ class MatchExpression < BinaryExpression
756
+ def self._pcore_type
757
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::MatchExpression', {
758
+ 'parent' => BinaryExpression._pcore_type,
759
+ 'attributes' => {
760
+ 'operator' => Types::PEnumType.new(['!~', '=~'])
761
+ }
762
+ })
763
+ end
764
+
765
+ def self.from_hash(i12n)
766
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::MatchExpression initializer', _pcore_type.i12n_type, i12n))
767
+ end
768
+
769
+ def self.from_asserted_hash(i12n)
770
+ new(
771
+ i12n['locator'],
772
+ i12n['offset'],
773
+ i12n['length'],
774
+ i12n['left_expr'],
775
+ i12n['right_expr'],
776
+ i12n['operator'])
777
+ end
778
+
779
+ def self.create(locator, offset, length, left_expr, right_expr, operator)
780
+ ta = Types::TypeAsserter
781
+ attrs = _pcore_type.attributes(true)
782
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
783
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
784
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
785
+ ta.assert_instance_of('Puppet::AST::BinaryExpression[left_expr]', attrs['left_expr'].type, left_expr)
786
+ ta.assert_instance_of('Puppet::AST::BinaryExpression[right_expr]', attrs['right_expr'].type, right_expr)
787
+ ta.assert_instance_of('Puppet::AST::MatchExpression[operator]', attrs['operator'].type, operator)
788
+ new(locator, offset, length, left_expr, right_expr, operator)
789
+ end
790
+
791
+ attr_reader :operator
792
+
793
+ def initialize(locator, offset, length, left_expr, right_expr, operator)
794
+ super(locator, offset, length, left_expr, right_expr)
795
+ @hash = @hash ^ operator.hash
796
+ @operator = operator
797
+ end
798
+
799
+ def _pcore_init_hash
800
+ result = super
801
+ result['operator'] = @operator
802
+ result
803
+ end
804
+
805
+ def _pcore_contents
806
+ yield(@left_expr) unless @left_expr.nil?
807
+ yield(@right_expr) unless @right_expr.nil?
808
+ end
809
+
810
+ def _pcore_all_contents(path, &block)
811
+ path << self
812
+ unless @left_expr.nil?
813
+ block.call(@left_expr, path)
814
+ @left_expr._pcore_all_contents(path, &block)
815
+ end
816
+ unless @right_expr.nil?
817
+ block.call(@right_expr, path)
818
+ @right_expr._pcore_all_contents(path, &block)
819
+ end
820
+ path.pop
821
+ end
822
+
823
+ def eql?(o)
824
+ super &&
825
+ @operator.eql?(o.operator)
826
+ end
827
+ alias == eql?
828
+ end
829
+
830
+ class InExpression < BinaryExpression
831
+ def self._pcore_type
832
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::InExpression', {
833
+ 'parent' => BinaryExpression._pcore_type
834
+ })
835
+ end
836
+
837
+ def _pcore_contents
838
+ yield(@left_expr) unless @left_expr.nil?
839
+ yield(@right_expr) unless @right_expr.nil?
840
+ end
841
+
842
+ def _pcore_all_contents(path, &block)
843
+ path << self
844
+ unless @left_expr.nil?
845
+ block.call(@left_expr, path)
846
+ @left_expr._pcore_all_contents(path, &block)
847
+ end
848
+ unless @right_expr.nil?
849
+ block.call(@right_expr, path)
850
+ @right_expr._pcore_all_contents(path, &block)
851
+ end
852
+ path.pop
853
+ end
854
+ end
855
+
856
+ class BooleanExpression < BinaryExpression
857
+ def self._pcore_type
858
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::BooleanExpression', {
859
+ 'parent' => BinaryExpression._pcore_type
860
+ })
861
+ end
862
+
863
+ def _pcore_contents
864
+ yield(@left_expr) unless @left_expr.nil?
865
+ yield(@right_expr) unless @right_expr.nil?
866
+ end
867
+
868
+ def _pcore_all_contents(path, &block)
869
+ path << self
870
+ unless @left_expr.nil?
871
+ block.call(@left_expr, path)
872
+ @left_expr._pcore_all_contents(path, &block)
873
+ end
874
+ unless @right_expr.nil?
875
+ block.call(@right_expr, path)
876
+ @right_expr._pcore_all_contents(path, &block)
877
+ end
878
+ path.pop
879
+ end
880
+ end
881
+
882
+ class AndExpression < BooleanExpression
883
+ def self._pcore_type
884
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::AndExpression', {
885
+ 'parent' => BooleanExpression._pcore_type
886
+ })
887
+ end
888
+
889
+ def _pcore_contents
890
+ yield(@left_expr) unless @left_expr.nil?
891
+ yield(@right_expr) unless @right_expr.nil?
892
+ end
893
+
894
+ def _pcore_all_contents(path, &block)
895
+ path << self
896
+ unless @left_expr.nil?
897
+ block.call(@left_expr, path)
898
+ @left_expr._pcore_all_contents(path, &block)
899
+ end
900
+ unless @right_expr.nil?
901
+ block.call(@right_expr, path)
902
+ @right_expr._pcore_all_contents(path, &block)
903
+ end
904
+ path.pop
905
+ end
906
+ end
907
+
908
+ class OrExpression < BooleanExpression
909
+ def self._pcore_type
910
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::OrExpression', {
911
+ 'parent' => BooleanExpression._pcore_type
912
+ })
913
+ end
914
+
915
+ def _pcore_contents
916
+ yield(@left_expr) unless @left_expr.nil?
917
+ yield(@right_expr) unless @right_expr.nil?
918
+ end
919
+
920
+ def _pcore_all_contents(path, &block)
921
+ path << self
922
+ unless @left_expr.nil?
923
+ block.call(@left_expr, path)
924
+ @left_expr._pcore_all_contents(path, &block)
925
+ end
926
+ unless @right_expr.nil?
927
+ block.call(@right_expr, path)
928
+ @right_expr._pcore_all_contents(path, &block)
929
+ end
930
+ path.pop
931
+ end
932
+ end
933
+
934
+ class LiteralList < Expression
935
+ def self._pcore_type
936
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LiteralList', {
937
+ 'parent' => Expression._pcore_type,
938
+ 'attributes' => {
939
+ 'values' => {
940
+ 'type' => Types::PArrayType.new(Expression._pcore_type),
941
+ 'value' => []
942
+ }
943
+ }
944
+ })
945
+ end
946
+
947
+ def self.from_hash(i12n)
948
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::LiteralList initializer', _pcore_type.i12n_type, i12n))
949
+ end
950
+
951
+ def self.from_asserted_hash(i12n)
952
+ new(
953
+ i12n['locator'],
954
+ i12n['offset'],
955
+ i12n['length'],
956
+ i12n.fetch('values') { _pcore_type['values'].value })
957
+ end
958
+
959
+ def self.create(locator, offset, length, values = _pcore_type['values'].value)
960
+ ta = Types::TypeAsserter
961
+ attrs = _pcore_type.attributes(true)
962
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
963
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
964
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
965
+ ta.assert_instance_of('Puppet::AST::LiteralList[values]', attrs['values'].type, values)
966
+ new(locator, offset, length, values)
967
+ end
968
+
969
+ attr_reader :values
970
+
971
+ def initialize(locator, offset, length, values = _pcore_type['values'].value)
972
+ super(locator, offset, length)
973
+ @hash = @hash ^ values.hash
974
+ @values = values
975
+ end
976
+
977
+ def _pcore_init_hash
978
+ result = super
979
+ result['values'] = @values unless _pcore_type['values'].default_value?(@values)
980
+ result
981
+ end
982
+
983
+ def _pcore_contents
984
+ @values.each { |value| yield(value) }
985
+ end
986
+
987
+ def _pcore_all_contents(path, &block)
988
+ path << self
989
+ @values.each do |value|
990
+ block.call(value, path)
991
+ value._pcore_all_contents(path, &block)
992
+ end
993
+ path.pop
994
+ end
995
+
996
+ def eql?(o)
997
+ super &&
998
+ @values.eql?(o.values)
999
+ end
1000
+ alias == eql?
1001
+ end
1002
+
1003
+ class KeyedEntry < Positioned
1004
+ def self._pcore_type
1005
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::KeyedEntry', {
1006
+ 'parent' => Positioned._pcore_type,
1007
+ 'attributes' => {
1008
+ 'key' => Expression._pcore_type,
1009
+ 'value' => Expression._pcore_type
1010
+ }
1011
+ })
1012
+ end
1013
+
1014
+ def self.from_hash(i12n)
1015
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::KeyedEntry initializer', _pcore_type.i12n_type, i12n))
1016
+ end
1017
+
1018
+ def self.from_asserted_hash(i12n)
1019
+ new(
1020
+ i12n['locator'],
1021
+ i12n['offset'],
1022
+ i12n['length'],
1023
+ i12n['key'],
1024
+ i12n['value'])
1025
+ end
1026
+
1027
+ def self.create(locator, offset, length, key, value)
1028
+ ta = Types::TypeAsserter
1029
+ attrs = _pcore_type.attributes(true)
1030
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
1031
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
1032
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
1033
+ ta.assert_instance_of('Puppet::AST::KeyedEntry[key]', attrs['key'].type, key)
1034
+ ta.assert_instance_of('Puppet::AST::KeyedEntry[value]', attrs['value'].type, value)
1035
+ new(locator, offset, length, key, value)
1036
+ end
1037
+
1038
+ attr_reader :key
1039
+ attr_reader :value
1040
+
1041
+ def initialize(locator, offset, length, key, value)
1042
+ super(locator, offset, length)
1043
+ @hash = @hash ^ key.hash ^ value.hash
1044
+ @key = key
1045
+ @value = value
1046
+ end
1047
+
1048
+ def _pcore_init_hash
1049
+ result = super
1050
+ result['key'] = @key
1051
+ result['value'] = @value
1052
+ result
1053
+ end
1054
+
1055
+ def _pcore_contents
1056
+ yield(@key) unless @key.nil?
1057
+ yield(@value) unless @value.nil?
1058
+ end
1059
+
1060
+ def _pcore_all_contents(path, &block)
1061
+ path << self
1062
+ unless @key.nil?
1063
+ block.call(@key, path)
1064
+ @key._pcore_all_contents(path, &block)
1065
+ end
1066
+ unless @value.nil?
1067
+ block.call(@value, path)
1068
+ @value._pcore_all_contents(path, &block)
1069
+ end
1070
+ path.pop
1071
+ end
1072
+
1073
+ def eql?(o)
1074
+ super &&
1075
+ @key.eql?(o.key) &&
1076
+ @value.eql?(o.value)
1077
+ end
1078
+ alias == eql?
1079
+ end
1080
+
1081
+ class LiteralHash < Expression
1082
+ def self._pcore_type
1083
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LiteralHash', {
1084
+ 'parent' => Expression._pcore_type,
1085
+ 'attributes' => {
1086
+ 'entries' => {
1087
+ 'type' => Types::PArrayType.new(KeyedEntry._pcore_type),
1088
+ 'value' => []
1089
+ }
1090
+ }
1091
+ })
1092
+ end
1093
+
1094
+ def self.from_hash(i12n)
1095
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::LiteralHash initializer', _pcore_type.i12n_type, i12n))
1096
+ end
1097
+
1098
+ def self.from_asserted_hash(i12n)
1099
+ new(
1100
+ i12n['locator'],
1101
+ i12n['offset'],
1102
+ i12n['length'],
1103
+ i12n.fetch('entries') { _pcore_type['entries'].value })
1104
+ end
1105
+
1106
+ def self.create(locator, offset, length, entries = _pcore_type['entries'].value)
1107
+ ta = Types::TypeAsserter
1108
+ attrs = _pcore_type.attributes(true)
1109
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
1110
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
1111
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
1112
+ ta.assert_instance_of('Puppet::AST::LiteralHash[entries]', attrs['entries'].type, entries)
1113
+ new(locator, offset, length, entries)
1114
+ end
1115
+
1116
+ attr_reader :entries
1117
+
1118
+ def initialize(locator, offset, length, entries = _pcore_type['entries'].value)
1119
+ super(locator, offset, length)
1120
+ @hash = @hash ^ entries.hash
1121
+ @entries = entries
1122
+ end
1123
+
1124
+ def _pcore_init_hash
1125
+ result = super
1126
+ result['entries'] = @entries unless _pcore_type['entries'].default_value?(@entries)
1127
+ result
1128
+ end
1129
+
1130
+ def _pcore_contents
1131
+ @entries.each { |value| yield(value) }
1132
+ end
1133
+
1134
+ def _pcore_all_contents(path, &block)
1135
+ path << self
1136
+ @entries.each do |value|
1137
+ block.call(value, path)
1138
+ value._pcore_all_contents(path, &block)
1139
+ end
1140
+ path.pop
1141
+ end
1142
+
1143
+ def eql?(o)
1144
+ super &&
1145
+ @entries.eql?(o.entries)
1146
+ end
1147
+ alias == eql?
1148
+ end
1149
+
1150
+ class BlockExpression < Expression
1151
+ def self._pcore_type
1152
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::BlockExpression', {
1153
+ 'parent' => Expression._pcore_type,
1154
+ 'attributes' => {
1155
+ 'statements' => {
1156
+ 'type' => Types::PArrayType.new(Expression._pcore_type),
1157
+ 'value' => []
1158
+ }
1159
+ }
1160
+ })
1161
+ end
1162
+
1163
+ def self.from_hash(i12n)
1164
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::BlockExpression initializer', _pcore_type.i12n_type, i12n))
1165
+ end
1166
+
1167
+ def self.from_asserted_hash(i12n)
1168
+ new(
1169
+ i12n['locator'],
1170
+ i12n['offset'],
1171
+ i12n['length'],
1172
+ i12n.fetch('statements') { _pcore_type['statements'].value })
1173
+ end
1174
+
1175
+ def self.create(locator, offset, length, statements = _pcore_type['statements'].value)
1176
+ ta = Types::TypeAsserter
1177
+ attrs = _pcore_type.attributes(true)
1178
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
1179
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
1180
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
1181
+ ta.assert_instance_of('Puppet::AST::BlockExpression[statements]', attrs['statements'].type, statements)
1182
+ new(locator, offset, length, statements)
1183
+ end
1184
+
1185
+ attr_reader :statements
1186
+
1187
+ def initialize(locator, offset, length, statements = _pcore_type['statements'].value)
1188
+ super(locator, offset, length)
1189
+ @hash = @hash ^ statements.hash
1190
+ @statements = statements
1191
+ end
1192
+
1193
+ def _pcore_init_hash
1194
+ result = super
1195
+ result['statements'] = @statements unless _pcore_type['statements'].default_value?(@statements)
1196
+ result
1197
+ end
1198
+
1199
+ def _pcore_contents
1200
+ @statements.each { |value| yield(value) }
1201
+ end
1202
+
1203
+ def _pcore_all_contents(path, &block)
1204
+ path << self
1205
+ @statements.each do |value|
1206
+ block.call(value, path)
1207
+ value._pcore_all_contents(path, &block)
1208
+ end
1209
+ path.pop
1210
+ end
1211
+
1212
+ def eql?(o)
1213
+ super &&
1214
+ @statements.eql?(o.statements)
1215
+ end
1216
+ alias == eql?
1217
+ end
1218
+
1219
+ class CaseOption < Expression
1220
+ def self._pcore_type
1221
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::CaseOption', {
1222
+ 'parent' => Expression._pcore_type,
1223
+ 'attributes' => {
1224
+ 'values' => Types::PArrayType.new(Expression._pcore_type, Types::PCollectionType::NOT_EMPTY_SIZE),
1225
+ 'then_expr' => {
1226
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
1227
+ 'value' => nil
1228
+ }
1229
+ }
1230
+ })
1231
+ end
1232
+
1233
+ def self.from_hash(i12n)
1234
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::CaseOption initializer', _pcore_type.i12n_type, i12n))
1235
+ end
1236
+
1237
+ def self.from_asserted_hash(i12n)
1238
+ new(
1239
+ i12n['locator'],
1240
+ i12n['offset'],
1241
+ i12n['length'],
1242
+ i12n['values'],
1243
+ i12n['then_expr'])
1244
+ end
1245
+
1246
+ def self.create(locator, offset, length, values, then_expr = nil)
1247
+ ta = Types::TypeAsserter
1248
+ attrs = _pcore_type.attributes(true)
1249
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
1250
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
1251
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
1252
+ ta.assert_instance_of('Puppet::AST::CaseOption[values]', attrs['values'].type, values)
1253
+ ta.assert_instance_of('Puppet::AST::CaseOption[then_expr]', attrs['then_expr'].type, then_expr)
1254
+ new(locator, offset, length, values, then_expr)
1255
+ end
1256
+
1257
+ attr_reader :values
1258
+ attr_reader :then_expr
1259
+
1260
+ def initialize(locator, offset, length, values, then_expr = nil)
1261
+ super(locator, offset, length)
1262
+ @hash = @hash ^ values.hash ^ then_expr.hash
1263
+ @values = values
1264
+ @then_expr = then_expr
1265
+ end
1266
+
1267
+ def _pcore_init_hash
1268
+ result = super
1269
+ result['values'] = @values
1270
+ result['then_expr'] = @then_expr unless @then_expr == nil
1271
+ result
1272
+ end
1273
+
1274
+ def _pcore_contents
1275
+ @values.each { |value| yield(value) }
1276
+ yield(@then_expr) unless @then_expr.nil?
1277
+ end
1278
+
1279
+ def _pcore_all_contents(path, &block)
1280
+ path << self
1281
+ @values.each do |value|
1282
+ block.call(value, path)
1283
+ value._pcore_all_contents(path, &block)
1284
+ end
1285
+ unless @then_expr.nil?
1286
+ block.call(@then_expr, path)
1287
+ @then_expr._pcore_all_contents(path, &block)
1288
+ end
1289
+ path.pop
1290
+ end
1291
+
1292
+ def eql?(o)
1293
+ super &&
1294
+ @values.eql?(o.values) &&
1295
+ @then_expr.eql?(o.then_expr)
1296
+ end
1297
+ alias == eql?
1298
+ end
1299
+
1300
+ class CaseExpression < Expression
1301
+ def self._pcore_type
1302
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::CaseExpression', {
1303
+ 'parent' => Expression._pcore_type,
1304
+ 'attributes' => {
1305
+ 'test' => Expression._pcore_type,
1306
+ 'options' => {
1307
+ 'type' => Types::PArrayType.new(CaseOption._pcore_type),
1308
+ 'value' => []
1309
+ }
1310
+ }
1311
+ })
1312
+ end
1313
+
1314
+ def self.from_hash(i12n)
1315
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::CaseExpression initializer', _pcore_type.i12n_type, i12n))
1316
+ end
1317
+
1318
+ def self.from_asserted_hash(i12n)
1319
+ new(
1320
+ i12n['locator'],
1321
+ i12n['offset'],
1322
+ i12n['length'],
1323
+ i12n['test'],
1324
+ i12n.fetch('options') { _pcore_type['options'].value })
1325
+ end
1326
+
1327
+ def self.create(locator, offset, length, test, options = _pcore_type['options'].value)
1328
+ ta = Types::TypeAsserter
1329
+ attrs = _pcore_type.attributes(true)
1330
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
1331
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
1332
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
1333
+ ta.assert_instance_of('Puppet::AST::CaseExpression[test]', attrs['test'].type, test)
1334
+ ta.assert_instance_of('Puppet::AST::CaseExpression[options]', attrs['options'].type, options)
1335
+ new(locator, offset, length, test, options)
1336
+ end
1337
+
1338
+ attr_reader :test
1339
+ attr_reader :options
1340
+
1341
+ def initialize(locator, offset, length, test, options = _pcore_type['options'].value)
1342
+ super(locator, offset, length)
1343
+ @hash = @hash ^ test.hash ^ options.hash
1344
+ @test = test
1345
+ @options = options
1346
+ end
1347
+
1348
+ def _pcore_init_hash
1349
+ result = super
1350
+ result['test'] = @test
1351
+ result['options'] = @options unless _pcore_type['options'].default_value?(@options)
1352
+ result
1353
+ end
1354
+
1355
+ def _pcore_contents
1356
+ yield(@test) unless @test.nil?
1357
+ @options.each { |value| yield(value) }
1358
+ end
1359
+
1360
+ def _pcore_all_contents(path, &block)
1361
+ path << self
1362
+ unless @test.nil?
1363
+ block.call(@test, path)
1364
+ @test._pcore_all_contents(path, &block)
1365
+ end
1366
+ @options.each do |value|
1367
+ block.call(value, path)
1368
+ value._pcore_all_contents(path, &block)
1369
+ end
1370
+ path.pop
1371
+ end
1372
+
1373
+ def eql?(o)
1374
+ super &&
1375
+ @test.eql?(o.test) &&
1376
+ @options.eql?(o.options)
1377
+ end
1378
+ alias == eql?
1379
+ end
1380
+
1381
+ class QueryExpression < Expression
1382
+ def self._pcore_type
1383
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::QueryExpression', {
1384
+ 'parent' => Expression._pcore_type,
1385
+ 'attributes' => {
1386
+ 'expr' => {
1387
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
1388
+ 'value' => nil
1389
+ }
1390
+ }
1391
+ })
1392
+ end
1393
+
1394
+ def self.from_hash(i12n)
1395
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::QueryExpression initializer', _pcore_type.i12n_type, i12n))
1396
+ end
1397
+
1398
+ def self.from_asserted_hash(i12n)
1399
+ new(
1400
+ i12n['locator'],
1401
+ i12n['offset'],
1402
+ i12n['length'],
1403
+ i12n['expr'])
1404
+ end
1405
+
1406
+ def self.create(locator, offset, length, expr = nil)
1407
+ ta = Types::TypeAsserter
1408
+ attrs = _pcore_type.attributes(true)
1409
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
1410
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
1411
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
1412
+ ta.assert_instance_of('Puppet::AST::QueryExpression[expr]', attrs['expr'].type, expr)
1413
+ new(locator, offset, length, expr)
1414
+ end
1415
+
1416
+ attr_reader :expr
1417
+
1418
+ def initialize(locator, offset, length, expr = nil)
1419
+ super(locator, offset, length)
1420
+ @hash = @hash ^ expr.hash
1421
+ @expr = expr
1422
+ end
1423
+
1424
+ def _pcore_init_hash
1425
+ result = super
1426
+ result['expr'] = @expr unless @expr == nil
1427
+ result
1428
+ end
1429
+
1430
+ def _pcore_contents
1431
+ yield(@expr) unless @expr.nil?
1432
+ end
1433
+
1434
+ def _pcore_all_contents(path, &block)
1435
+ path << self
1436
+ unless @expr.nil?
1437
+ block.call(@expr, path)
1438
+ @expr._pcore_all_contents(path, &block)
1439
+ end
1440
+ path.pop
1441
+ end
1442
+
1443
+ def eql?(o)
1444
+ super &&
1445
+ @expr.eql?(o.expr)
1446
+ end
1447
+ alias == eql?
1448
+ end
1449
+
1450
+ class ExportedQuery < QueryExpression
1451
+ def self._pcore_type
1452
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ExportedQuery', {
1453
+ 'parent' => QueryExpression._pcore_type
1454
+ })
1455
+ end
1456
+
1457
+ def _pcore_contents
1458
+ yield(@expr) unless @expr.nil?
1459
+ end
1460
+
1461
+ def _pcore_all_contents(path, &block)
1462
+ path << self
1463
+ unless @expr.nil?
1464
+ block.call(@expr, path)
1465
+ @expr._pcore_all_contents(path, &block)
1466
+ end
1467
+ path.pop
1468
+ end
1469
+ end
1470
+
1471
+ class VirtualQuery < QueryExpression
1472
+ def self._pcore_type
1473
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::VirtualQuery', {
1474
+ 'parent' => QueryExpression._pcore_type
1475
+ })
1476
+ end
1477
+
1478
+ def _pcore_contents
1479
+ yield(@expr) unless @expr.nil?
1480
+ end
1481
+
1482
+ def _pcore_all_contents(path, &block)
1483
+ path << self
1484
+ unless @expr.nil?
1485
+ block.call(@expr, path)
1486
+ @expr._pcore_all_contents(path, &block)
1487
+ end
1488
+ path.pop
1489
+ end
1490
+ end
1491
+
1492
+ class AbstractAttributeOperation < Positioned
1493
+ def self._pcore_type
1494
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::AbstractAttributeOperation', {
1495
+ 'parent' => Positioned._pcore_type
1496
+ })
1497
+ end
1498
+ end
1499
+
1500
+ class AttributeOperation < AbstractAttributeOperation
1501
+ def self._pcore_type
1502
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::AttributeOperation', {
1503
+ 'parent' => AbstractAttributeOperation._pcore_type,
1504
+ 'attributes' => {
1505
+ 'attribute_name' => Types::PStringType::DEFAULT,
1506
+ 'operator' => Types::PEnumType.new(['+>', '=>']),
1507
+ 'value_expr' => Expression._pcore_type
1508
+ }
1509
+ })
1510
+ end
1511
+
1512
+ def self.from_hash(i12n)
1513
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::AttributeOperation initializer', _pcore_type.i12n_type, i12n))
1514
+ end
1515
+
1516
+ def self.from_asserted_hash(i12n)
1517
+ new(
1518
+ i12n['locator'],
1519
+ i12n['offset'],
1520
+ i12n['length'],
1521
+ i12n['attribute_name'],
1522
+ i12n['operator'],
1523
+ i12n['value_expr'])
1524
+ end
1525
+
1526
+ def self.create(locator, offset, length, attribute_name, operator, value_expr)
1527
+ ta = Types::TypeAsserter
1528
+ attrs = _pcore_type.attributes(true)
1529
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
1530
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
1531
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
1532
+ ta.assert_instance_of('Puppet::AST::AttributeOperation[attribute_name]', attrs['attribute_name'].type, attribute_name)
1533
+ ta.assert_instance_of('Puppet::AST::AttributeOperation[operator]', attrs['operator'].type, operator)
1534
+ ta.assert_instance_of('Puppet::AST::AttributeOperation[value_expr]', attrs['value_expr'].type, value_expr)
1535
+ new(locator, offset, length, attribute_name, operator, value_expr)
1536
+ end
1537
+
1538
+ attr_reader :attribute_name
1539
+ attr_reader :operator
1540
+ attr_reader :value_expr
1541
+
1542
+ def initialize(locator, offset, length, attribute_name, operator, value_expr)
1543
+ super(locator, offset, length)
1544
+ @hash = @hash ^ attribute_name.hash ^ operator.hash ^ value_expr.hash
1545
+ @attribute_name = attribute_name
1546
+ @operator = operator
1547
+ @value_expr = value_expr
1548
+ end
1549
+
1550
+ def _pcore_init_hash
1551
+ result = super
1552
+ result['attribute_name'] = @attribute_name
1553
+ result['operator'] = @operator
1554
+ result['value_expr'] = @value_expr
1555
+ result
1556
+ end
1557
+
1558
+ def _pcore_contents
1559
+ yield(@value_expr) unless @value_expr.nil?
1560
+ end
1561
+
1562
+ def _pcore_all_contents(path, &block)
1563
+ path << self
1564
+ unless @value_expr.nil?
1565
+ block.call(@value_expr, path)
1566
+ @value_expr._pcore_all_contents(path, &block)
1567
+ end
1568
+ path.pop
1569
+ end
1570
+
1571
+ def eql?(o)
1572
+ super &&
1573
+ @attribute_name.eql?(o.attribute_name) &&
1574
+ @operator.eql?(o.operator) &&
1575
+ @value_expr.eql?(o.value_expr)
1576
+ end
1577
+ alias == eql?
1578
+ end
1579
+
1580
+ class AttributesOperation < AbstractAttributeOperation
1581
+ def self._pcore_type
1582
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::AttributesOperation', {
1583
+ 'parent' => AbstractAttributeOperation._pcore_type,
1584
+ 'attributes' => {
1585
+ 'expr' => Expression._pcore_type
1586
+ }
1587
+ })
1588
+ end
1589
+
1590
+ def self.from_hash(i12n)
1591
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::AttributesOperation initializer', _pcore_type.i12n_type, i12n))
1592
+ end
1593
+
1594
+ def self.from_asserted_hash(i12n)
1595
+ new(
1596
+ i12n['locator'],
1597
+ i12n['offset'],
1598
+ i12n['length'],
1599
+ i12n['expr'])
1600
+ end
1601
+
1602
+ def self.create(locator, offset, length, expr)
1603
+ ta = Types::TypeAsserter
1604
+ attrs = _pcore_type.attributes(true)
1605
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
1606
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
1607
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
1608
+ ta.assert_instance_of('Puppet::AST::AttributesOperation[expr]', attrs['expr'].type, expr)
1609
+ new(locator, offset, length, expr)
1610
+ end
1611
+
1612
+ attr_reader :expr
1613
+
1614
+ def initialize(locator, offset, length, expr)
1615
+ super(locator, offset, length)
1616
+ @hash = @hash ^ expr.hash
1617
+ @expr = expr
1618
+ end
1619
+
1620
+ def _pcore_init_hash
1621
+ result = super
1622
+ result['expr'] = @expr
1623
+ result
1624
+ end
1625
+
1626
+ def _pcore_contents
1627
+ yield(@expr) unless @expr.nil?
1628
+ end
1629
+
1630
+ def _pcore_all_contents(path, &block)
1631
+ path << self
1632
+ unless @expr.nil?
1633
+ block.call(@expr, path)
1634
+ @expr._pcore_all_contents(path, &block)
1635
+ end
1636
+ path.pop
1637
+ end
1638
+
1639
+ def eql?(o)
1640
+ super &&
1641
+ @expr.eql?(o.expr)
1642
+ end
1643
+ alias == eql?
1644
+ end
1645
+
1646
+ class CollectExpression < Expression
1647
+ def self._pcore_type
1648
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::CollectExpression', {
1649
+ 'parent' => Expression._pcore_type,
1650
+ 'attributes' => {
1651
+ 'type_expr' => Expression._pcore_type,
1652
+ 'query' => QueryExpression._pcore_type,
1653
+ 'operations' => {
1654
+ 'type' => Types::PArrayType.new(AbstractAttributeOperation._pcore_type),
1655
+ 'value' => []
1656
+ }
1657
+ }
1658
+ })
1659
+ end
1660
+
1661
+ def self.from_hash(i12n)
1662
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::CollectExpression initializer', _pcore_type.i12n_type, i12n))
1663
+ end
1664
+
1665
+ def self.from_asserted_hash(i12n)
1666
+ new(
1667
+ i12n['locator'],
1668
+ i12n['offset'],
1669
+ i12n['length'],
1670
+ i12n['type_expr'],
1671
+ i12n['query'],
1672
+ i12n.fetch('operations') { _pcore_type['operations'].value })
1673
+ end
1674
+
1675
+ def self.create(locator, offset, length, type_expr, query, operations = _pcore_type['operations'].value)
1676
+ ta = Types::TypeAsserter
1677
+ attrs = _pcore_type.attributes(true)
1678
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
1679
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
1680
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
1681
+ ta.assert_instance_of('Puppet::AST::CollectExpression[type_expr]', attrs['type_expr'].type, type_expr)
1682
+ ta.assert_instance_of('Puppet::AST::CollectExpression[query]', attrs['query'].type, query)
1683
+ ta.assert_instance_of('Puppet::AST::CollectExpression[operations]', attrs['operations'].type, operations)
1684
+ new(locator, offset, length, type_expr, query, operations)
1685
+ end
1686
+
1687
+ attr_reader :type_expr
1688
+ attr_reader :query
1689
+ attr_reader :operations
1690
+
1691
+ def initialize(locator, offset, length, type_expr, query, operations = _pcore_type['operations'].value)
1692
+ super(locator, offset, length)
1693
+ @hash = @hash ^ type_expr.hash ^ query.hash ^ operations.hash
1694
+ @type_expr = type_expr
1695
+ @query = query
1696
+ @operations = operations
1697
+ end
1698
+
1699
+ def _pcore_init_hash
1700
+ result = super
1701
+ result['type_expr'] = @type_expr
1702
+ result['query'] = @query
1703
+ result['operations'] = @operations unless _pcore_type['operations'].default_value?(@operations)
1704
+ result
1705
+ end
1706
+
1707
+ def _pcore_contents
1708
+ yield(@type_expr) unless @type_expr.nil?
1709
+ yield(@query) unless @query.nil?
1710
+ @operations.each { |value| yield(value) }
1711
+ end
1712
+
1713
+ def _pcore_all_contents(path, &block)
1714
+ path << self
1715
+ unless @type_expr.nil?
1716
+ block.call(@type_expr, path)
1717
+ @type_expr._pcore_all_contents(path, &block)
1718
+ end
1719
+ unless @query.nil?
1720
+ block.call(@query, path)
1721
+ @query._pcore_all_contents(path, &block)
1722
+ end
1723
+ @operations.each do |value|
1724
+ block.call(value, path)
1725
+ value._pcore_all_contents(path, &block)
1726
+ end
1727
+ path.pop
1728
+ end
1729
+
1730
+ def eql?(o)
1731
+ super &&
1732
+ @type_expr.eql?(o.type_expr) &&
1733
+ @query.eql?(o.query) &&
1734
+ @operations.eql?(o.operations)
1735
+ end
1736
+ alias == eql?
1737
+ end
1738
+
1739
+ class Parameter < Positioned
1740
+ def self._pcore_type
1741
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::Parameter', {
1742
+ 'parent' => Positioned._pcore_type,
1743
+ 'attributes' => {
1744
+ 'name' => Types::PStringType::DEFAULT,
1745
+ 'value' => {
1746
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
1747
+ 'value' => nil
1748
+ },
1749
+ 'type_expr' => {
1750
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
1751
+ 'value' => nil
1752
+ },
1753
+ 'captures_rest' => {
1754
+ 'type' => Types::POptionalType.new(Types::PBooleanType::DEFAULT),
1755
+ 'value' => nil
1756
+ }
1757
+ }
1758
+ })
1759
+ end
1760
+
1761
+ def self.from_hash(i12n)
1762
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::Parameter initializer', _pcore_type.i12n_type, i12n))
1763
+ end
1764
+
1765
+ def self.from_asserted_hash(i12n)
1766
+ new(
1767
+ i12n['locator'],
1768
+ i12n['offset'],
1769
+ i12n['length'],
1770
+ i12n['name'],
1771
+ i12n['value'],
1772
+ i12n['type_expr'],
1773
+ i12n['captures_rest'])
1774
+ end
1775
+
1776
+ def self.create(locator, offset, length, name, value = nil, type_expr = nil, captures_rest = nil)
1777
+ ta = Types::TypeAsserter
1778
+ attrs = _pcore_type.attributes(true)
1779
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
1780
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
1781
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
1782
+ ta.assert_instance_of('Puppet::AST::Parameter[name]', attrs['name'].type, name)
1783
+ ta.assert_instance_of('Puppet::AST::Parameter[value]', attrs['value'].type, value)
1784
+ ta.assert_instance_of('Puppet::AST::Parameter[type_expr]', attrs['type_expr'].type, type_expr)
1785
+ ta.assert_instance_of('Puppet::AST::Parameter[captures_rest]', attrs['captures_rest'].type, captures_rest)
1786
+ new(locator, offset, length, name, value, type_expr, captures_rest)
1787
+ end
1788
+
1789
+ attr_reader :name
1790
+ attr_reader :value
1791
+ attr_reader :type_expr
1792
+ attr_reader :captures_rest
1793
+
1794
+ def initialize(locator, offset, length, name, value = nil, type_expr = nil, captures_rest = nil)
1795
+ super(locator, offset, length)
1796
+ @hash = @hash ^ name.hash ^ value.hash ^ type_expr.hash ^ captures_rest.hash
1797
+ @name = name
1798
+ @value = value
1799
+ @type_expr = type_expr
1800
+ @captures_rest = captures_rest
1801
+ end
1802
+
1803
+ def _pcore_init_hash
1804
+ result = super
1805
+ result['name'] = @name
1806
+ result['value'] = @value unless @value == nil
1807
+ result['type_expr'] = @type_expr unless @type_expr == nil
1808
+ result['captures_rest'] = @captures_rest unless @captures_rest == nil
1809
+ result
1810
+ end
1811
+
1812
+ def _pcore_contents
1813
+ yield(@value) unless @value.nil?
1814
+ yield(@type_expr) unless @type_expr.nil?
1815
+ end
1816
+
1817
+ def _pcore_all_contents(path, &block)
1818
+ path << self
1819
+ unless @value.nil?
1820
+ block.call(@value, path)
1821
+ @value._pcore_all_contents(path, &block)
1822
+ end
1823
+ unless @type_expr.nil?
1824
+ block.call(@type_expr, path)
1825
+ @type_expr._pcore_all_contents(path, &block)
1826
+ end
1827
+ path.pop
1828
+ end
1829
+
1830
+ def eql?(o)
1831
+ super &&
1832
+ @name.eql?(o.name) &&
1833
+ @value.eql?(o.value) &&
1834
+ @type_expr.eql?(o.type_expr) &&
1835
+ @captures_rest.eql?(o.captures_rest)
1836
+ end
1837
+ alias == eql?
1838
+ end
1839
+
1840
+ class Definition < Expression
1841
+ def self._pcore_type
1842
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::Definition', {
1843
+ 'parent' => Expression._pcore_type
1844
+ })
1845
+ end
1846
+ end
1847
+
1848
+ class NamedDefinition < Definition
1849
+ def self._pcore_type
1850
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::NamedDefinition', {
1851
+ 'parent' => Definition._pcore_type,
1852
+ 'attributes' => {
1853
+ 'name' => Types::PStringType::DEFAULT,
1854
+ 'parameters' => {
1855
+ 'type' => Types::PArrayType.new(Parameter._pcore_type),
1856
+ 'value' => []
1857
+ },
1858
+ 'body' => {
1859
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
1860
+ 'value' => nil
1861
+ }
1862
+ }
1863
+ })
1864
+ end
1865
+
1866
+ def self.from_hash(i12n)
1867
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::NamedDefinition initializer', _pcore_type.i12n_type, i12n))
1868
+ end
1869
+
1870
+ def self.from_asserted_hash(i12n)
1871
+ new(
1872
+ i12n['locator'],
1873
+ i12n['offset'],
1874
+ i12n['length'],
1875
+ i12n['name'],
1876
+ i12n.fetch('parameters') { _pcore_type['parameters'].value },
1877
+ i12n['body'])
1878
+ end
1879
+
1880
+ def self.create(locator, offset, length, name, parameters = _pcore_type['parameters'].value, body = nil)
1881
+ ta = Types::TypeAsserter
1882
+ attrs = _pcore_type.attributes(true)
1883
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
1884
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
1885
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
1886
+ ta.assert_instance_of('Puppet::AST::NamedDefinition[name]', attrs['name'].type, name)
1887
+ ta.assert_instance_of('Puppet::AST::NamedDefinition[parameters]', attrs['parameters'].type, parameters)
1888
+ ta.assert_instance_of('Puppet::AST::NamedDefinition[body]', attrs['body'].type, body)
1889
+ new(locator, offset, length, name, parameters, body)
1890
+ end
1891
+
1892
+ attr_reader :name
1893
+ attr_reader :parameters
1894
+ attr_reader :body
1895
+
1896
+ def initialize(locator, offset, length, name, parameters = _pcore_type['parameters'].value, body = nil)
1897
+ super(locator, offset, length)
1898
+ @hash = @hash ^ name.hash ^ parameters.hash ^ body.hash
1899
+ @name = name
1900
+ @parameters = parameters
1901
+ @body = body
1902
+ end
1903
+
1904
+ def _pcore_init_hash
1905
+ result = super
1906
+ result['name'] = @name
1907
+ result['parameters'] = @parameters unless _pcore_type['parameters'].default_value?(@parameters)
1908
+ result['body'] = @body unless @body == nil
1909
+ result
1910
+ end
1911
+
1912
+ def _pcore_contents
1913
+ @parameters.each { |value| yield(value) }
1914
+ yield(@body) unless @body.nil?
1915
+ end
1916
+
1917
+ def _pcore_all_contents(path, &block)
1918
+ path << self
1919
+ @parameters.each do |value|
1920
+ block.call(value, path)
1921
+ value._pcore_all_contents(path, &block)
1922
+ end
1923
+ unless @body.nil?
1924
+ block.call(@body, path)
1925
+ @body._pcore_all_contents(path, &block)
1926
+ end
1927
+ path.pop
1928
+ end
1929
+
1930
+ def eql?(o)
1931
+ super &&
1932
+ @name.eql?(o.name) &&
1933
+ @parameters.eql?(o.parameters) &&
1934
+ @body.eql?(o.body)
1935
+ end
1936
+ alias == eql?
1937
+ end
1938
+
1939
+ class FunctionDefinition < NamedDefinition
1940
+ def self._pcore_type
1941
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::FunctionDefinition', {
1942
+ 'parent' => NamedDefinition._pcore_type,
1943
+ 'attributes' => {
1944
+ 'return_type' => {
1945
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
1946
+ 'value' => nil
1947
+ }
1948
+ }
1949
+ })
1950
+ end
1951
+
1952
+ def self.from_hash(i12n)
1953
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::FunctionDefinition initializer', _pcore_type.i12n_type, i12n))
1954
+ end
1955
+
1956
+ def self.from_asserted_hash(i12n)
1957
+ new(
1958
+ i12n['locator'],
1959
+ i12n['offset'],
1960
+ i12n['length'],
1961
+ i12n['name'],
1962
+ i12n.fetch('parameters') { _pcore_type['parameters'].value },
1963
+ i12n['body'],
1964
+ i12n['return_type'])
1965
+ end
1966
+
1967
+ def self.create(locator, offset, length, name, parameters = _pcore_type['parameters'].value, body = nil, return_type = nil)
1968
+ ta = Types::TypeAsserter
1969
+ attrs = _pcore_type.attributes(true)
1970
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
1971
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
1972
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
1973
+ ta.assert_instance_of('Puppet::AST::NamedDefinition[name]', attrs['name'].type, name)
1974
+ ta.assert_instance_of('Puppet::AST::NamedDefinition[parameters]', attrs['parameters'].type, parameters)
1975
+ ta.assert_instance_of('Puppet::AST::NamedDefinition[body]', attrs['body'].type, body)
1976
+ ta.assert_instance_of('Puppet::AST::FunctionDefinition[return_type]', attrs['return_type'].type, return_type)
1977
+ new(locator, offset, length, name, parameters, body, return_type)
1978
+ end
1979
+
1980
+ attr_reader :return_type
1981
+
1982
+ def initialize(locator, offset, length, name, parameters = _pcore_type['parameters'].value, body = nil, return_type = nil)
1983
+ super(locator, offset, length, name, parameters, body)
1984
+ @hash = @hash ^ return_type.hash
1985
+ @return_type = return_type
1986
+ end
1987
+
1988
+ def _pcore_init_hash
1989
+ result = super
1990
+ result['return_type'] = @return_type unless @return_type == nil
1991
+ result
1992
+ end
1993
+
1994
+ def _pcore_contents
1995
+ @parameters.each { |value| yield(value) }
1996
+ yield(@body) unless @body.nil?
1997
+ yield(@return_type) unless @return_type.nil?
1998
+ end
1999
+
2000
+ def _pcore_all_contents(path, &block)
2001
+ path << self
2002
+ @parameters.each do |value|
2003
+ block.call(value, path)
2004
+ value._pcore_all_contents(path, &block)
2005
+ end
2006
+ unless @body.nil?
2007
+ block.call(@body, path)
2008
+ @body._pcore_all_contents(path, &block)
2009
+ end
2010
+ unless @return_type.nil?
2011
+ block.call(@return_type, path)
2012
+ @return_type._pcore_all_contents(path, &block)
2013
+ end
2014
+ path.pop
2015
+ end
2016
+
2017
+ def eql?(o)
2018
+ super &&
2019
+ @return_type.eql?(o.return_type)
2020
+ end
2021
+ alias == eql?
2022
+ end
2023
+
2024
+ class ResourceTypeDefinition < NamedDefinition
2025
+ def self._pcore_type
2026
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ResourceTypeDefinition', {
2027
+ 'parent' => NamedDefinition._pcore_type
2028
+ })
2029
+ end
2030
+
2031
+ def _pcore_contents
2032
+ @parameters.each { |value| yield(value) }
2033
+ yield(@body) unless @body.nil?
2034
+ end
2035
+
2036
+ def _pcore_all_contents(path, &block)
2037
+ path << self
2038
+ @parameters.each do |value|
2039
+ block.call(value, path)
2040
+ value._pcore_all_contents(path, &block)
2041
+ end
2042
+ unless @body.nil?
2043
+ block.call(@body, path)
2044
+ @body._pcore_all_contents(path, &block)
2045
+ end
2046
+ path.pop
2047
+ end
2048
+ end
2049
+
2050
+ class Application < NamedDefinition
2051
+ def self._pcore_type
2052
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::Application', {
2053
+ 'parent' => NamedDefinition._pcore_type
2054
+ })
2055
+ end
2056
+
2057
+ def _pcore_contents
2058
+ @parameters.each { |value| yield(value) }
2059
+ yield(@body) unless @body.nil?
2060
+ end
2061
+
2062
+ def _pcore_all_contents(path, &block)
2063
+ path << self
2064
+ @parameters.each do |value|
2065
+ block.call(value, path)
2066
+ value._pcore_all_contents(path, &block)
2067
+ end
2068
+ unless @body.nil?
2069
+ block.call(@body, path)
2070
+ @body._pcore_all_contents(path, &block)
2071
+ end
2072
+ path.pop
2073
+ end
2074
+ end
2075
+
2076
+ class QRefDefinition < Definition
2077
+ def self._pcore_type
2078
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::QRefDefinition', {
2079
+ 'parent' => Definition._pcore_type,
2080
+ 'attributes' => {
2081
+ 'name' => Types::PStringType::DEFAULT
2082
+ }
2083
+ })
2084
+ end
2085
+
2086
+ def self.from_hash(i12n)
2087
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::QRefDefinition initializer', _pcore_type.i12n_type, i12n))
2088
+ end
2089
+
2090
+ def self.from_asserted_hash(i12n)
2091
+ new(
2092
+ i12n['locator'],
2093
+ i12n['offset'],
2094
+ i12n['length'],
2095
+ i12n['name'])
2096
+ end
2097
+
2098
+ def self.create(locator, offset, length, name)
2099
+ ta = Types::TypeAsserter
2100
+ attrs = _pcore_type.attributes(true)
2101
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
2102
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
2103
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
2104
+ ta.assert_instance_of('Puppet::AST::QRefDefinition[name]', attrs['name'].type, name)
2105
+ new(locator, offset, length, name)
2106
+ end
2107
+
2108
+ attr_reader :name
2109
+
2110
+ def initialize(locator, offset, length, name)
2111
+ super(locator, offset, length)
2112
+ @hash = @hash ^ name.hash
2113
+ @name = name
2114
+ end
2115
+
2116
+ def _pcore_init_hash
2117
+ result = super
2118
+ result['name'] = @name
2119
+ result
2120
+ end
2121
+
2122
+ def eql?(o)
2123
+ super &&
2124
+ @name.eql?(o.name)
2125
+ end
2126
+ alias == eql?
2127
+ end
2128
+
2129
+ class TypeAlias < QRefDefinition
2130
+ def self._pcore_type
2131
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::TypeAlias', {
2132
+ 'parent' => QRefDefinition._pcore_type,
2133
+ 'attributes' => {
2134
+ 'type_expr' => {
2135
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
2136
+ 'value' => nil
2137
+ }
2138
+ }
2139
+ })
2140
+ end
2141
+
2142
+ def self.from_hash(i12n)
2143
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::TypeAlias initializer', _pcore_type.i12n_type, i12n))
2144
+ end
2145
+
2146
+ def self.from_asserted_hash(i12n)
2147
+ new(
2148
+ i12n['locator'],
2149
+ i12n['offset'],
2150
+ i12n['length'],
2151
+ i12n['name'],
2152
+ i12n['type_expr'])
2153
+ end
2154
+
2155
+ def self.create(locator, offset, length, name, type_expr = nil)
2156
+ ta = Types::TypeAsserter
2157
+ attrs = _pcore_type.attributes(true)
2158
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
2159
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
2160
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
2161
+ ta.assert_instance_of('Puppet::AST::QRefDefinition[name]', attrs['name'].type, name)
2162
+ ta.assert_instance_of('Puppet::AST::TypeAlias[type_expr]', attrs['type_expr'].type, type_expr)
2163
+ new(locator, offset, length, name, type_expr)
2164
+ end
2165
+
2166
+ attr_reader :type_expr
2167
+
2168
+ def initialize(locator, offset, length, name, type_expr = nil)
2169
+ super(locator, offset, length, name)
2170
+ @hash = @hash ^ type_expr.hash
2171
+ @type_expr = type_expr
2172
+ end
2173
+
2174
+ def _pcore_init_hash
2175
+ result = super
2176
+ result['type_expr'] = @type_expr unless @type_expr == nil
2177
+ result
2178
+ end
2179
+
2180
+ def _pcore_contents
2181
+ yield(@type_expr) unless @type_expr.nil?
2182
+ end
2183
+
2184
+ def _pcore_all_contents(path, &block)
2185
+ path << self
2186
+ unless @type_expr.nil?
2187
+ block.call(@type_expr, path)
2188
+ @type_expr._pcore_all_contents(path, &block)
2189
+ end
2190
+ path.pop
2191
+ end
2192
+
2193
+ def eql?(o)
2194
+ super &&
2195
+ @type_expr.eql?(o.type_expr)
2196
+ end
2197
+ alias == eql?
2198
+ end
2199
+
2200
+ class TypeMapping < Definition
2201
+ def self._pcore_type
2202
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::TypeMapping', {
2203
+ 'parent' => Definition._pcore_type,
2204
+ 'attributes' => {
2205
+ 'type_expr' => {
2206
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
2207
+ 'value' => nil
2208
+ },
2209
+ 'mapping_expr' => {
2210
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
2211
+ 'value' => nil
2212
+ }
2213
+ }
2214
+ })
2215
+ end
2216
+
2217
+ def self.from_hash(i12n)
2218
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::TypeMapping initializer', _pcore_type.i12n_type, i12n))
2219
+ end
2220
+
2221
+ def self.from_asserted_hash(i12n)
2222
+ new(
2223
+ i12n['locator'],
2224
+ i12n['offset'],
2225
+ i12n['length'],
2226
+ i12n['type_expr'],
2227
+ i12n['mapping_expr'])
2228
+ end
2229
+
2230
+ def self.create(locator, offset, length, type_expr = nil, mapping_expr = nil)
2231
+ ta = Types::TypeAsserter
2232
+ attrs = _pcore_type.attributes(true)
2233
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
2234
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
2235
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
2236
+ ta.assert_instance_of('Puppet::AST::TypeMapping[type_expr]', attrs['type_expr'].type, type_expr)
2237
+ ta.assert_instance_of('Puppet::AST::TypeMapping[mapping_expr]', attrs['mapping_expr'].type, mapping_expr)
2238
+ new(locator, offset, length, type_expr, mapping_expr)
2239
+ end
2240
+
2241
+ attr_reader :type_expr
2242
+ attr_reader :mapping_expr
2243
+
2244
+ def initialize(locator, offset, length, type_expr = nil, mapping_expr = nil)
2245
+ super(locator, offset, length)
2246
+ @hash = @hash ^ type_expr.hash ^ mapping_expr.hash
2247
+ @type_expr = type_expr
2248
+ @mapping_expr = mapping_expr
2249
+ end
2250
+
2251
+ def _pcore_init_hash
2252
+ result = super
2253
+ result['type_expr'] = @type_expr unless @type_expr == nil
2254
+ result['mapping_expr'] = @mapping_expr unless @mapping_expr == nil
2255
+ result
2256
+ end
2257
+
2258
+ def _pcore_contents
2259
+ yield(@type_expr) unless @type_expr.nil?
2260
+ yield(@mapping_expr) unless @mapping_expr.nil?
2261
+ end
2262
+
2263
+ def _pcore_all_contents(path, &block)
2264
+ path << self
2265
+ unless @type_expr.nil?
2266
+ block.call(@type_expr, path)
2267
+ @type_expr._pcore_all_contents(path, &block)
2268
+ end
2269
+ unless @mapping_expr.nil?
2270
+ block.call(@mapping_expr, path)
2271
+ @mapping_expr._pcore_all_contents(path, &block)
2272
+ end
2273
+ path.pop
2274
+ end
2275
+
2276
+ def eql?(o)
2277
+ super &&
2278
+ @type_expr.eql?(o.type_expr) &&
2279
+ @mapping_expr.eql?(o.mapping_expr)
2280
+ end
2281
+ alias == eql?
2282
+ end
2283
+
2284
+ class TypeDefinition < QRefDefinition
2285
+ def self._pcore_type
2286
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::TypeDefinition', {
2287
+ 'parent' => QRefDefinition._pcore_type,
2288
+ 'attributes' => {
2289
+ 'parent' => {
2290
+ 'type' => Types::POptionalType.new(Types::PStringType::DEFAULT),
2291
+ 'value' => nil
2292
+ },
2293
+ 'body' => {
2294
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
2295
+ 'value' => nil
2296
+ }
2297
+ }
2298
+ })
2299
+ end
2300
+
2301
+ def self.from_hash(i12n)
2302
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::TypeDefinition initializer', _pcore_type.i12n_type, i12n))
2303
+ end
2304
+
2305
+ def self.from_asserted_hash(i12n)
2306
+ new(
2307
+ i12n['locator'],
2308
+ i12n['offset'],
2309
+ i12n['length'],
2310
+ i12n['name'],
2311
+ i12n['parent'],
2312
+ i12n['body'])
2313
+ end
2314
+
2315
+ def self.create(locator, offset, length, name, parent = nil, body = nil)
2316
+ ta = Types::TypeAsserter
2317
+ attrs = _pcore_type.attributes(true)
2318
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
2319
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
2320
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
2321
+ ta.assert_instance_of('Puppet::AST::QRefDefinition[name]', attrs['name'].type, name)
2322
+ ta.assert_instance_of('Puppet::AST::TypeDefinition[parent]', attrs['parent'].type, parent)
2323
+ ta.assert_instance_of('Puppet::AST::TypeDefinition[body]', attrs['body'].type, body)
2324
+ new(locator, offset, length, name, parent, body)
2325
+ end
2326
+
2327
+ attr_reader :parent
2328
+ attr_reader :body
2329
+
2330
+ def initialize(locator, offset, length, name, parent = nil, body = nil)
2331
+ super(locator, offset, length, name)
2332
+ @hash = @hash ^ parent.hash ^ body.hash
2333
+ @parent = parent
2334
+ @body = body
2335
+ end
2336
+
2337
+ def _pcore_init_hash
2338
+ result = super
2339
+ result['parent'] = @parent unless @parent == nil
2340
+ result['body'] = @body unless @body == nil
2341
+ result
2342
+ end
2343
+
2344
+ def _pcore_contents
2345
+ yield(@body) unless @body.nil?
2346
+ end
2347
+
2348
+ def _pcore_all_contents(path, &block)
2349
+ path << self
2350
+ unless @body.nil?
2351
+ block.call(@body, path)
2352
+ @body._pcore_all_contents(path, &block)
2353
+ end
2354
+ path.pop
2355
+ end
2356
+
2357
+ def eql?(o)
2358
+ super &&
2359
+ @parent.eql?(o.parent) &&
2360
+ @body.eql?(o.body)
2361
+ end
2362
+ alias == eql?
2363
+ end
2364
+
2365
+ class NodeDefinition < Definition
2366
+ def self._pcore_type
2367
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::NodeDefinition', {
2368
+ 'parent' => Definition._pcore_type,
2369
+ 'attributes' => {
2370
+ 'parent' => {
2371
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
2372
+ 'value' => nil
2373
+ },
2374
+ 'host_matches' => Types::PArrayType.new(Expression._pcore_type, Types::PCollectionType::NOT_EMPTY_SIZE),
2375
+ 'body' => {
2376
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
2377
+ 'value' => nil
2378
+ }
2379
+ }
2380
+ })
2381
+ end
2382
+
2383
+ def self.from_hash(i12n)
2384
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::NodeDefinition initializer', _pcore_type.i12n_type, i12n))
2385
+ end
2386
+
2387
+ def self.from_asserted_hash(i12n)
2388
+ new(
2389
+ i12n['locator'],
2390
+ i12n['offset'],
2391
+ i12n['length'],
2392
+ i12n['host_matches'],
2393
+ i12n['parent'],
2394
+ i12n['body'])
2395
+ end
2396
+
2397
+ def self.create(locator, offset, length, host_matches, parent = nil, body = nil)
2398
+ ta = Types::TypeAsserter
2399
+ attrs = _pcore_type.attributes(true)
2400
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
2401
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
2402
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
2403
+ ta.assert_instance_of('Puppet::AST::NodeDefinition[parent]', attrs['parent'].type, parent)
2404
+ ta.assert_instance_of('Puppet::AST::NodeDefinition[host_matches]', attrs['host_matches'].type, host_matches)
2405
+ ta.assert_instance_of('Puppet::AST::NodeDefinition[body]', attrs['body'].type, body)
2406
+ new(locator, offset, length, host_matches, parent, body)
2407
+ end
2408
+
2409
+ attr_reader :parent
2410
+ attr_reader :host_matches
2411
+ attr_reader :body
2412
+
2413
+ def initialize(locator, offset, length, host_matches, parent = nil, body = nil)
2414
+ super(locator, offset, length)
2415
+ @hash = @hash ^ parent.hash ^ host_matches.hash ^ body.hash
2416
+ @parent = parent
2417
+ @host_matches = host_matches
2418
+ @body = body
2419
+ end
2420
+
2421
+ def _pcore_init_hash
2422
+ result = super
2423
+ result['parent'] = @parent unless @parent == nil
2424
+ result['host_matches'] = @host_matches
2425
+ result['body'] = @body unless @body == nil
2426
+ result
2427
+ end
2428
+
2429
+ def _pcore_contents
2430
+ yield(@parent) unless @parent.nil?
2431
+ @host_matches.each { |value| yield(value) }
2432
+ yield(@body) unless @body.nil?
2433
+ end
2434
+
2435
+ def _pcore_all_contents(path, &block)
2436
+ path << self
2437
+ unless @parent.nil?
2438
+ block.call(@parent, path)
2439
+ @parent._pcore_all_contents(path, &block)
2440
+ end
2441
+ @host_matches.each do |value|
2442
+ block.call(value, path)
2443
+ value._pcore_all_contents(path, &block)
2444
+ end
2445
+ unless @body.nil?
2446
+ block.call(@body, path)
2447
+ @body._pcore_all_contents(path, &block)
2448
+ end
2449
+ path.pop
2450
+ end
2451
+
2452
+ def eql?(o)
2453
+ super &&
2454
+ @parent.eql?(o.parent) &&
2455
+ @host_matches.eql?(o.host_matches) &&
2456
+ @body.eql?(o.body)
2457
+ end
2458
+ alias == eql?
2459
+ end
2460
+
2461
+ class SiteDefinition < Definition
2462
+ def self._pcore_type
2463
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::SiteDefinition', {
2464
+ 'parent' => Definition._pcore_type,
2465
+ 'attributes' => {
2466
+ 'body' => {
2467
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
2468
+ 'value' => nil
2469
+ }
2470
+ }
2471
+ })
2472
+ end
2473
+
2474
+ def self.from_hash(i12n)
2475
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::SiteDefinition initializer', _pcore_type.i12n_type, i12n))
2476
+ end
2477
+
2478
+ def self.from_asserted_hash(i12n)
2479
+ new(
2480
+ i12n['locator'],
2481
+ i12n['offset'],
2482
+ i12n['length'],
2483
+ i12n['body'])
2484
+ end
2485
+
2486
+ def self.create(locator, offset, length, body = nil)
2487
+ ta = Types::TypeAsserter
2488
+ attrs = _pcore_type.attributes(true)
2489
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
2490
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
2491
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
2492
+ ta.assert_instance_of('Puppet::AST::SiteDefinition[body]', attrs['body'].type, body)
2493
+ new(locator, offset, length, body)
2494
+ end
2495
+
2496
+ attr_reader :body
2497
+
2498
+ def initialize(locator, offset, length, body = nil)
2499
+ super(locator, offset, length)
2500
+ @hash = @hash ^ body.hash
2501
+ @body = body
2502
+ end
2503
+
2504
+ def _pcore_init_hash
2505
+ result = super
2506
+ result['body'] = @body unless @body == nil
2507
+ result
2508
+ end
2509
+
2510
+ def _pcore_contents
2511
+ yield(@body) unless @body.nil?
2512
+ end
2513
+
2514
+ def _pcore_all_contents(path, &block)
2515
+ path << self
2516
+ unless @body.nil?
2517
+ block.call(@body, path)
2518
+ @body._pcore_all_contents(path, &block)
2519
+ end
2520
+ path.pop
2521
+ end
2522
+
2523
+ def eql?(o)
2524
+ super &&
2525
+ @body.eql?(o.body)
2526
+ end
2527
+ alias == eql?
2528
+ end
2529
+
2530
+ class SubLocatedExpression < Expression
2531
+ def self._pcore_type
2532
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::SubLocatedExpression', {
2533
+ 'parent' => Expression._pcore_type,
2534
+ 'attributes' => {
2535
+ 'expr' => Expression._pcore_type,
2536
+ 'line_offsets' => {
2537
+ 'type' => Types::PArrayType.new(Types::PIntegerType::DEFAULT),
2538
+ 'value' => []
2539
+ },
2540
+ 'leading_line_count' => {
2541
+ 'type' => Types::POptionalType.new(Types::PIntegerType::DEFAULT),
2542
+ 'value' => nil
2543
+ },
2544
+ 'leading_line_offset' => {
2545
+ 'type' => Types::POptionalType.new(Types::PIntegerType::DEFAULT),
2546
+ 'value' => nil
2547
+ }
2548
+ }
2549
+ })
2550
+ end
2551
+
2552
+ def self.from_hash(i12n)
2553
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::SubLocatedExpression initializer', _pcore_type.i12n_type, i12n))
2554
+ end
2555
+
2556
+ def self.from_asserted_hash(i12n)
2557
+ new(
2558
+ i12n['locator'],
2559
+ i12n['offset'],
2560
+ i12n['length'],
2561
+ i12n['expr'],
2562
+ i12n.fetch('line_offsets') { _pcore_type['line_offsets'].value },
2563
+ i12n['leading_line_count'],
2564
+ i12n['leading_line_offset'])
2565
+ end
2566
+
2567
+ def self.create(locator, offset, length, expr, line_offsets = _pcore_type['line_offsets'].value, leading_line_count = nil, leading_line_offset = nil)
2568
+ ta = Types::TypeAsserter
2569
+ attrs = _pcore_type.attributes(true)
2570
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
2571
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
2572
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
2573
+ ta.assert_instance_of('Puppet::AST::SubLocatedExpression[expr]', attrs['expr'].type, expr)
2574
+ ta.assert_instance_of('Puppet::AST::SubLocatedExpression[line_offsets]', attrs['line_offsets'].type, line_offsets)
2575
+ ta.assert_instance_of('Puppet::AST::SubLocatedExpression[leading_line_count]', attrs['leading_line_count'].type, leading_line_count)
2576
+ ta.assert_instance_of('Puppet::AST::SubLocatedExpression[leading_line_offset]', attrs['leading_line_offset'].type, leading_line_offset)
2577
+ new(locator, offset, length, expr, line_offsets, leading_line_count, leading_line_offset)
2578
+ end
2579
+
2580
+ attr_reader :expr
2581
+ attr_reader :line_offsets
2582
+ attr_reader :leading_line_count
2583
+ attr_reader :leading_line_offset
2584
+
2585
+ def initialize(locator, offset, length, expr, line_offsets = _pcore_type['line_offsets'].value, leading_line_count = nil, leading_line_offset = nil)
2586
+ super(locator, offset, length)
2587
+ @hash = @hash ^ expr.hash ^ line_offsets.hash ^ leading_line_count.hash ^ leading_line_offset.hash
2588
+ @expr = expr
2589
+ @line_offsets = line_offsets
2590
+ @leading_line_count = leading_line_count
2591
+ @leading_line_offset = leading_line_offset
2592
+ end
2593
+
2594
+ def _pcore_init_hash
2595
+ result = super
2596
+ result['expr'] = @expr
2597
+ result['line_offsets'] = @line_offsets unless _pcore_type['line_offsets'].default_value?(@line_offsets)
2598
+ result['leading_line_count'] = @leading_line_count unless @leading_line_count == nil
2599
+ result['leading_line_offset'] = @leading_line_offset unless @leading_line_offset == nil
2600
+ result
2601
+ end
2602
+
2603
+ def _pcore_contents
2604
+ yield(@expr) unless @expr.nil?
2605
+ end
2606
+
2607
+ def _pcore_all_contents(path, &block)
2608
+ path << self
2609
+ unless @expr.nil?
2610
+ block.call(@expr, path)
2611
+ @expr._pcore_all_contents(path, &block)
2612
+ end
2613
+ path.pop
2614
+ end
2615
+
2616
+ def eql?(o)
2617
+ super &&
2618
+ @expr.eql?(o.expr) &&
2619
+ @line_offsets.eql?(o.line_offsets) &&
2620
+ @leading_line_count.eql?(o.leading_line_count) &&
2621
+ @leading_line_offset.eql?(o.leading_line_offset)
2622
+ end
2623
+ alias == eql?
2624
+ end
2625
+
2626
+ class HeredocExpression < Expression
2627
+ def self._pcore_type
2628
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::HeredocExpression', {
2629
+ 'parent' => Expression._pcore_type,
2630
+ 'attributes' => {
2631
+ 'syntax' => {
2632
+ 'type' => Types::POptionalType.new(Types::PStringType::DEFAULT),
2633
+ 'value' => nil
2634
+ },
2635
+ 'text_expr' => Expression._pcore_type
2636
+ }
2637
+ })
2638
+ end
2639
+
2640
+ def self.from_hash(i12n)
2641
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::HeredocExpression initializer', _pcore_type.i12n_type, i12n))
2642
+ end
2643
+
2644
+ def self.from_asserted_hash(i12n)
2645
+ new(
2646
+ i12n['locator'],
2647
+ i12n['offset'],
2648
+ i12n['length'],
2649
+ i12n['text_expr'],
2650
+ i12n['syntax'])
2651
+ end
2652
+
2653
+ def self.create(locator, offset, length, text_expr, syntax = nil)
2654
+ ta = Types::TypeAsserter
2655
+ attrs = _pcore_type.attributes(true)
2656
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
2657
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
2658
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
2659
+ ta.assert_instance_of('Puppet::AST::HeredocExpression[syntax]', attrs['syntax'].type, syntax)
2660
+ ta.assert_instance_of('Puppet::AST::HeredocExpression[text_expr]', attrs['text_expr'].type, text_expr)
2661
+ new(locator, offset, length, text_expr, syntax)
2662
+ end
2663
+
2664
+ attr_reader :syntax
2665
+ attr_reader :text_expr
2666
+
2667
+ def initialize(locator, offset, length, text_expr, syntax = nil)
2668
+ super(locator, offset, length)
2669
+ @hash = @hash ^ syntax.hash ^ text_expr.hash
2670
+ @syntax = syntax
2671
+ @text_expr = text_expr
2672
+ end
2673
+
2674
+ def _pcore_init_hash
2675
+ result = super
2676
+ result['syntax'] = @syntax unless @syntax == nil
2677
+ result['text_expr'] = @text_expr
2678
+ result
2679
+ end
2680
+
2681
+ def _pcore_contents
2682
+ yield(@text_expr) unless @text_expr.nil?
2683
+ end
2684
+
2685
+ def _pcore_all_contents(path, &block)
2686
+ path << self
2687
+ unless @text_expr.nil?
2688
+ block.call(@text_expr, path)
2689
+ @text_expr._pcore_all_contents(path, &block)
2690
+ end
2691
+ path.pop
2692
+ end
2693
+
2694
+ def eql?(o)
2695
+ super &&
2696
+ @syntax.eql?(o.syntax) &&
2697
+ @text_expr.eql?(o.text_expr)
2698
+ end
2699
+ alias == eql?
2700
+ end
2701
+
2702
+ class HostClassDefinition < NamedDefinition
2703
+ def self._pcore_type
2704
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::HostClassDefinition', {
2705
+ 'parent' => NamedDefinition._pcore_type,
2706
+ 'attributes' => {
2707
+ 'parent_class' => {
2708
+ 'type' => Types::POptionalType.new(Types::PStringType::DEFAULT),
2709
+ 'value' => nil
2710
+ }
2711
+ }
2712
+ })
2713
+ end
2714
+
2715
+ def self.from_hash(i12n)
2716
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::HostClassDefinition initializer', _pcore_type.i12n_type, i12n))
2717
+ end
2718
+
2719
+ def self.from_asserted_hash(i12n)
2720
+ new(
2721
+ i12n['locator'],
2722
+ i12n['offset'],
2723
+ i12n['length'],
2724
+ i12n['name'],
2725
+ i12n.fetch('parameters') { _pcore_type['parameters'].value },
2726
+ i12n['body'],
2727
+ i12n['parent_class'])
2728
+ end
2729
+
2730
+ def self.create(locator, offset, length, name, parameters = _pcore_type['parameters'].value, body = nil, parent_class = nil)
2731
+ ta = Types::TypeAsserter
2732
+ attrs = _pcore_type.attributes(true)
2733
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
2734
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
2735
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
2736
+ ta.assert_instance_of('Puppet::AST::NamedDefinition[name]', attrs['name'].type, name)
2737
+ ta.assert_instance_of('Puppet::AST::NamedDefinition[parameters]', attrs['parameters'].type, parameters)
2738
+ ta.assert_instance_of('Puppet::AST::NamedDefinition[body]', attrs['body'].type, body)
2739
+ ta.assert_instance_of('Puppet::AST::HostClassDefinition[parent_class]', attrs['parent_class'].type, parent_class)
2740
+ new(locator, offset, length, name, parameters, body, parent_class)
2741
+ end
2742
+
2743
+ attr_reader :parent_class
2744
+
2745
+ def initialize(locator, offset, length, name, parameters = _pcore_type['parameters'].value, body = nil, parent_class = nil)
2746
+ super(locator, offset, length, name, parameters, body)
2747
+ @hash = @hash ^ parent_class.hash
2748
+ @parent_class = parent_class
2749
+ end
2750
+
2751
+ def _pcore_init_hash
2752
+ result = super
2753
+ result['parent_class'] = @parent_class unless @parent_class == nil
2754
+ result
2755
+ end
2756
+
2757
+ def _pcore_contents
2758
+ @parameters.each { |value| yield(value) }
2759
+ yield(@body) unless @body.nil?
2760
+ end
2761
+
2762
+ def _pcore_all_contents(path, &block)
2763
+ path << self
2764
+ @parameters.each do |value|
2765
+ block.call(value, path)
2766
+ value._pcore_all_contents(path, &block)
2767
+ end
2768
+ unless @body.nil?
2769
+ block.call(@body, path)
2770
+ @body._pcore_all_contents(path, &block)
2771
+ end
2772
+ path.pop
2773
+ end
2774
+
2775
+ def eql?(o)
2776
+ super &&
2777
+ @parent_class.eql?(o.parent_class)
2778
+ end
2779
+ alias == eql?
2780
+ end
2781
+
2782
+ class LambdaExpression < Expression
2783
+ def self._pcore_type
2784
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LambdaExpression', {
2785
+ 'parent' => Expression._pcore_type,
2786
+ 'attributes' => {
2787
+ 'parameters' => {
2788
+ 'type' => Types::PArrayType.new(Parameter._pcore_type),
2789
+ 'value' => []
2790
+ },
2791
+ 'body' => {
2792
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
2793
+ 'value' => nil
2794
+ },
2795
+ 'return_type' => {
2796
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
2797
+ 'value' => nil
2798
+ }
2799
+ }
2800
+ })
2801
+ end
2802
+
2803
+ def self.from_hash(i12n)
2804
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::LambdaExpression initializer', _pcore_type.i12n_type, i12n))
2805
+ end
2806
+
2807
+ def self.from_asserted_hash(i12n)
2808
+ new(
2809
+ i12n['locator'],
2810
+ i12n['offset'],
2811
+ i12n['length'],
2812
+ i12n.fetch('parameters') { _pcore_type['parameters'].value },
2813
+ i12n['body'],
2814
+ i12n['return_type'])
2815
+ end
2816
+
2817
+ def self.create(locator, offset, length, parameters = _pcore_type['parameters'].value, body = nil, return_type = nil)
2818
+ ta = Types::TypeAsserter
2819
+ attrs = _pcore_type.attributes(true)
2820
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
2821
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
2822
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
2823
+ ta.assert_instance_of('Puppet::AST::LambdaExpression[parameters]', attrs['parameters'].type, parameters)
2824
+ ta.assert_instance_of('Puppet::AST::LambdaExpression[body]', attrs['body'].type, body)
2825
+ ta.assert_instance_of('Puppet::AST::LambdaExpression[return_type]', attrs['return_type'].type, return_type)
2826
+ new(locator, offset, length, parameters, body, return_type)
2827
+ end
2828
+
2829
+ attr_reader :parameters
2830
+ attr_reader :body
2831
+ attr_reader :return_type
2832
+
2833
+ def initialize(locator, offset, length, parameters = _pcore_type['parameters'].value, body = nil, return_type = nil)
2834
+ super(locator, offset, length)
2835
+ @hash = @hash ^ parameters.hash ^ body.hash ^ return_type.hash
2836
+ @parameters = parameters
2837
+ @body = body
2838
+ @return_type = return_type
2839
+ end
2840
+
2841
+ def _pcore_init_hash
2842
+ result = super
2843
+ result['parameters'] = @parameters unless _pcore_type['parameters'].default_value?(@parameters)
2844
+ result['body'] = @body unless @body == nil
2845
+ result['return_type'] = @return_type unless @return_type == nil
2846
+ result
2847
+ end
2848
+
2849
+ def _pcore_contents
2850
+ @parameters.each { |value| yield(value) }
2851
+ yield(@body) unless @body.nil?
2852
+ yield(@return_type) unless @return_type.nil?
2853
+ end
2854
+
2855
+ def _pcore_all_contents(path, &block)
2856
+ path << self
2857
+ @parameters.each do |value|
2858
+ block.call(value, path)
2859
+ value._pcore_all_contents(path, &block)
2860
+ end
2861
+ unless @body.nil?
2862
+ block.call(@body, path)
2863
+ @body._pcore_all_contents(path, &block)
2864
+ end
2865
+ unless @return_type.nil?
2866
+ block.call(@return_type, path)
2867
+ @return_type._pcore_all_contents(path, &block)
2868
+ end
2869
+ path.pop
2870
+ end
2871
+
2872
+ def eql?(o)
2873
+ super &&
2874
+ @parameters.eql?(o.parameters) &&
2875
+ @body.eql?(o.body) &&
2876
+ @return_type.eql?(o.return_type)
2877
+ end
2878
+ alias == eql?
2879
+ end
2880
+
2881
+ class IfExpression < Expression
2882
+ def self._pcore_type
2883
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::IfExpression', {
2884
+ 'parent' => Expression._pcore_type,
2885
+ 'attributes' => {
2886
+ 'test' => Expression._pcore_type,
2887
+ 'then_expr' => {
2888
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
2889
+ 'value' => nil
2890
+ },
2891
+ 'else_expr' => {
2892
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
2893
+ 'value' => nil
2894
+ }
2895
+ }
2896
+ })
2897
+ end
2898
+
2899
+ def self.from_hash(i12n)
2900
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::IfExpression initializer', _pcore_type.i12n_type, i12n))
2901
+ end
2902
+
2903
+ def self.from_asserted_hash(i12n)
2904
+ new(
2905
+ i12n['locator'],
2906
+ i12n['offset'],
2907
+ i12n['length'],
2908
+ i12n['test'],
2909
+ i12n['then_expr'],
2910
+ i12n['else_expr'])
2911
+ end
2912
+
2913
+ def self.create(locator, offset, length, test, then_expr = nil, else_expr = nil)
2914
+ ta = Types::TypeAsserter
2915
+ attrs = _pcore_type.attributes(true)
2916
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
2917
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
2918
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
2919
+ ta.assert_instance_of('Puppet::AST::IfExpression[test]', attrs['test'].type, test)
2920
+ ta.assert_instance_of('Puppet::AST::IfExpression[then_expr]', attrs['then_expr'].type, then_expr)
2921
+ ta.assert_instance_of('Puppet::AST::IfExpression[else_expr]', attrs['else_expr'].type, else_expr)
2922
+ new(locator, offset, length, test, then_expr, else_expr)
2923
+ end
2924
+
2925
+ attr_reader :test
2926
+ attr_reader :then_expr
2927
+ attr_reader :else_expr
2928
+
2929
+ def initialize(locator, offset, length, test, then_expr = nil, else_expr = nil)
2930
+ super(locator, offset, length)
2931
+ @hash = @hash ^ test.hash ^ then_expr.hash ^ else_expr.hash
2932
+ @test = test
2933
+ @then_expr = then_expr
2934
+ @else_expr = else_expr
2935
+ end
2936
+
2937
+ def _pcore_init_hash
2938
+ result = super
2939
+ result['test'] = @test
2940
+ result['then_expr'] = @then_expr unless @then_expr == nil
2941
+ result['else_expr'] = @else_expr unless @else_expr == nil
2942
+ result
2943
+ end
2944
+
2945
+ def _pcore_contents
2946
+ yield(@test) unless @test.nil?
2947
+ yield(@then_expr) unless @then_expr.nil?
2948
+ yield(@else_expr) unless @else_expr.nil?
2949
+ end
2950
+
2951
+ def _pcore_all_contents(path, &block)
2952
+ path << self
2953
+ unless @test.nil?
2954
+ block.call(@test, path)
2955
+ @test._pcore_all_contents(path, &block)
2956
+ end
2957
+ unless @then_expr.nil?
2958
+ block.call(@then_expr, path)
2959
+ @then_expr._pcore_all_contents(path, &block)
2960
+ end
2961
+ unless @else_expr.nil?
2962
+ block.call(@else_expr, path)
2963
+ @else_expr._pcore_all_contents(path, &block)
2964
+ end
2965
+ path.pop
2966
+ end
2967
+
2968
+ def eql?(o)
2969
+ super &&
2970
+ @test.eql?(o.test) &&
2971
+ @then_expr.eql?(o.then_expr) &&
2972
+ @else_expr.eql?(o.else_expr)
2973
+ end
2974
+ alias == eql?
2975
+ end
2976
+
2977
+ class UnlessExpression < IfExpression
2978
+ def self._pcore_type
2979
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::UnlessExpression', {
2980
+ 'parent' => IfExpression._pcore_type
2981
+ })
2982
+ end
2983
+
2984
+ def _pcore_contents
2985
+ yield(@test) unless @test.nil?
2986
+ yield(@then_expr) unless @then_expr.nil?
2987
+ yield(@else_expr) unless @else_expr.nil?
2988
+ end
2989
+
2990
+ def _pcore_all_contents(path, &block)
2991
+ path << self
2992
+ unless @test.nil?
2993
+ block.call(@test, path)
2994
+ @test._pcore_all_contents(path, &block)
2995
+ end
2996
+ unless @then_expr.nil?
2997
+ block.call(@then_expr, path)
2998
+ @then_expr._pcore_all_contents(path, &block)
2999
+ end
3000
+ unless @else_expr.nil?
3001
+ block.call(@else_expr, path)
3002
+ @else_expr._pcore_all_contents(path, &block)
3003
+ end
3004
+ path.pop
3005
+ end
3006
+ end
3007
+
3008
+ class CallExpression < Expression
3009
+ def self._pcore_type
3010
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::CallExpression', {
3011
+ 'parent' => Expression._pcore_type,
3012
+ 'attributes' => {
3013
+ 'rval_required' => {
3014
+ 'type' => Types::PBooleanType::DEFAULT,
3015
+ 'value' => false
3016
+ },
3017
+ 'functor_expr' => Expression._pcore_type,
3018
+ 'arguments' => {
3019
+ 'type' => Types::PArrayType.new(Expression._pcore_type),
3020
+ 'value' => []
3021
+ },
3022
+ 'lambda' => {
3023
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
3024
+ 'value' => nil
3025
+ }
3026
+ }
3027
+ })
3028
+ end
3029
+
3030
+ def self.from_hash(i12n)
3031
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::CallExpression initializer', _pcore_type.i12n_type, i12n))
3032
+ end
3033
+
3034
+ def self.from_asserted_hash(i12n)
3035
+ new(
3036
+ i12n['locator'],
3037
+ i12n['offset'],
3038
+ i12n['length'],
3039
+ i12n['functor_expr'],
3040
+ i12n.fetch('rval_required') { false },
3041
+ i12n.fetch('arguments') { _pcore_type['arguments'].value },
3042
+ i12n['lambda'])
3043
+ end
3044
+
3045
+ def self.create(locator, offset, length, functor_expr, rval_required = false, arguments = _pcore_type['arguments'].value, lambda = nil)
3046
+ ta = Types::TypeAsserter
3047
+ attrs = _pcore_type.attributes(true)
3048
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3049
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3050
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3051
+ ta.assert_instance_of('Puppet::AST::CallExpression[rval_required]', attrs['rval_required'].type, rval_required)
3052
+ ta.assert_instance_of('Puppet::AST::CallExpression[functor_expr]', attrs['functor_expr'].type, functor_expr)
3053
+ ta.assert_instance_of('Puppet::AST::CallExpression[arguments]', attrs['arguments'].type, arguments)
3054
+ ta.assert_instance_of('Puppet::AST::CallExpression[lambda]', attrs['lambda'].type, lambda)
3055
+ new(locator, offset, length, functor_expr, rval_required, arguments, lambda)
3056
+ end
3057
+
3058
+ attr_reader :rval_required
3059
+ attr_reader :functor_expr
3060
+ attr_reader :arguments
3061
+ attr_reader :lambda
3062
+
3063
+ def initialize(locator, offset, length, functor_expr, rval_required = false, arguments = _pcore_type['arguments'].value, lambda = nil)
3064
+ super(locator, offset, length)
3065
+ @hash = @hash ^ rval_required.hash ^ functor_expr.hash ^ arguments.hash ^ lambda.hash
3066
+ @rval_required = rval_required
3067
+ @functor_expr = functor_expr
3068
+ @arguments = arguments
3069
+ @lambda = lambda
3070
+ end
3071
+
3072
+ def _pcore_init_hash
3073
+ result = super
3074
+ result['rval_required'] = @rval_required unless @rval_required == false
3075
+ result['functor_expr'] = @functor_expr
3076
+ result['arguments'] = @arguments unless _pcore_type['arguments'].default_value?(@arguments)
3077
+ result['lambda'] = @lambda unless @lambda == nil
3078
+ result
3079
+ end
3080
+
3081
+ def _pcore_contents
3082
+ yield(@functor_expr) unless @functor_expr.nil?
3083
+ @arguments.each { |value| yield(value) }
3084
+ yield(@lambda) unless @lambda.nil?
3085
+ end
3086
+
3087
+ def _pcore_all_contents(path, &block)
3088
+ path << self
3089
+ unless @functor_expr.nil?
3090
+ block.call(@functor_expr, path)
3091
+ @functor_expr._pcore_all_contents(path, &block)
3092
+ end
3093
+ @arguments.each do |value|
3094
+ block.call(value, path)
3095
+ value._pcore_all_contents(path, &block)
3096
+ end
3097
+ unless @lambda.nil?
3098
+ block.call(@lambda, path)
3099
+ @lambda._pcore_all_contents(path, &block)
3100
+ end
3101
+ path.pop
3102
+ end
3103
+
3104
+ def eql?(o)
3105
+ super &&
3106
+ @rval_required.eql?(o.rval_required) &&
3107
+ @functor_expr.eql?(o.functor_expr) &&
3108
+ @arguments.eql?(o.arguments) &&
3109
+ @lambda.eql?(o.lambda)
3110
+ end
3111
+ alias == eql?
3112
+ end
3113
+
3114
+ class CallFunctionExpression < CallExpression
3115
+ def self._pcore_type
3116
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::CallFunctionExpression', {
3117
+ 'parent' => CallExpression._pcore_type
3118
+ })
3119
+ end
3120
+
3121
+ def _pcore_contents
3122
+ yield(@functor_expr) unless @functor_expr.nil?
3123
+ @arguments.each { |value| yield(value) }
3124
+ yield(@lambda) unless @lambda.nil?
3125
+ end
3126
+
3127
+ def _pcore_all_contents(path, &block)
3128
+ path << self
3129
+ unless @functor_expr.nil?
3130
+ block.call(@functor_expr, path)
3131
+ @functor_expr._pcore_all_contents(path, &block)
3132
+ end
3133
+ @arguments.each do |value|
3134
+ block.call(value, path)
3135
+ value._pcore_all_contents(path, &block)
3136
+ end
3137
+ unless @lambda.nil?
3138
+ block.call(@lambda, path)
3139
+ @lambda._pcore_all_contents(path, &block)
3140
+ end
3141
+ path.pop
3142
+ end
3143
+ end
3144
+
3145
+ class CallNamedFunctionExpression < CallExpression
3146
+ def self._pcore_type
3147
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::CallNamedFunctionExpression', {
3148
+ 'parent' => CallExpression._pcore_type
3149
+ })
3150
+ end
3151
+
3152
+ def _pcore_contents
3153
+ yield(@functor_expr) unless @functor_expr.nil?
3154
+ @arguments.each { |value| yield(value) }
3155
+ yield(@lambda) unless @lambda.nil?
3156
+ end
3157
+
3158
+ def _pcore_all_contents(path, &block)
3159
+ path << self
3160
+ unless @functor_expr.nil?
3161
+ block.call(@functor_expr, path)
3162
+ @functor_expr._pcore_all_contents(path, &block)
3163
+ end
3164
+ @arguments.each do |value|
3165
+ block.call(value, path)
3166
+ value._pcore_all_contents(path, &block)
3167
+ end
3168
+ unless @lambda.nil?
3169
+ block.call(@lambda, path)
3170
+ @lambda._pcore_all_contents(path, &block)
3171
+ end
3172
+ path.pop
3173
+ end
3174
+ end
3175
+
3176
+ class CallMethodExpression < CallExpression
3177
+ def self._pcore_type
3178
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::CallMethodExpression', {
3179
+ 'parent' => CallExpression._pcore_type
3180
+ })
3181
+ end
3182
+
3183
+ def _pcore_contents
3184
+ yield(@functor_expr) unless @functor_expr.nil?
3185
+ @arguments.each { |value| yield(value) }
3186
+ yield(@lambda) unless @lambda.nil?
3187
+ end
3188
+
3189
+ def _pcore_all_contents(path, &block)
3190
+ path << self
3191
+ unless @functor_expr.nil?
3192
+ block.call(@functor_expr, path)
3193
+ @functor_expr._pcore_all_contents(path, &block)
3194
+ end
3195
+ @arguments.each do |value|
3196
+ block.call(value, path)
3197
+ value._pcore_all_contents(path, &block)
3198
+ end
3199
+ unless @lambda.nil?
3200
+ block.call(@lambda, path)
3201
+ @lambda._pcore_all_contents(path, &block)
3202
+ end
3203
+ path.pop
3204
+ end
3205
+ end
3206
+
3207
+ class Literal < Expression
3208
+ def self._pcore_type
3209
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::Literal', {
3210
+ 'parent' => Expression._pcore_type
3211
+ })
3212
+ end
3213
+ end
3214
+
3215
+ class LiteralValue < Literal
3216
+ def self._pcore_type
3217
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LiteralValue', {
3218
+ 'parent' => Literal._pcore_type
3219
+ })
3220
+ end
3221
+ end
3222
+
3223
+ class LiteralRegularExpression < LiteralValue
3224
+ def self._pcore_type
3225
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LiteralRegularExpression', {
3226
+ 'parent' => LiteralValue._pcore_type,
3227
+ 'attributes' => {
3228
+ 'value' => Types::PAnyType::DEFAULT,
3229
+ 'pattern' => Types::PStringType::DEFAULT
3230
+ }
3231
+ })
3232
+ end
3233
+
3234
+ def self.from_hash(i12n)
3235
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::LiteralRegularExpression initializer', _pcore_type.i12n_type, i12n))
3236
+ end
3237
+
3238
+ def self.from_asserted_hash(i12n)
3239
+ new(
3240
+ i12n['locator'],
3241
+ i12n['offset'],
3242
+ i12n['length'],
3243
+ i12n['value'],
3244
+ i12n['pattern'])
3245
+ end
3246
+
3247
+ def self.create(locator, offset, length, value, pattern)
3248
+ ta = Types::TypeAsserter
3249
+ attrs = _pcore_type.attributes(true)
3250
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3251
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3252
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3253
+ ta.assert_instance_of('Puppet::AST::LiteralRegularExpression[value]', attrs['value'].type, value)
3254
+ ta.assert_instance_of('Puppet::AST::LiteralRegularExpression[pattern]', attrs['pattern'].type, pattern)
3255
+ new(locator, offset, length, value, pattern)
3256
+ end
3257
+
3258
+ attr_reader :value
3259
+ attr_reader :pattern
3260
+
3261
+ def initialize(locator, offset, length, value, pattern)
3262
+ super(locator, offset, length)
3263
+ @hash = @hash ^ value.hash ^ pattern.hash
3264
+ @value = value
3265
+ @pattern = pattern
3266
+ end
3267
+
3268
+ def _pcore_init_hash
3269
+ result = super
3270
+ result['value'] = @value
3271
+ result['pattern'] = @pattern
3272
+ result
3273
+ end
3274
+
3275
+ def eql?(o)
3276
+ super &&
3277
+ @value.eql?(o.value) &&
3278
+ @pattern.eql?(o.pattern)
3279
+ end
3280
+ alias == eql?
3281
+ end
3282
+
3283
+ class LiteralString < LiteralValue
3284
+ def self._pcore_type
3285
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LiteralString', {
3286
+ 'parent' => LiteralValue._pcore_type,
3287
+ 'attributes' => {
3288
+ 'value' => Types::PStringType::DEFAULT
3289
+ }
3290
+ })
3291
+ end
3292
+
3293
+ def self.from_hash(i12n)
3294
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::LiteralString initializer', _pcore_type.i12n_type, i12n))
3295
+ end
3296
+
3297
+ def self.from_asserted_hash(i12n)
3298
+ new(
3299
+ i12n['locator'],
3300
+ i12n['offset'],
3301
+ i12n['length'],
3302
+ i12n['value'])
3303
+ end
3304
+
3305
+ def self.create(locator, offset, length, value)
3306
+ ta = Types::TypeAsserter
3307
+ attrs = _pcore_type.attributes(true)
3308
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3309
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3310
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3311
+ ta.assert_instance_of('Puppet::AST::LiteralString[value]', attrs['value'].type, value)
3312
+ new(locator, offset, length, value)
3313
+ end
3314
+
3315
+ attr_reader :value
3316
+
3317
+ def initialize(locator, offset, length, value)
3318
+ super(locator, offset, length)
3319
+ @hash = @hash ^ value.hash
3320
+ @value = value
3321
+ end
3322
+
3323
+ def _pcore_init_hash
3324
+ result = super
3325
+ result['value'] = @value
3326
+ result
3327
+ end
3328
+
3329
+ def eql?(o)
3330
+ super &&
3331
+ @value.eql?(o.value)
3332
+ end
3333
+ alias == eql?
3334
+ end
3335
+
3336
+ class LiteralNumber < LiteralValue
3337
+ def self._pcore_type
3338
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LiteralNumber', {
3339
+ 'parent' => LiteralValue._pcore_type
3340
+ })
3341
+ end
3342
+ end
3343
+
3344
+ class LiteralInteger < LiteralNumber
3345
+ def self._pcore_type
3346
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LiteralInteger', {
3347
+ 'parent' => LiteralNumber._pcore_type,
3348
+ 'attributes' => {
3349
+ 'radix' => {
3350
+ 'type' => Types::PIntegerType::DEFAULT,
3351
+ 'value' => 10
3352
+ },
3353
+ 'value' => Types::PIntegerType::DEFAULT
3354
+ }
3355
+ })
3356
+ end
3357
+
3358
+ def self.from_hash(i12n)
3359
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::LiteralInteger initializer', _pcore_type.i12n_type, i12n))
3360
+ end
3361
+
3362
+ def self.from_asserted_hash(i12n)
3363
+ new(
3364
+ i12n['locator'],
3365
+ i12n['offset'],
3366
+ i12n['length'],
3367
+ i12n['value'],
3368
+ i12n.fetch('radix') { 10 })
3369
+ end
3370
+
3371
+ def self.create(locator, offset, length, value, radix = 10)
3372
+ ta = Types::TypeAsserter
3373
+ attrs = _pcore_type.attributes(true)
3374
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3375
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3376
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3377
+ ta.assert_instance_of('Puppet::AST::LiteralInteger[radix]', attrs['radix'].type, radix)
3378
+ ta.assert_instance_of('Puppet::AST::LiteralInteger[value]', attrs['value'].type, value)
3379
+ new(locator, offset, length, value, radix)
3380
+ end
3381
+
3382
+ attr_reader :radix
3383
+ attr_reader :value
3384
+
3385
+ def initialize(locator, offset, length, value, radix = 10)
3386
+ super(locator, offset, length)
3387
+ @hash = @hash ^ radix.hash ^ value.hash
3388
+ @radix = radix
3389
+ @value = value
3390
+ end
3391
+
3392
+ def _pcore_init_hash
3393
+ result = super
3394
+ result['radix'] = @radix unless @radix == 10
3395
+ result['value'] = @value
3396
+ result
3397
+ end
3398
+
3399
+ def eql?(o)
3400
+ super &&
3401
+ @radix.eql?(o.radix) &&
3402
+ @value.eql?(o.value)
3403
+ end
3404
+ alias == eql?
3405
+ end
3406
+
3407
+ class LiteralFloat < LiteralNumber
3408
+ def self._pcore_type
3409
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LiteralFloat', {
3410
+ 'parent' => LiteralNumber._pcore_type,
3411
+ 'attributes' => {
3412
+ 'value' => Types::PFloatType::DEFAULT
3413
+ }
3414
+ })
3415
+ end
3416
+
3417
+ def self.from_hash(i12n)
3418
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::LiteralFloat initializer', _pcore_type.i12n_type, i12n))
3419
+ end
3420
+
3421
+ def self.from_asserted_hash(i12n)
3422
+ new(
3423
+ i12n['locator'],
3424
+ i12n['offset'],
3425
+ i12n['length'],
3426
+ i12n['value'])
3427
+ end
3428
+
3429
+ def self.create(locator, offset, length, value)
3430
+ ta = Types::TypeAsserter
3431
+ attrs = _pcore_type.attributes(true)
3432
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3433
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3434
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3435
+ ta.assert_instance_of('Puppet::AST::LiteralFloat[value]', attrs['value'].type, value)
3436
+ new(locator, offset, length, value)
3437
+ end
3438
+
3439
+ attr_reader :value
3440
+
3441
+ def initialize(locator, offset, length, value)
3442
+ super(locator, offset, length)
3443
+ @hash = @hash ^ value.hash
3444
+ @value = value
3445
+ end
3446
+
3447
+ def _pcore_init_hash
3448
+ result = super
3449
+ result['value'] = @value
3450
+ result
3451
+ end
3452
+
3453
+ def eql?(o)
3454
+ super &&
3455
+ @value.eql?(o.value)
3456
+ end
3457
+ alias == eql?
3458
+ end
3459
+
3460
+ class LiteralUndef < Literal
3461
+ def self._pcore_type
3462
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LiteralUndef', {
3463
+ 'parent' => Literal._pcore_type
3464
+ })
3465
+ end
3466
+ end
3467
+
3468
+ class LiteralDefault < Literal
3469
+ def self._pcore_type
3470
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LiteralDefault', {
3471
+ 'parent' => Literal._pcore_type
3472
+ })
3473
+ end
3474
+ end
3475
+
3476
+ class LiteralBoolean < LiteralValue
3477
+ def self._pcore_type
3478
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::LiteralBoolean', {
3479
+ 'parent' => LiteralValue._pcore_type,
3480
+ 'attributes' => {
3481
+ 'value' => Types::PBooleanType::DEFAULT
3482
+ }
3483
+ })
3484
+ end
3485
+
3486
+ def self.from_hash(i12n)
3487
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::LiteralBoolean initializer', _pcore_type.i12n_type, i12n))
3488
+ end
3489
+
3490
+ def self.from_asserted_hash(i12n)
3491
+ new(
3492
+ i12n['locator'],
3493
+ i12n['offset'],
3494
+ i12n['length'],
3495
+ i12n['value'])
3496
+ end
3497
+
3498
+ def self.create(locator, offset, length, value)
3499
+ ta = Types::TypeAsserter
3500
+ attrs = _pcore_type.attributes(true)
3501
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3502
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3503
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3504
+ ta.assert_instance_of('Puppet::AST::LiteralBoolean[value]', attrs['value'].type, value)
3505
+ new(locator, offset, length, value)
3506
+ end
3507
+
3508
+ attr_reader :value
3509
+
3510
+ def initialize(locator, offset, length, value)
3511
+ super(locator, offset, length)
3512
+ @hash = @hash ^ value.hash
3513
+ @value = value
3514
+ end
3515
+
3516
+ def _pcore_init_hash
3517
+ result = super
3518
+ result['value'] = @value
3519
+ result
3520
+ end
3521
+
3522
+ def eql?(o)
3523
+ super &&
3524
+ @value.eql?(o.value)
3525
+ end
3526
+ alias == eql?
3527
+ end
3528
+
3529
+ class TextExpression < UnaryExpression
3530
+ def self._pcore_type
3531
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::TextExpression', {
3532
+ 'parent' => UnaryExpression._pcore_type
3533
+ })
3534
+ end
3535
+
3536
+ def _pcore_contents
3537
+ yield(@expr) unless @expr.nil?
3538
+ end
3539
+
3540
+ def _pcore_all_contents(path, &block)
3541
+ path << self
3542
+ unless @expr.nil?
3543
+ block.call(@expr, path)
3544
+ @expr._pcore_all_contents(path, &block)
3545
+ end
3546
+ path.pop
3547
+ end
3548
+ end
3549
+
3550
+ class ConcatenatedString < Expression
3551
+ def self._pcore_type
3552
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ConcatenatedString', {
3553
+ 'parent' => Expression._pcore_type,
3554
+ 'attributes' => {
3555
+ 'segments' => {
3556
+ 'type' => Types::PArrayType.new(Expression._pcore_type),
3557
+ 'value' => []
3558
+ }
3559
+ }
3560
+ })
3561
+ end
3562
+
3563
+ def self.from_hash(i12n)
3564
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::ConcatenatedString initializer', _pcore_type.i12n_type, i12n))
3565
+ end
3566
+
3567
+ def self.from_asserted_hash(i12n)
3568
+ new(
3569
+ i12n['locator'],
3570
+ i12n['offset'],
3571
+ i12n['length'],
3572
+ i12n.fetch('segments') { _pcore_type['segments'].value })
3573
+ end
3574
+
3575
+ def self.create(locator, offset, length, segments = _pcore_type['segments'].value)
3576
+ ta = Types::TypeAsserter
3577
+ attrs = _pcore_type.attributes(true)
3578
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3579
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3580
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3581
+ ta.assert_instance_of('Puppet::AST::ConcatenatedString[segments]', attrs['segments'].type, segments)
3582
+ new(locator, offset, length, segments)
3583
+ end
3584
+
3585
+ attr_reader :segments
3586
+
3587
+ def initialize(locator, offset, length, segments = _pcore_type['segments'].value)
3588
+ super(locator, offset, length)
3589
+ @hash = @hash ^ segments.hash
3590
+ @segments = segments
3591
+ end
3592
+
3593
+ def _pcore_init_hash
3594
+ result = super
3595
+ result['segments'] = @segments unless _pcore_type['segments'].default_value?(@segments)
3596
+ result
3597
+ end
3598
+
3599
+ def _pcore_contents
3600
+ @segments.each { |value| yield(value) }
3601
+ end
3602
+
3603
+ def _pcore_all_contents(path, &block)
3604
+ path << self
3605
+ @segments.each do |value|
3606
+ block.call(value, path)
3607
+ value._pcore_all_contents(path, &block)
3608
+ end
3609
+ path.pop
3610
+ end
3611
+
3612
+ def eql?(o)
3613
+ super &&
3614
+ @segments.eql?(o.segments)
3615
+ end
3616
+ alias == eql?
3617
+ end
3618
+
3619
+ class QualifiedName < LiteralValue
3620
+ def self._pcore_type
3621
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::QualifiedName', {
3622
+ 'parent' => LiteralValue._pcore_type,
3623
+ 'attributes' => {
3624
+ 'value' => Types::PStringType::DEFAULT
3625
+ }
3626
+ })
3627
+ end
3628
+
3629
+ def self.from_hash(i12n)
3630
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::QualifiedName initializer', _pcore_type.i12n_type, i12n))
3631
+ end
3632
+
3633
+ def self.from_asserted_hash(i12n)
3634
+ new(
3635
+ i12n['locator'],
3636
+ i12n['offset'],
3637
+ i12n['length'],
3638
+ i12n['value'])
3639
+ end
3640
+
3641
+ def self.create(locator, offset, length, value)
3642
+ ta = Types::TypeAsserter
3643
+ attrs = _pcore_type.attributes(true)
3644
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3645
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3646
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3647
+ ta.assert_instance_of('Puppet::AST::QualifiedName[value]', attrs['value'].type, value)
3648
+ new(locator, offset, length, value)
3649
+ end
3650
+
3651
+ attr_reader :value
3652
+
3653
+ def initialize(locator, offset, length, value)
3654
+ super(locator, offset, length)
3655
+ @hash = @hash ^ value.hash
3656
+ @value = value
3657
+ end
3658
+
3659
+ def _pcore_init_hash
3660
+ result = super
3661
+ result['value'] = @value
3662
+ result
3663
+ end
3664
+
3665
+ def eql?(o)
3666
+ super &&
3667
+ @value.eql?(o.value)
3668
+ end
3669
+ alias == eql?
3670
+ end
3671
+
3672
+ class ReservedWord < LiteralValue
3673
+ def self._pcore_type
3674
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ReservedWord', {
3675
+ 'parent' => LiteralValue._pcore_type,
3676
+ 'attributes' => {
3677
+ 'word' => Types::PStringType::DEFAULT,
3678
+ 'future' => {
3679
+ 'type' => Types::POptionalType.new(Types::PBooleanType::DEFAULT),
3680
+ 'value' => nil
3681
+ }
3682
+ }
3683
+ })
3684
+ end
3685
+
3686
+ def self.from_hash(i12n)
3687
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::ReservedWord initializer', _pcore_type.i12n_type, i12n))
3688
+ end
3689
+
3690
+ def self.from_asserted_hash(i12n)
3691
+ new(
3692
+ i12n['locator'],
3693
+ i12n['offset'],
3694
+ i12n['length'],
3695
+ i12n['word'],
3696
+ i12n['future'])
3697
+ end
3698
+
3699
+ def self.create(locator, offset, length, word, future = nil)
3700
+ ta = Types::TypeAsserter
3701
+ attrs = _pcore_type.attributes(true)
3702
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3703
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3704
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3705
+ ta.assert_instance_of('Puppet::AST::ReservedWord[word]', attrs['word'].type, word)
3706
+ ta.assert_instance_of('Puppet::AST::ReservedWord[future]', attrs['future'].type, future)
3707
+ new(locator, offset, length, word, future)
3708
+ end
3709
+
3710
+ attr_reader :word
3711
+ attr_reader :future
3712
+
3713
+ def initialize(locator, offset, length, word, future = nil)
3714
+ super(locator, offset, length)
3715
+ @hash = @hash ^ word.hash ^ future.hash
3716
+ @word = word
3717
+ @future = future
3718
+ end
3719
+
3720
+ def _pcore_init_hash
3721
+ result = super
3722
+ result['word'] = @word
3723
+ result['future'] = @future unless @future == nil
3724
+ result
3725
+ end
3726
+
3727
+ def eql?(o)
3728
+ super &&
3729
+ @word.eql?(o.word) &&
3730
+ @future.eql?(o.future)
3731
+ end
3732
+ alias == eql?
3733
+ end
3734
+
3735
+ class QualifiedReference < LiteralValue
3736
+ def self._pcore_type
3737
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::QualifiedReference', {
3738
+ 'parent' => LiteralValue._pcore_type,
3739
+ 'attributes' => {
3740
+ 'cased_value' => Types::PStringType::DEFAULT,
3741
+ 'value' => {
3742
+ 'type' => Types::PStringType::DEFAULT,
3743
+ 'kind' => 'derived'
3744
+ }
3745
+ }
3746
+ })
3747
+ end
3748
+
3749
+ def self.from_hash(i12n)
3750
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::QualifiedReference initializer', _pcore_type.i12n_type, i12n))
3751
+ end
3752
+
3753
+ def self.from_asserted_hash(i12n)
3754
+ new(
3755
+ i12n['locator'],
3756
+ i12n['offset'],
3757
+ i12n['length'],
3758
+ i12n['cased_value'])
3759
+ end
3760
+
3761
+ def self.create(locator, offset, length, cased_value)
3762
+ ta = Types::TypeAsserter
3763
+ attrs = _pcore_type.attributes(true)
3764
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3765
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3766
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3767
+ ta.assert_instance_of('Puppet::AST::QualifiedReference[cased_value]', attrs['cased_value'].type, cased_value)
3768
+ new(locator, offset, length, cased_value)
3769
+ end
3770
+
3771
+ attr_reader :cased_value
3772
+
3773
+ def value
3774
+ @cased_value.downcase
3775
+ end
3776
+
3777
+ def initialize(locator, offset, length, cased_value)
3778
+ super(locator, offset, length)
3779
+ @hash = @hash ^ cased_value.hash
3780
+ @cased_value = cased_value
3781
+ end
3782
+
3783
+ def _pcore_init_hash
3784
+ result = super
3785
+ result['cased_value'] = @cased_value
3786
+ result
3787
+ end
3788
+
3789
+ def eql?(o)
3790
+ super &&
3791
+ @cased_value.eql?(o.cased_value)
3792
+ end
3793
+ alias == eql?
3794
+ end
3795
+
3796
+ class VariableExpression < UnaryExpression
3797
+ def self._pcore_type
3798
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::VariableExpression', {
3799
+ 'parent' => UnaryExpression._pcore_type
3800
+ })
3801
+ end
3802
+
3803
+ def _pcore_contents
3804
+ yield(@expr) unless @expr.nil?
3805
+ end
3806
+
3807
+ def _pcore_all_contents(path, &block)
3808
+ path << self
3809
+ unless @expr.nil?
3810
+ block.call(@expr, path)
3811
+ @expr._pcore_all_contents(path, &block)
3812
+ end
3813
+ path.pop
3814
+ end
3815
+ end
3816
+
3817
+ class EppExpression < Expression
3818
+ def self._pcore_type
3819
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::EppExpression', {
3820
+ 'parent' => Expression._pcore_type,
3821
+ 'attributes' => {
3822
+ 'parameters_specified' => {
3823
+ 'type' => Types::POptionalType.new(Types::PBooleanType::DEFAULT),
3824
+ 'value' => nil
3825
+ },
3826
+ 'body' => {
3827
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
3828
+ 'value' => nil
3829
+ }
3830
+ }
3831
+ })
3832
+ end
3833
+
3834
+ def self.from_hash(i12n)
3835
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::EppExpression initializer', _pcore_type.i12n_type, i12n))
3836
+ end
3837
+
3838
+ def self.from_asserted_hash(i12n)
3839
+ new(
3840
+ i12n['locator'],
3841
+ i12n['offset'],
3842
+ i12n['length'],
3843
+ i12n['parameters_specified'],
3844
+ i12n['body'])
3845
+ end
3846
+
3847
+ def self.create(locator, offset, length, parameters_specified = nil, body = nil)
3848
+ ta = Types::TypeAsserter
3849
+ attrs = _pcore_type.attributes(true)
3850
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3851
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3852
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3853
+ ta.assert_instance_of('Puppet::AST::EppExpression[parameters_specified]', attrs['parameters_specified'].type, parameters_specified)
3854
+ ta.assert_instance_of('Puppet::AST::EppExpression[body]', attrs['body'].type, body)
3855
+ new(locator, offset, length, parameters_specified, body)
3856
+ end
3857
+
3858
+ attr_reader :parameters_specified
3859
+ attr_reader :body
3860
+
3861
+ def initialize(locator, offset, length, parameters_specified = nil, body = nil)
3862
+ super(locator, offset, length)
3863
+ @hash = @hash ^ parameters_specified.hash ^ body.hash
3864
+ @parameters_specified = parameters_specified
3865
+ @body = body
3866
+ end
3867
+
3868
+ def _pcore_init_hash
3869
+ result = super
3870
+ result['parameters_specified'] = @parameters_specified unless @parameters_specified == nil
3871
+ result['body'] = @body unless @body == nil
3872
+ result
3873
+ end
3874
+
3875
+ def _pcore_contents
3876
+ yield(@body) unless @body.nil?
3877
+ end
3878
+
3879
+ def _pcore_all_contents(path, &block)
3880
+ path << self
3881
+ unless @body.nil?
3882
+ block.call(@body, path)
3883
+ @body._pcore_all_contents(path, &block)
3884
+ end
3885
+ path.pop
3886
+ end
3887
+
3888
+ def eql?(o)
3889
+ super &&
3890
+ @parameters_specified.eql?(o.parameters_specified) &&
3891
+ @body.eql?(o.body)
3892
+ end
3893
+ alias == eql?
3894
+ end
3895
+
3896
+ class RenderStringExpression < LiteralString
3897
+ def self._pcore_type
3898
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::RenderStringExpression', {
3899
+ 'parent' => LiteralString._pcore_type
3900
+ })
3901
+ end
3902
+ end
3903
+
3904
+ class RenderExpression < UnaryExpression
3905
+ def self._pcore_type
3906
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::RenderExpression', {
3907
+ 'parent' => UnaryExpression._pcore_type
3908
+ })
3909
+ end
3910
+
3911
+ def _pcore_contents
3912
+ yield(@expr) unless @expr.nil?
3913
+ end
3914
+
3915
+ def _pcore_all_contents(path, &block)
3916
+ path << self
3917
+ unless @expr.nil?
3918
+ block.call(@expr, path)
3919
+ @expr._pcore_all_contents(path, &block)
3920
+ end
3921
+ path.pop
3922
+ end
3923
+ end
3924
+
3925
+ class ResourceBody < Positioned
3926
+ def self._pcore_type
3927
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ResourceBody', {
3928
+ 'parent' => Positioned._pcore_type,
3929
+ 'attributes' => {
3930
+ 'title' => {
3931
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
3932
+ 'value' => nil
3933
+ },
3934
+ 'operations' => {
3935
+ 'type' => Types::PArrayType.new(AbstractAttributeOperation._pcore_type),
3936
+ 'value' => []
3937
+ }
3938
+ }
3939
+ })
3940
+ end
3941
+
3942
+ def self.from_hash(i12n)
3943
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::ResourceBody initializer', _pcore_type.i12n_type, i12n))
3944
+ end
3945
+
3946
+ def self.from_asserted_hash(i12n)
3947
+ new(
3948
+ i12n['locator'],
3949
+ i12n['offset'],
3950
+ i12n['length'],
3951
+ i12n['title'],
3952
+ i12n.fetch('operations') { _pcore_type['operations'].value })
3953
+ end
3954
+
3955
+ def self.create(locator, offset, length, title = nil, operations = _pcore_type['operations'].value)
3956
+ ta = Types::TypeAsserter
3957
+ attrs = _pcore_type.attributes(true)
3958
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3959
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3960
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3961
+ ta.assert_instance_of('Puppet::AST::ResourceBody[title]', attrs['title'].type, title)
3962
+ ta.assert_instance_of('Puppet::AST::ResourceBody[operations]', attrs['operations'].type, operations)
3963
+ new(locator, offset, length, title, operations)
3964
+ end
3965
+
3966
+ attr_reader :title
3967
+ attr_reader :operations
3968
+
3969
+ def initialize(locator, offset, length, title = nil, operations = _pcore_type['operations'].value)
3970
+ super(locator, offset, length)
3971
+ @hash = @hash ^ title.hash ^ operations.hash
3972
+ @title = title
3973
+ @operations = operations
3974
+ end
3975
+
3976
+ def _pcore_init_hash
3977
+ result = super
3978
+ result['title'] = @title unless @title == nil
3979
+ result['operations'] = @operations unless _pcore_type['operations'].default_value?(@operations)
3980
+ result
3981
+ end
3982
+
3983
+ def _pcore_contents
3984
+ yield(@title) unless @title.nil?
3985
+ @operations.each { |value| yield(value) }
3986
+ end
3987
+
3988
+ def _pcore_all_contents(path, &block)
3989
+ path << self
3990
+ unless @title.nil?
3991
+ block.call(@title, path)
3992
+ @title._pcore_all_contents(path, &block)
3993
+ end
3994
+ @operations.each do |value|
3995
+ block.call(value, path)
3996
+ value._pcore_all_contents(path, &block)
3997
+ end
3998
+ path.pop
3999
+ end
4000
+
4001
+ def eql?(o)
4002
+ super &&
4003
+ @title.eql?(o.title) &&
4004
+ @operations.eql?(o.operations)
4005
+ end
4006
+ alias == eql?
4007
+ end
4008
+
4009
+ class AbstractResource < Expression
4010
+ def self._pcore_type
4011
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::AbstractResource', {
4012
+ 'parent' => Expression._pcore_type,
4013
+ 'attributes' => {
4014
+ 'form' => {
4015
+ 'type' => Types::PEnumType.new(['exported', 'regular', 'virtual']),
4016
+ 'value' => 'regular'
4017
+ },
4018
+ 'virtual' => {
4019
+ 'type' => Types::PBooleanType::DEFAULT,
4020
+ 'kind' => 'derived'
4021
+ },
4022
+ 'exported' => {
4023
+ 'type' => Types::PBooleanType::DEFAULT,
4024
+ 'kind' => 'derived'
4025
+ }
4026
+ }
4027
+ })
4028
+ end
4029
+
4030
+ def self.from_hash(i12n)
4031
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::AbstractResource initializer', _pcore_type.i12n_type, i12n))
4032
+ end
4033
+
4034
+ def self.from_asserted_hash(i12n)
4035
+ new(
4036
+ i12n['locator'],
4037
+ i12n['offset'],
4038
+ i12n['length'],
4039
+ i12n.fetch('form') { "regular" })
4040
+ end
4041
+
4042
+ def self.create(locator, offset, length, form = "regular")
4043
+ ta = Types::TypeAsserter
4044
+ attrs = _pcore_type.attributes(true)
4045
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
4046
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
4047
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
4048
+ ta.assert_instance_of('Puppet::AST::AbstractResource[form]', attrs['form'].type, form)
4049
+ new(locator, offset, length, form)
4050
+ end
4051
+
4052
+ attr_reader :form
4053
+
4054
+ def virtual
4055
+ @form == 'virtual' || @form == 'exported'
4056
+ end
4057
+
4058
+ def exported
4059
+ @form == 'exported'
4060
+ end
4061
+
4062
+ def initialize(locator, offset, length, form = "regular")
4063
+ super(locator, offset, length)
4064
+ @hash = @hash ^ form.hash
4065
+ @form = form
4066
+ end
4067
+
4068
+ def _pcore_init_hash
4069
+ result = super
4070
+ result['form'] = @form unless @form == "regular"
4071
+ result
4072
+ end
4073
+
4074
+ def eql?(o)
4075
+ super &&
4076
+ @form.eql?(o.form)
4077
+ end
4078
+ alias == eql?
4079
+ end
4080
+
4081
+ class ResourceExpression < AbstractResource
4082
+ def self._pcore_type
4083
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ResourceExpression', {
4084
+ 'parent' => AbstractResource._pcore_type,
4085
+ 'attributes' => {
4086
+ 'type_name' => Expression._pcore_type,
4087
+ 'bodies' => {
4088
+ 'type' => Types::PArrayType.new(ResourceBody._pcore_type),
4089
+ 'value' => []
4090
+ }
4091
+ }
4092
+ })
4093
+ end
4094
+
4095
+ def self.from_hash(i12n)
4096
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::ResourceExpression initializer', _pcore_type.i12n_type, i12n))
4097
+ end
4098
+
4099
+ def self.from_asserted_hash(i12n)
4100
+ new(
4101
+ i12n['locator'],
4102
+ i12n['offset'],
4103
+ i12n['length'],
4104
+ i12n['type_name'],
4105
+ i12n.fetch('form') { "regular" },
4106
+ i12n.fetch('bodies') { _pcore_type['bodies'].value })
4107
+ end
4108
+
4109
+ def self.create(locator, offset, length, type_name, form = "regular", bodies = _pcore_type['bodies'].value)
4110
+ ta = Types::TypeAsserter
4111
+ attrs = _pcore_type.attributes(true)
4112
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
4113
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
4114
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
4115
+ ta.assert_instance_of('Puppet::AST::AbstractResource[form]', attrs['form'].type, form)
4116
+ ta.assert_instance_of('Puppet::AST::ResourceExpression[type_name]', attrs['type_name'].type, type_name)
4117
+ ta.assert_instance_of('Puppet::AST::ResourceExpression[bodies]', attrs['bodies'].type, bodies)
4118
+ new(locator, offset, length, type_name, form, bodies)
4119
+ end
4120
+
4121
+ attr_reader :type_name
4122
+ attr_reader :bodies
4123
+
4124
+ def initialize(locator, offset, length, type_name, form = "regular", bodies = _pcore_type['bodies'].value)
4125
+ super(locator, offset, length, form)
4126
+ @hash = @hash ^ type_name.hash ^ bodies.hash
4127
+ @type_name = type_name
4128
+ @bodies = bodies
4129
+ end
4130
+
4131
+ def _pcore_init_hash
4132
+ result = super
4133
+ result['type_name'] = @type_name
4134
+ result['bodies'] = @bodies unless _pcore_type['bodies'].default_value?(@bodies)
4135
+ result
4136
+ end
4137
+
4138
+ def _pcore_contents
4139
+ yield(@type_name) unless @type_name.nil?
4140
+ @bodies.each { |value| yield(value) }
4141
+ end
4142
+
4143
+ def _pcore_all_contents(path, &block)
4144
+ path << self
4145
+ unless @type_name.nil?
4146
+ block.call(@type_name, path)
4147
+ @type_name._pcore_all_contents(path, &block)
4148
+ end
4149
+ @bodies.each do |value|
4150
+ block.call(value, path)
4151
+ value._pcore_all_contents(path, &block)
4152
+ end
4153
+ path.pop
4154
+ end
4155
+
4156
+ def eql?(o)
4157
+ super &&
4158
+ @type_name.eql?(o.type_name) &&
4159
+ @bodies.eql?(o.bodies)
4160
+ end
4161
+ alias == eql?
4162
+ end
4163
+
4164
+ class CapabilityMapping < Definition
4165
+ def self._pcore_type
4166
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::CapabilityMapping', {
4167
+ 'parent' => Definition._pcore_type,
4168
+ 'attributes' => {
4169
+ 'kind' => Types::PStringType::DEFAULT,
4170
+ 'capability' => Types::PStringType::DEFAULT,
4171
+ 'component' => Expression._pcore_type,
4172
+ 'mappings' => {
4173
+ 'type' => Types::PArrayType.new(AbstractAttributeOperation._pcore_type),
4174
+ 'value' => []
4175
+ }
4176
+ }
4177
+ })
4178
+ end
4179
+
4180
+ def self.from_hash(i12n)
4181
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::CapabilityMapping initializer', _pcore_type.i12n_type, i12n))
4182
+ end
4183
+
4184
+ def self.from_asserted_hash(i12n)
4185
+ new(
4186
+ i12n['locator'],
4187
+ i12n['offset'],
4188
+ i12n['length'],
4189
+ i12n['kind'],
4190
+ i12n['capability'],
4191
+ i12n['component'],
4192
+ i12n.fetch('mappings') { _pcore_type['mappings'].value })
4193
+ end
4194
+
4195
+ def self.create(locator, offset, length, kind, capability, component, mappings = _pcore_type['mappings'].value)
4196
+ ta = Types::TypeAsserter
4197
+ attrs = _pcore_type.attributes(true)
4198
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
4199
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
4200
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
4201
+ ta.assert_instance_of('Puppet::AST::CapabilityMapping[kind]', attrs['kind'].type, kind)
4202
+ ta.assert_instance_of('Puppet::AST::CapabilityMapping[capability]', attrs['capability'].type, capability)
4203
+ ta.assert_instance_of('Puppet::AST::CapabilityMapping[component]', attrs['component'].type, component)
4204
+ ta.assert_instance_of('Puppet::AST::CapabilityMapping[mappings]', attrs['mappings'].type, mappings)
4205
+ new(locator, offset, length, kind, capability, component, mappings)
4206
+ end
4207
+
4208
+ attr_reader :kind
4209
+ attr_reader :capability
4210
+ attr_reader :component
4211
+ attr_reader :mappings
4212
+
4213
+ def initialize(locator, offset, length, kind, capability, component, mappings = _pcore_type['mappings'].value)
4214
+ super(locator, offset, length)
4215
+ @hash = @hash ^ kind.hash ^ capability.hash ^ component.hash ^ mappings.hash
4216
+ @kind = kind
4217
+ @capability = capability
4218
+ @component = component
4219
+ @mappings = mappings
4220
+ end
4221
+
4222
+ def _pcore_init_hash
4223
+ result = super
4224
+ result['kind'] = @kind
4225
+ result['capability'] = @capability
4226
+ result['component'] = @component
4227
+ result['mappings'] = @mappings unless _pcore_type['mappings'].default_value?(@mappings)
4228
+ result
4229
+ end
4230
+
4231
+ def _pcore_contents
4232
+ yield(@component) unless @component.nil?
4233
+ @mappings.each { |value| yield(value) }
4234
+ end
4235
+
4236
+ def _pcore_all_contents(path, &block)
4237
+ path << self
4238
+ unless @component.nil?
4239
+ block.call(@component, path)
4240
+ @component._pcore_all_contents(path, &block)
4241
+ end
4242
+ @mappings.each do |value|
4243
+ block.call(value, path)
4244
+ value._pcore_all_contents(path, &block)
4245
+ end
4246
+ path.pop
4247
+ end
4248
+
4249
+ def eql?(o)
4250
+ super &&
4251
+ @kind.eql?(o.kind) &&
4252
+ @capability.eql?(o.capability) &&
4253
+ @component.eql?(o.component) &&
4254
+ @mappings.eql?(o.mappings)
4255
+ end
4256
+ alias == eql?
4257
+ end
4258
+
4259
+ class ResourceDefaultsExpression < AbstractResource
4260
+ def self._pcore_type
4261
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ResourceDefaultsExpression', {
4262
+ 'parent' => AbstractResource._pcore_type,
4263
+ 'attributes' => {
4264
+ 'type_ref' => {
4265
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
4266
+ 'value' => nil
4267
+ },
4268
+ 'operations' => {
4269
+ 'type' => Types::PArrayType.new(AbstractAttributeOperation._pcore_type),
4270
+ 'value' => []
4271
+ }
4272
+ }
4273
+ })
4274
+ end
4275
+
4276
+ def self.from_hash(i12n)
4277
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::ResourceDefaultsExpression initializer', _pcore_type.i12n_type, i12n))
4278
+ end
4279
+
4280
+ def self.from_asserted_hash(i12n)
4281
+ new(
4282
+ i12n['locator'],
4283
+ i12n['offset'],
4284
+ i12n['length'],
4285
+ i12n.fetch('form') { "regular" },
4286
+ i12n['type_ref'],
4287
+ i12n.fetch('operations') { _pcore_type['operations'].value })
4288
+ end
4289
+
4290
+ def self.create(locator, offset, length, form = "regular", type_ref = nil, operations = _pcore_type['operations'].value)
4291
+ ta = Types::TypeAsserter
4292
+ attrs = _pcore_type.attributes(true)
4293
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
4294
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
4295
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
4296
+ ta.assert_instance_of('Puppet::AST::AbstractResource[form]', attrs['form'].type, form)
4297
+ ta.assert_instance_of('Puppet::AST::ResourceDefaultsExpression[type_ref]', attrs['type_ref'].type, type_ref)
4298
+ ta.assert_instance_of('Puppet::AST::ResourceDefaultsExpression[operations]', attrs['operations'].type, operations)
4299
+ new(locator, offset, length, form, type_ref, operations)
4300
+ end
4301
+
4302
+ attr_reader :type_ref
4303
+ attr_reader :operations
4304
+
4305
+ def initialize(locator, offset, length, form = "regular", type_ref = nil, operations = _pcore_type['operations'].value)
4306
+ super(locator, offset, length, form)
4307
+ @hash = @hash ^ type_ref.hash ^ operations.hash
4308
+ @type_ref = type_ref
4309
+ @operations = operations
4310
+ end
4311
+
4312
+ def _pcore_init_hash
4313
+ result = super
4314
+ result['type_ref'] = @type_ref unless @type_ref == nil
4315
+ result['operations'] = @operations unless _pcore_type['operations'].default_value?(@operations)
4316
+ result
4317
+ end
4318
+
4319
+ def _pcore_contents
4320
+ yield(@type_ref) unless @type_ref.nil?
4321
+ @operations.each { |value| yield(value) }
4322
+ end
4323
+
4324
+ def _pcore_all_contents(path, &block)
4325
+ path << self
4326
+ unless @type_ref.nil?
4327
+ block.call(@type_ref, path)
4328
+ @type_ref._pcore_all_contents(path, &block)
4329
+ end
4330
+ @operations.each do |value|
4331
+ block.call(value, path)
4332
+ value._pcore_all_contents(path, &block)
4333
+ end
4334
+ path.pop
4335
+ end
4336
+
4337
+ def eql?(o)
4338
+ super &&
4339
+ @type_ref.eql?(o.type_ref) &&
4340
+ @operations.eql?(o.operations)
4341
+ end
4342
+ alias == eql?
4343
+ end
4344
+
4345
+ class ResourceOverrideExpression < AbstractResource
4346
+ def self._pcore_type
4347
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ResourceOverrideExpression', {
4348
+ 'parent' => AbstractResource._pcore_type,
4349
+ 'attributes' => {
4350
+ 'resources' => Expression._pcore_type,
4351
+ 'operations' => {
4352
+ 'type' => Types::PArrayType.new(AbstractAttributeOperation._pcore_type),
4353
+ 'value' => []
4354
+ }
4355
+ }
4356
+ })
4357
+ end
4358
+
4359
+ def self.from_hash(i12n)
4360
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::ResourceOverrideExpression initializer', _pcore_type.i12n_type, i12n))
4361
+ end
4362
+
4363
+ def self.from_asserted_hash(i12n)
4364
+ new(
4365
+ i12n['locator'],
4366
+ i12n['offset'],
4367
+ i12n['length'],
4368
+ i12n['resources'],
4369
+ i12n.fetch('form') { "regular" },
4370
+ i12n.fetch('operations') { _pcore_type['operations'].value })
4371
+ end
4372
+
4373
+ def self.create(locator, offset, length, resources, form = "regular", operations = _pcore_type['operations'].value)
4374
+ ta = Types::TypeAsserter
4375
+ attrs = _pcore_type.attributes(true)
4376
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
4377
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
4378
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
4379
+ ta.assert_instance_of('Puppet::AST::AbstractResource[form]', attrs['form'].type, form)
4380
+ ta.assert_instance_of('Puppet::AST::ResourceOverrideExpression[resources]', attrs['resources'].type, resources)
4381
+ ta.assert_instance_of('Puppet::AST::ResourceOverrideExpression[operations]', attrs['operations'].type, operations)
4382
+ new(locator, offset, length, resources, form, operations)
4383
+ end
4384
+
4385
+ attr_reader :resources
4386
+ attr_reader :operations
4387
+
4388
+ def initialize(locator, offset, length, resources, form = "regular", operations = _pcore_type['operations'].value)
4389
+ super(locator, offset, length, form)
4390
+ @hash = @hash ^ resources.hash ^ operations.hash
4391
+ @resources = resources
4392
+ @operations = operations
4393
+ end
4394
+
4395
+ def _pcore_init_hash
4396
+ result = super
4397
+ result['resources'] = @resources
4398
+ result['operations'] = @operations unless _pcore_type['operations'].default_value?(@operations)
4399
+ result
4400
+ end
4401
+
4402
+ def _pcore_contents
4403
+ yield(@resources) unless @resources.nil?
4404
+ @operations.each { |value| yield(value) }
4405
+ end
4406
+
4407
+ def _pcore_all_contents(path, &block)
4408
+ path << self
4409
+ unless @resources.nil?
4410
+ block.call(@resources, path)
4411
+ @resources._pcore_all_contents(path, &block)
4412
+ end
4413
+ @operations.each do |value|
4414
+ block.call(value, path)
4415
+ value._pcore_all_contents(path, &block)
4416
+ end
4417
+ path.pop
4418
+ end
4419
+
4420
+ def eql?(o)
4421
+ super &&
4422
+ @resources.eql?(o.resources) &&
4423
+ @operations.eql?(o.operations)
4424
+ end
4425
+ alias == eql?
4426
+ end
4427
+
4428
+ class SelectorEntry < Positioned
4429
+ def self._pcore_type
4430
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::SelectorEntry', {
4431
+ 'parent' => Positioned._pcore_type,
4432
+ 'attributes' => {
4433
+ 'matching_expr' => Expression._pcore_type,
4434
+ 'value_expr' => Expression._pcore_type
4435
+ }
4436
+ })
4437
+ end
4438
+
4439
+ def self.from_hash(i12n)
4440
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::SelectorEntry initializer', _pcore_type.i12n_type, i12n))
4441
+ end
4442
+
4443
+ def self.from_asserted_hash(i12n)
4444
+ new(
4445
+ i12n['locator'],
4446
+ i12n['offset'],
4447
+ i12n['length'],
4448
+ i12n['matching_expr'],
4449
+ i12n['value_expr'])
4450
+ end
4451
+
4452
+ def self.create(locator, offset, length, matching_expr, value_expr)
4453
+ ta = Types::TypeAsserter
4454
+ attrs = _pcore_type.attributes(true)
4455
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
4456
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
4457
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
4458
+ ta.assert_instance_of('Puppet::AST::SelectorEntry[matching_expr]', attrs['matching_expr'].type, matching_expr)
4459
+ ta.assert_instance_of('Puppet::AST::SelectorEntry[value_expr]', attrs['value_expr'].type, value_expr)
4460
+ new(locator, offset, length, matching_expr, value_expr)
4461
+ end
4462
+
4463
+ attr_reader :matching_expr
4464
+ attr_reader :value_expr
4465
+
4466
+ def initialize(locator, offset, length, matching_expr, value_expr)
4467
+ super(locator, offset, length)
4468
+ @hash = @hash ^ matching_expr.hash ^ value_expr.hash
4469
+ @matching_expr = matching_expr
4470
+ @value_expr = value_expr
4471
+ end
4472
+
4473
+ def _pcore_init_hash
4474
+ result = super
4475
+ result['matching_expr'] = @matching_expr
4476
+ result['value_expr'] = @value_expr
4477
+ result
4478
+ end
4479
+
4480
+ def _pcore_contents
4481
+ yield(@matching_expr) unless @matching_expr.nil?
4482
+ yield(@value_expr) unless @value_expr.nil?
4483
+ end
4484
+
4485
+ def _pcore_all_contents(path, &block)
4486
+ path << self
4487
+ unless @matching_expr.nil?
4488
+ block.call(@matching_expr, path)
4489
+ @matching_expr._pcore_all_contents(path, &block)
4490
+ end
4491
+ unless @value_expr.nil?
4492
+ block.call(@value_expr, path)
4493
+ @value_expr._pcore_all_contents(path, &block)
4494
+ end
4495
+ path.pop
4496
+ end
4497
+
4498
+ def eql?(o)
4499
+ super &&
4500
+ @matching_expr.eql?(o.matching_expr) &&
4501
+ @value_expr.eql?(o.value_expr)
4502
+ end
4503
+ alias == eql?
4504
+ end
4505
+
4506
+ class SelectorExpression < Expression
4507
+ def self._pcore_type
4508
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::SelectorExpression', {
4509
+ 'parent' => Expression._pcore_type,
4510
+ 'attributes' => {
4511
+ 'left_expr' => Expression._pcore_type,
4512
+ 'selectors' => {
4513
+ 'type' => Types::PArrayType.new(SelectorEntry._pcore_type),
4514
+ 'value' => []
4515
+ }
4516
+ }
4517
+ })
4518
+ end
4519
+
4520
+ def self.from_hash(i12n)
4521
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::SelectorExpression initializer', _pcore_type.i12n_type, i12n))
4522
+ end
4523
+
4524
+ def self.from_asserted_hash(i12n)
4525
+ new(
4526
+ i12n['locator'],
4527
+ i12n['offset'],
4528
+ i12n['length'],
4529
+ i12n['left_expr'],
4530
+ i12n.fetch('selectors') { _pcore_type['selectors'].value })
4531
+ end
4532
+
4533
+ def self.create(locator, offset, length, left_expr, selectors = _pcore_type['selectors'].value)
4534
+ ta = Types::TypeAsserter
4535
+ attrs = _pcore_type.attributes(true)
4536
+ ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
4537
+ ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
4538
+ ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
4539
+ ta.assert_instance_of('Puppet::AST::SelectorExpression[left_expr]', attrs['left_expr'].type, left_expr)
4540
+ ta.assert_instance_of('Puppet::AST::SelectorExpression[selectors]', attrs['selectors'].type, selectors)
4541
+ new(locator, offset, length, left_expr, selectors)
4542
+ end
4543
+
4544
+ attr_reader :left_expr
4545
+ attr_reader :selectors
4546
+
4547
+ def initialize(locator, offset, length, left_expr, selectors = _pcore_type['selectors'].value)
4548
+ super(locator, offset, length)
4549
+ @hash = @hash ^ left_expr.hash ^ selectors.hash
4550
+ @left_expr = left_expr
4551
+ @selectors = selectors
4552
+ end
4553
+
4554
+ def _pcore_init_hash
4555
+ result = super
4556
+ result['left_expr'] = @left_expr
4557
+ result['selectors'] = @selectors unless _pcore_type['selectors'].default_value?(@selectors)
4558
+ result
4559
+ end
4560
+
4561
+ def _pcore_contents
4562
+ yield(@left_expr) unless @left_expr.nil?
4563
+ @selectors.each { |value| yield(value) }
4564
+ end
4565
+
4566
+ def _pcore_all_contents(path, &block)
4567
+ path << self
4568
+ unless @left_expr.nil?
4569
+ block.call(@left_expr, path)
4570
+ @left_expr._pcore_all_contents(path, &block)
4571
+ end
4572
+ @selectors.each do |value|
4573
+ block.call(value, path)
4574
+ value._pcore_all_contents(path, &block)
4575
+ end
4576
+ path.pop
4577
+ end
4578
+
4579
+ def eql?(o)
4580
+ super &&
4581
+ @left_expr.eql?(o.left_expr) &&
4582
+ @selectors.eql?(o.selectors)
4583
+ end
4584
+ alias == eql?
4585
+ end
4586
+
4587
+ class NamedAccessExpression < BinaryExpression
4588
+ def self._pcore_type
4589
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::NamedAccessExpression', {
4590
+ 'parent' => BinaryExpression._pcore_type
4591
+ })
4592
+ end
4593
+
4594
+ def _pcore_contents
4595
+ yield(@left_expr) unless @left_expr.nil?
4596
+ yield(@right_expr) unless @right_expr.nil?
4597
+ end
4598
+
4599
+ def _pcore_all_contents(path, &block)
4600
+ path << self
4601
+ unless @left_expr.nil?
4602
+ block.call(@left_expr, path)
4603
+ @left_expr._pcore_all_contents(path, &block)
4604
+ end
4605
+ unless @right_expr.nil?
4606
+ block.call(@right_expr, path)
4607
+ @right_expr._pcore_all_contents(path, &block)
4608
+ end
4609
+ path.pop
4610
+ end
4611
+ end
4612
+
4613
+ class Program < PopsObject
4614
+ def self._pcore_type
4615
+ @_pcore_type ||= Types::PObjectType.new('Puppet::AST::Program', {
4616
+ 'parent' => PopsObject._pcore_type,
4617
+ 'attributes' => {
4618
+ 'body' => {
4619
+ 'type' => Types::POptionalType.new(Expression._pcore_type),
4620
+ 'value' => nil
4621
+ },
4622
+ 'definitions' => {
4623
+ 'type' => Types::PArrayType.new(Definition._pcore_type),
4624
+ 'kind' => 'reference',
4625
+ 'value' => []
4626
+ },
4627
+ 'source_text' => {
4628
+ 'type' => Types::PStringType::DEFAULT,
4629
+ 'kind' => 'derived'
4630
+ },
4631
+ 'source_ref' => {
4632
+ 'type' => Types::PStringType::DEFAULT,
4633
+ 'kind' => 'derived'
4634
+ },
4635
+ 'line_offsets' => {
4636
+ 'type' => Types::PArrayType.new(Types::PIntegerType::DEFAULT),
4637
+ 'kind' => 'derived'
4638
+ },
4639
+ 'locator' => Parser::Locator::Locator19._pcore_type
4640
+ }
4641
+ })
4642
+ end
4643
+
4644
+ def self.from_hash(i12n)
4645
+ from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::Program initializer', _pcore_type.i12n_type, i12n))
4646
+ end
4647
+
4648
+ def self.from_asserted_hash(i12n)
4649
+ new(
4650
+ i12n['locator'],
4651
+ i12n['body'],
4652
+ i12n.fetch('definitions') { _pcore_type['definitions'].value })
4653
+ end
4654
+
4655
+ def self.create(locator, body = nil, definitions = _pcore_type['definitions'].value)
4656
+ ta = Types::TypeAsserter
4657
+ attrs = _pcore_type.attributes(true)
4658
+ ta.assert_instance_of('Puppet::AST::Program[body]', attrs['body'].type, body)
4659
+ ta.assert_instance_of('Puppet::AST::Program[definitions]', attrs['definitions'].type, definitions)
4660
+ ta.assert_instance_of('Puppet::AST::Program[locator]', attrs['locator'].type, locator)
4661
+ new(locator, body, definitions)
4662
+ end
4663
+
4664
+ attr_reader :body
4665
+ attr_reader :definitions
4666
+ attr_reader :locator
4667
+
4668
+ def source_text
4669
+ @locator.string
4670
+ end
4671
+
4672
+ def source_ref
4673
+ @locator.file
4674
+ end
4675
+
4676
+ def line_offsets
4677
+ @locator.line_index
4678
+ end
4679
+
4680
+ def initialize(locator, body = nil, definitions = _pcore_type['definitions'].value)
4681
+ super()
4682
+ @hash = @hash ^ body.hash ^ definitions.hash ^ locator.hash
4683
+ @body = body
4684
+ @definitions = definitions
4685
+ @locator = locator
4686
+ end
4687
+
4688
+ def _pcore_init_hash
4689
+ result = super
4690
+ result['body'] = @body unless @body == nil
4691
+ result['definitions'] = @definitions unless _pcore_type['definitions'].default_value?(@definitions)
4692
+ result['locator'] = @locator
4693
+ result
4694
+ end
4695
+
4696
+ def _pcore_contents
4697
+ yield(@body) unless @body.nil?
4698
+ yield(@locator) unless @locator.nil?
4699
+ end
4700
+
4701
+ def _pcore_all_contents(path, &block)
4702
+ path << self
4703
+ unless @body.nil?
4704
+ block.call(@body, path)
4705
+ @body._pcore_all_contents(path, &block)
4706
+ end
4707
+ unless @locator.nil?
4708
+ block.call(@locator, path)
4709
+ @locator._pcore_all_contents(path, &block)
4710
+ end
4711
+ path.pop
4712
+ end
4713
+
4714
+ def eql?(o)
4715
+ super &&
4716
+ @body.eql?(o.body) &&
4717
+ @definitions.eql?(o.definitions) &&
4718
+ @locator.eql?(o.locator)
4719
+ end
4720
+ alias == eql?
4721
+ end
4722
+
4723
+ end
4724
+ module Model
4725
+ @@pcore_ast_initialized = false
4726
+ def self.register_pcore_types
4727
+ return if @@pcore_ast_initialized
4728
+ @@pcore_ast_initialized = true
4729
+ all_types = [
4730
+ Parser::Locator::Locator19,
4731
+ Model::PopsObject,
4732
+ Model::Positioned,
4733
+ Model::Expression,
4734
+ Model::Nop,
4735
+ Model::BinaryExpression,
4736
+ Model::UnaryExpression,
4737
+ Model::ParenthesizedExpression,
4738
+ Model::NotExpression,
4739
+ Model::UnaryMinusExpression,
4740
+ Model::UnfoldExpression,
4741
+ Model::AssignmentExpression,
4742
+ Model::ArithmeticExpression,
4743
+ Model::RelationshipExpression,
4744
+ Model::AccessExpression,
4745
+ Model::ComparisonExpression,
4746
+ Model::MatchExpression,
4747
+ Model::InExpression,
4748
+ Model::BooleanExpression,
4749
+ Model::AndExpression,
4750
+ Model::OrExpression,
4751
+ Model::LiteralList,
4752
+ Model::KeyedEntry,
4753
+ Model::LiteralHash,
4754
+ Model::BlockExpression,
4755
+ Model::CaseOption,
4756
+ Model::CaseExpression,
4757
+ Model::QueryExpression,
4758
+ Model::ExportedQuery,
4759
+ Model::VirtualQuery,
4760
+ Model::AbstractAttributeOperation,
4761
+ Model::AttributeOperation,
4762
+ Model::AttributesOperation,
4763
+ Model::CollectExpression,
4764
+ Model::Parameter,
4765
+ Model::Definition,
4766
+ Model::NamedDefinition,
4767
+ Model::FunctionDefinition,
4768
+ Model::ResourceTypeDefinition,
4769
+ Model::Application,
4770
+ Model::QRefDefinition,
4771
+ Model::TypeAlias,
4772
+ Model::TypeMapping,
4773
+ Model::TypeDefinition,
4774
+ Model::NodeDefinition,
4775
+ Model::SiteDefinition,
4776
+ Model::SubLocatedExpression,
4777
+ Model::HeredocExpression,
4778
+ Model::HostClassDefinition,
4779
+ Model::LambdaExpression,
4780
+ Model::IfExpression,
4781
+ Model::UnlessExpression,
4782
+ Model::CallExpression,
4783
+ Model::CallFunctionExpression,
4784
+ Model::CallNamedFunctionExpression,
4785
+ Model::CallMethodExpression,
4786
+ Model::Literal,
4787
+ Model::LiteralValue,
4788
+ Model::LiteralRegularExpression,
4789
+ Model::LiteralString,
4790
+ Model::LiteralNumber,
4791
+ Model::LiteralInteger,
4792
+ Model::LiteralFloat,
4793
+ Model::LiteralUndef,
4794
+ Model::LiteralDefault,
4795
+ Model::LiteralBoolean,
4796
+ Model::TextExpression,
4797
+ Model::ConcatenatedString,
4798
+ Model::QualifiedName,
4799
+ Model::ReservedWord,
4800
+ Model::QualifiedReference,
4801
+ Model::VariableExpression,
4802
+ Model::EppExpression,
4803
+ Model::RenderStringExpression,
4804
+ Model::RenderExpression,
4805
+ Model::ResourceBody,
4806
+ Model::AbstractResource,
4807
+ Model::ResourceExpression,
4808
+ Model::CapabilityMapping,
4809
+ Model::ResourceDefaultsExpression,
4810
+ Model::ResourceOverrideExpression,
4811
+ Model::SelectorEntry,
4812
+ Model::SelectorExpression,
4813
+ Model::NamedAccessExpression,
4814
+ Model::Program]
4815
+
4816
+ # Create and register a TypeSet that corresponds to all types in the AST model
4817
+ types_map = {}
4818
+ all_types.each do |type|
4819
+ types_map[type._pcore_type.simple_name] = type._pcore_type
4820
+ end
4821
+ type_set = Types::PTypeSetType.new({
4822
+ 'name' => 'Puppet::AST',
4823
+ 'pcore_version' => '1.0.0',
4824
+ 'types' => types_map
4825
+ })
4826
+ loc = Puppet::Util.path_to_uri("#{__FILE__}")
4827
+ Loaders.static_loader.set_entry(Loader::TypedName.new(:type, 'puppet::ast', Pcore::RUNTIME_NAME_AUTHORITY), type_set, URI("#{loc}?line=1"))
4828
+ Loaders.register_static_implementations(all_types)
4829
+ end
4830
+ end
4831
+
4832
+ end
4833
+ end