ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilDclTokenizer Class Reference

Class ilDclTokenizer. More...

+ Collaboration diagram for ilDclTokenizer:

Static Public Member Functions

static getTokens ($expression)
 
static getMathTokens ($math_expression)
 Generate tokens for a math expression. More...
 

Detailed Description

Member Function Documentation

◆ getMathTokens()

static ilDclTokenizer::getMathTokens (   $math_expression)
static

Generate tokens for a math expression.

Parameters
string$math_expressionExpression of type math
Returns
array

Definition at line 47 of file class.ilDclTokenizer.php.

47 {
48 $operators = array_keys(ilDclExpressionParser::getOperators());
49 $pattern = '#((^\[\[)[\d\.]+)|(\‍(|\‍)|\\' . implode("|\\", $operators) . ')#';
50 $tokens = preg_split($pattern, $math_expression, - 1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
51
52 return array_map('trim', $tokens);
53 }
echo;exit;}function LogoutNotification($SessionID) { global $ilDB; $q="SELECT session_id, data FROM usr_session WHERE expires > (\w+)\|/" PREG_SPLIT_NO_EMPTY PREG_SPLIT_DELIM_CAPTURE

References ilDclExpressionParser\getOperators(), and PREG_SPLIT_DELIM_CAPTURE.

Referenced by ilDclExpressionParser\parse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTokens()

static ilDclTokenizer::getTokens (   $expression)
static
       Split expression by & (ignore escaped &-symbols with backslash)

       @param string $expression Global expression to parse

!!!DIC refactoring-script warning.!!! There is an isolated 'global' whithout any variable behind. Either this is a comment, or something is seriously wrong

       @return array

Definition at line 21 of file class.ilDclTokenizer.php.

21 {
22 $expression = ltrim($expression, '=');
23 $expression = trim($expression);
24 preg_match_all("/([^\\\\&]|\\\\&)*/ui", $expression, $matches);
25
26 $results = $matches[0];
27
28 $return = array();
29 foreach ($results as $r) {
30 if (!$r) {
31 continue;
32 }
33 $return[] = str_ireplace('\&', '&', $r);
34 }
35
36 return array_map('trim', $return);
37 }
$r
Definition: example_031.php:79
$results

References $r, and $results.

Referenced by ilDclExpressionParser\parse().

+ Here is the caller graph for this function:

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