Module: Puppet::Pops::Model

Defined in:
lib/puppet/pops.rb,
lib/puppet/pops/model/ast.rb,
lib/puppet/pops/model/ast.rb,
lib/puppet/pops/model/factory.rb,
lib/puppet/pops/model/model_label_provider.rb

Defined Under Namespace

Classes: AbstractAttributeOperation, AbstractResource, AccessExpression, AndExpression, Application, ArithmeticExpression, AssignmentExpression, AstTransformer, AttributeOperation, AttributesOperation, BinaryExpression, BlockExpression, BooleanExpression, CallExpression, CallFunctionExpression, CallMethodExpression, CallNamedFunctionExpression, CapabilityMapping, CaseExpression, CaseOption, CollectExpression, ComparisonExpression, ConcatenatedString, Definition, EppExpression, ExportedQuery, Expression, Factory, FunctionDefinition, HeredocExpression, HostClassDefinition, IfExpression, InExpression, KeyedEntry, LambdaExpression, Literal, LiteralBoolean, LiteralDefault, LiteralFloat, LiteralHash, LiteralInteger, LiteralList, LiteralNumber, LiteralRegularExpression, LiteralString, LiteralUndef, LiteralValue, MatchExpression, ModelLabelProvider, ModelTreeDumper, NamedAccessExpression, NamedDefinition, NodeDefinition, Nop, NotExpression, OrExpression, Parameter, ParenthesizedExpression, PopsObject, Positioned, Program, QRefDefinition, QualifiedName, QualifiedReference, QueryExpression, RelationshipExpression, RenderExpression, RenderStringExpression, ReservedWord, ResourceBody, ResourceDefaultsExpression, ResourceExpression, ResourceOverrideExpression, ResourceTypeDefinition, SelectorEntry, SelectorExpression, SiteDefinition, SubLocatedExpression, TextExpression, TreeDumper, TypeAlias, TypeDefinition, TypeMapping, UnaryExpression, UnaryMinusExpression, UnfoldExpression, UnlessExpression, VariableExpression, VirtualQuery

Constant Summary collapse

@@pcore_ast_initialized =
false

Class Method Summary collapse

Class Method Details

.register_pcore_typesObject



4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
# File 'lib/puppet/pops/model/ast.rb', line 4730

def self.register_pcore_types
  return if @@pcore_ast_initialized
  @@pcore_ast_initialized = true
  all_types = [
  Parser::Locator::Locator19,
  Model::PopsObject,
  Model::Positioned,
  Model::Expression,
  Model::Nop,
  Model::BinaryExpression,
  Model::UnaryExpression,
  Model::ParenthesizedExpression,
  Model::NotExpression,
  Model::UnaryMinusExpression,
  Model::UnfoldExpression,
  Model::AssignmentExpression,
  Model::ArithmeticExpression,
  Model::RelationshipExpression,
  Model::AccessExpression,
  Model::ComparisonExpression,
  Model::MatchExpression,
  Model::InExpression,
  Model::BooleanExpression,
  Model::AndExpression,
  Model::OrExpression,
  Model::LiteralList,
  Model::KeyedEntry,
  Model::LiteralHash,
  Model::BlockExpression,
  Model::CaseOption,
  Model::CaseExpression,
  Model::QueryExpression,
  Model::ExportedQuery,
  Model::VirtualQuery,
  Model::AbstractAttributeOperation,
  Model::AttributeOperation,
  Model::AttributesOperation,
  Model::CollectExpression,
  Model::Parameter,
  Model::Definition,
  Model::NamedDefinition,
  Model::FunctionDefinition,
  Model::ResourceTypeDefinition,
  Model::Application,
  Model::QRefDefinition,
  Model::TypeAlias,
  Model::TypeMapping,
  Model::TypeDefinition,
  Model::NodeDefinition,
  Model::SiteDefinition,
  Model::SubLocatedExpression,
  Model::HeredocExpression,
  Model::HostClassDefinition,
  Model::LambdaExpression,
  Model::IfExpression,
  Model::UnlessExpression,
  Model::CallExpression,
  Model::CallFunctionExpression,
  Model::CallNamedFunctionExpression,
  Model::CallMethodExpression,
  Model::Literal,
  Model::LiteralValue,
  Model::LiteralRegularExpression,
  Model::LiteralString,
  Model::LiteralNumber,
  Model::LiteralInteger,
  Model::LiteralFloat,
  Model::LiteralUndef,
  Model::LiteralDefault,
  Model::LiteralBoolean,
  Model::TextExpression,
  Model::ConcatenatedString,
  Model::QualifiedName,
  Model::ReservedWord,
  Model::QualifiedReference,
  Model::VariableExpression,
  Model::EppExpression,
  Model::RenderStringExpression,
  Model::RenderExpression,
  Model::ResourceBody,
  Model::AbstractResource,
  Model::ResourceExpression,
  Model::CapabilityMapping,
  Model::ResourceDefaultsExpression,
  Model::ResourceOverrideExpression,
  Model::SelectorEntry,
  Model::SelectorExpression,
  Model::NamedAccessExpression,
  Model::Program]

  # Create and register a TypeSet that corresponds to all types in the AST model
  types_map = {}
  all_types.each do |type|
    types_map[type._pcore_type.simple_name] = type._pcore_type
  end
  type_set = Types::PTypeSetType.new({
    'name' => 'Puppet::AST',
    'pcore_version' => '1.0.0',
    'types' => types_map
  })
  loc = Puppet::Util.path_to_uri("#{__FILE__}")
  Loaders.static_loader.set_entry(Loader::TypedName.new(:type, 'puppet::ast', Pcore::RUNTIME_NAME_AUTHORITY), type_set, URI("#{loc}?line=1"))
  Loaders.register_static_implementations(all_types)
end