openvox 7.37.1

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