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/pn_transformer.rb,
lib/puppet/pops/model/model_label_provider.rb

Defined Under Namespace

Classes: AbstractAttributeOperation, AbstractResource, AccessExpression, AndExpression, Application, ApplyBlockExpression, ApplyExpression, 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, PNTransformer, Parameter, ParenthesizedExpression, PlanDefinition, 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


4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
# File 'lib/puppet/pops/model/ast.rb', line 4854

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::ApplyBlockExpression,
  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::PlanDefinition,
  Model::LambdaExpression,
  Model::ApplyExpression,
  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