Class: Puppet::Parser::ParserFactory
- Defined in:
- lib/puppet/parser/parser_factory.rb
Overview
The ParserFactory makes selection of parser possible. Currently, it is possible to switch between two different parsers:
-
classic_parser, the parser in 3.1
-
eparser, the Expression Based Parser
Class Method Summary collapse
- .code_merger ⇒ Object
-
.evaluating_parser ⇒ Object
Creates an instance of an E4ParserAdapter that adapts an EvaluatingParser to the 3x way of parsing.
-
.parser ⇒ Object
Produces a parser instance for the given environment.
Class Method Details
.code_merger ⇒ Object
26 27 28 |
# File 'lib/puppet/parser/parser_factory.rb', line 26 def self.code_merger Puppet::Pops::Parser::CodeMerger.new end |
.evaluating_parser ⇒ Object
Creates an instance of an E4ParserAdapter that adapts an EvaluatingParser to the 3x way of parsing.
18 19 20 21 22 23 24 |
# File 'lib/puppet/parser/parser_factory.rb', line 18 def self.evaluating_parser unless defined?(Puppet::Pops::Parser::E4ParserAdapter) require 'puppet/parser/e4_parser_adapter' require 'puppet/pops/parser/code_merger' end E4ParserAdapter.new end |
.parser ⇒ Object
Produces a parser instance for the given environment
11 12 13 |
# File 'lib/puppet/parser/parser_factory.rb', line 11 def self.parser evaluating_parser end |