class SingleByteStringManipulation extends AbstractConvertor

Properties

protected RecursiveParser $parser from  AbstractRecursiveMatcher

Methods

void
__construct(RecursiveParser $parser)

No description

mixed
recurse(string $str, string $restrict = '')

Parse given string and return its value

string
getAttributeName(string $expr)

Retrieve the attribute name from an attribute expression

string
normalizeNumber(string $sign, string $number)

Normalize a number representation

array
getMatchers()

Return the matchers configuration

string
parseConcat(string $expr1, string $expr2 = null)

Convert a call to concat()

string
parseNormalizeSpace(string $expr)

Convert a call to normalize-space()

string
parseSubstringAfter(string $expr, string $str)

Convert a call to substring-after() where the second argument is a literal string

string
parseSubstringBefore(string $expr1, string $expr2)

Convert a call to substring-before()

string
parseTranslate(string $expr, string $from, string $to)

Convert a call to translate() where the second and third arguments are literal strings

bool
isAsciiChars(array $chars)

Test whether given list of strings contains only single ASCII characters

string
serializeAsciiChars(array $chars)

Serialize a list of ASCII chars into a single PHP string

string
serializeMap(array $from, array $to)

Serialize the lists of characters to replace with strtr()

string[]
splitStringChars(string $string)

Split individual characters from given literal string

Details

void __construct(RecursiveParser $parser)

No description

Parameters

RecursiveParser $parser

Return Value

void

protected mixed recurse(string $str, string $restrict = '')

Parse given string and return its value

Parameters

string $str
string $restrict

Pipe-separated list of allowed matches (ignored if empty)

Return Value

mixed

in AbstractConvertor at line 20
protected string getAttributeName(string $expr)

Retrieve the attribute name from an attribute expression

Parameters

string $expr

XPath expression for an attribute, e.g. '@foo'

Return Value

string

Attribute name, e.g. 'foo'

in AbstractConvertor at line 32
protected string normalizeNumber(string $sign, string $number)

Normalize a number representation

Parameters

string $sign
string $number

Return Value

string

at line 15
array getMatchers()

Return the matchers configuration

Match name as key. Can be prefixed with a colon-separated list of groups, e.g. "Group:Name". Value must be a string or an array with the following elements:

  • regexp: the regular expression used to match input.
  • order: used to sort matchers. Defaults to 0.
  • groups: list of groups this match belongs to. Defaults to an empty array.
  • callback: called with the matched strings. Defaults to [$this, "parseX"] where X is the match name.

If the config is a string, the string is used for the "regexp" element.

Return Value

array

at line 33
string parseConcat(string $expr1, string $expr2 = null)

Convert a call to concat()

Parameters

string $expr1

First argument

string $expr2

All other comma-separated arguments, starting with a comma

Return Value

string

at line 50
string parseNormalizeSpace(string $expr)

Convert a call to normalize-space()

Parameters

string $expr

Return Value

string

at line 62
string parseSubstringAfter(string $expr, string $str)

Convert a call to substring-after() where the second argument is a literal string

Parameters

string $expr
string $str

Return Value

string

at line 74
string parseSubstringBefore(string $expr1, string $expr2)

Convert a call to substring-before()

Parameters

string $expr1
string $expr2

Return Value

string

at line 87
string parseTranslate(string $expr, string $from, string $to)

Convert a call to translate() where the second and third arguments are literal strings

Parameters

string $expr
string $from
string $to

Return Value

string

at line 118
protected bool isAsciiChars(array $chars)

Test whether given list of strings contains only single ASCII characters

Parameters

array $chars

Return Value

bool

at line 129
protected string serializeAsciiChars(array $chars)

Serialize a list of ASCII chars into a single PHP string

Parameters

array $chars

Return Value

string

at line 141
protected string serializeMap(array $from, array $to)

Serialize the lists of characters to replace with strtr()

Parameters

array $from
array $to

Return Value

string

at line 158
protected string[] splitStringChars(string $string)

Split individual characters from given literal string

Parameters

string $string

Original string, including quotes

Return Value

string[]