Class: Mutant::AST::Regexp::Transformer Private

Inherits:
Object
  • Object
show all
Includes:
AbstractType
Defined in:
lib/mutant/ast/regexp/transformer.rb,
lib/mutant/ast/regexp/transformer/root.rb,
lib/mutant/ast/regexp/transformer/text.rb,
lib/mutant/ast/regexp/transformer/direct.rb,
lib/mutant/ast/regexp/transformer/recursive.rb,
lib/mutant/ast/regexp/transformer/quantifier.rb,
lib/mutant/ast/regexp/transformer/alternative.rb,
lib/mutant/ast/regexp/transformer/character_set.rb,
lib/mutant/ast/regexp/transformer/options_group.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Regexp bijective mapper

Transforms parsed regular expression representation from ‘Regexp::Expression` instances (provided by `regexp_parser`) into equivalent representations using `Parser::AST::Node`

Defined Under Namespace

Modules: LookupTable Classes: ASTToExpression, Alternative, CharacterSet, Direct, ExpressionToAST, OptionsGroup, Quantifier, Recursive, Root, Text

Constant Summary collapse

REGISTRY =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Registry.new

Class Method Summary collapse

Class Method Details

.lookup(type) ⇒ Class<Transformer>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Lookup transformer class for regular expression node type



19
20
21
# File 'lib/mutant/ast/regexp/transformer.rb', line 19

def self.lookup(type)
  REGISTRY.lookup(type)
end

.to_ast(expression) ⇒ Parser::AST::Node

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Transform expression



38
39
40
# File 'lib/mutant/ast/regexp/transformer.rb', line 38

def self.to_ast(expression)
  self::ExpressionToAST.call(expression)
end

.to_expression(node) ⇒ Regexp::Expression

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Transform node



47
48
49
# File 'lib/mutant/ast/regexp/transformer.rb', line 47

def self.to_expression(node)
  self::ASTToExpression.call(node)
end