Class: Mutest::AST::Regexp::Transformer Private

Inherits:
Object
  • Object
show all
Includes:
AbstractType
Defined in:
lib/mutest/ast/regexp/transformer.rb,
lib/mutest/ast/regexp/transformer/root.rb,
lib/mutest/ast/regexp/transformer/text.rb,
lib/mutest/ast/regexp/transformer/direct.rb,
lib/mutest/ast/regexp/transformer/recursive.rb,
lib/mutest/ast/regexp/transformer/quantifier.rb,
lib/mutest/ast/regexp/transformer/alternative.rb,
lib/mutest/ast/regexp/transformer/character_set.rb,
lib/mutest/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

Parameters:

  • type (Symbol)

Returns:



19
20
21
# File 'lib/mutest/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

Parameters:

  • expression (Regexp::Expression::Base)

Returns:

  • (Parser::AST::Node)


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

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

.to_expression(node) ⇒ Regexp::Expression::Base

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

Parameters:

  • node (Parser::AST::Node)

Returns:

  • (Regexp::Expression::Base)


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

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