openvox 8.19.0

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