Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\Parser Class Reference

Parser for transformation specifications. More...

## Public Member Functions
| __construct ()
| Construct. More...
| parse ($file)
| Parse the specified transformation file into an AST. More...
| parseString ($string)
| Parse the given string into an AST. More...

## Protected Member Functions
| tokenize ($string)
| Tokenize transformation input file. More...
| filterValues (array $data)
| Filter out numeric array keys. More...

## Protected Attributes
| $tokenSpecifications = null

## Detailed Description

Parser for transformation specifications.

The transformation specifications look like:

CF = CF... : Map from one char to one or more chars (map) CF - CF = CF... : Map range of chars to one or more chars (replace) CF - CF +- xx : Transpose several chars by value xx (transpose) CF - CF % yy +- xx : Transpose several chars by value xx, yy denotes skip value yy equal to 1 is the same as 'transpose' (transpose-modulo) TI[,TI...] :

CF = Character Format TI = Transform Identifier

Character formats: U+xxxx : Unicode value in hexadecimal xx: Ascii value in hexadecimal remove : Remove character from result, can only be used in destination keep : Keep character as it is, can only be used in destination "xxxx" : Multiple characters as a string, can only be used in destination, \ means \ and " means "

Definition at line 34 of file Persistence/TransformationProcessor/DefinitionBased/Parser.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\Parser::__construct | ( |  | ) |

Construct.

Definition at line 49 of file Persistence/TransformationProcessor/DefinitionBased/Parser.php.

References eZ\Publish\Core\Persistence\TransformationProcessor\T_COMMENT, eZ\Publish\Core\Persistence\TransformationProcessor\T_MAP, eZ\Publish\Core\Persistence\TransformationProcessor\T_REPLACE, eZ\Publish\Core\Persistence\TransformationProcessor\T_SECTION, eZ\Publish\Core\Persistence\TransformationProcessor\T_TRANSPOSE, eZ\Publish\Core\Persistence\TransformationProcessor\T_TRANSPOSE_MODULO, and eZ\Publish\Core\Persistence\TransformationProcessor\T_WHITESPACE.

## Member Function Documentation

## ◆ filterValues()

eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\Parser::filterValues | ( | array | $data | ) |
| protected

Filter out numeric array keys.

Parameters

  array | $data |

Returns
  array

Definition at line 172 of file Persistence/TransformationProcessor/DefinitionBased/Parser.php.

Referenced by eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\Parser\tokenize().

## ◆ parse()

eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\Parser::parse | ( |  | $file | ) |

Parse the specified transformation file into an AST.

Parameters

  string | $file |

Returns
  array

Definition at line 80 of file Persistence/TransformationProcessor/DefinitionBased/Parser.php.

References eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\Parser\parseString().

## ◆ parseString()

eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\Parser::parseString | ( |  | $string | ) |

Parse the given string into an AST.

Parameters

  string | $string |

Returns
  array

Definition at line 94 of file Persistence/TransformationProcessor/DefinitionBased/Parser.php.

References eZ\Publish\Core\Persistence\TransformationProcessor\T_COMMENT, eZ\Publish\Core\Persistence\TransformationProcessor\T_SECTION, eZ\Publish\Core\Persistence\TransformationProcessor\T_WHITESPACE, and eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\Parser\tokenize().

Referenced by eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\Parser\parse().

## ◆ tokenize()

eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\Parser::tokenize | ( |  | $string | ) |
| protected

Tokenize transformation input file.

Returns an array of tokens

Parameters

  string | $string |

Returns
  array

Definition at line 133 of file Persistence/TransformationProcessor/DefinitionBased/Parser.php.

References eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\Parser\filterValues().

Referenced by eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\Parser\parseString().

## Member Data Documentation

## ◆ $tokenSpecifications

eZ\Publish\Core\Persistence\TransformationProcessor\DefinitionBased\Parser::$tokenSpecifications = null
| protected

Definition at line 44 of file Persistence/TransformationProcessor/DefinitionBased/Parser.php.

The documentation for this class was generated from the following file:

- Persistence/TransformationProcessor/DefinitionBased/Parser.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.