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
28 29 30 |
# File 'lib/puppet/parser/parser_factory.rb', line 28 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.
20 21 22 23 24 25 26 |
# File 'lib/puppet/parser/parser_factory.rb', line 20 def self.evaluating_parser unless defined?(Puppet::Parser::E4ParserAdapter) require_relative '../../puppet/parser/e4_parser_adapter' require_relative '../../puppet/pops/parser/code_merger' end E4ParserAdapter.new end |
.parser ⇒ Object
Produces a parser instance for the given environment
13 14 15 |
# File 'lib/puppet/parser/parser_factory.rb', line 13 def self.parser evaluating_parser end |