| 
    ILIAS
    release_8 Revision v8.24
    
   | 
  
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...
 Collaboration diagram for ilDclExpressionParser:Public Member Functions | |
| __construct (string $expression, ilDclBaseRecordModel $record, ilDclBaseFieldModel $field) | |
| parse () | |
| Parse expression and return result.  More... | |
Static Public Member Functions | |
| static | getOperators () | 
| static | getFunctions () | 
Data Fields | |
| const | N_DECIMALS = 1 | 
| const | SCIENTIFIC_NOTATION_UPPER = 1000000000000 | 
| const | SCIENTIFIC_NOTATION_LOWER = 0.000000001 | 
Protected Member Functions | |
| formatScientific ($value) | |
| isMathToken (string $token) | |
| Check if a given token is a math expression.  More... | |
| calculateFunctions (string $token) | |
| Execute any math functions inside a token.  More... | |
| getFunctionArgs (int $index, array $data) | |
| Helper method to return the function and its arguments from a preg_replace_all $result array.  More... | |
| substituteFieldValues (array $tokens) | |
| Given an array of tokens, replace each token that is a placeholder (e.g.  More... | |
| parseMath (array $tokens) | |
| Parse a math expression.  More... | |
| calculateFunction (string $function, array $args=array()) | |
| Calculate a function with its arguments.  More... | |
| calculate (string $operator, $left, $right) | |
Protected Attributes | |
| ilDclBaseRecordModel | $record | 
| ilDclBaseFieldModel | $field | 
| string | $expression | 
Static Protected Attributes | |
| static array | $operators | 
| static array | $cache_tokens = array() | 
| static array | $cache_fields = array() | 
| static array | $cache_math_tokens = array() | 
| static array | $cache_math_function_tokens = array() | 
| static array | $functions | 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.
If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning
Definition at line 19 of file class.ilDclExpressionParser.php.
| ilDclExpressionParser::__construct | ( | string | $expression, | 
| ilDclBaseRecordModel | $record, | ||
| ilDclBaseFieldModel | $field | ||
| ) | 
Definition at line 48 of file class.ilDclExpressionParser.php.
References $expression, $field, and $record.
      
  | 
  protected | 
| string | $operator | |
| float | int | $left | |
| float | int | $right | 
| ilException | 
Definition at line 355 of file class.ilDclExpressionParser.php.
Referenced by parseMath().
 Here is the caller graph for this function:
      
  | 
  protected | 
Calculate a function with its arguments.
| ilException | 
Definition at line 330 of file class.ilDclExpressionParser.php.
Referenced by calculateFunctions().
 Here is the caller graph for this function:
      
  | 
  protected | 
Execute any math functions inside a token.
Definition at line 148 of file class.ilDclExpressionParser.php.
References $token, calculateFunction(), getFunctionArgs(), and substituteFieldValues().
Referenced by parse().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  protected | 
| float | int | $value | 
Definition at line 101 of file class.ilDclExpressionParser.php.
Referenced by parse().
 Here is the caller graph for this function:
      
  | 
  protected | 
Helper method to return the function and its arguments from a preg_replace_all $result array.
Definition at line 181 of file class.ilDclExpressionParser.php.
References $data, $i, and $index.
Referenced by calculateFunctions().
 Here is the caller graph for this function:
      
  | 
  static | 
Definition at line 117 of file class.ilDclExpressionParser.php.
References $functions.
Referenced by ilDclFormulaFieldRepresentation\buildFieldCreationInput(), ilDclTable\getFieldsForFormula(), and isMathToken().
 Here is the caller graph for this function:
      
  | 
  static | 
Definition at line 112 of file class.ilDclExpressionParser.php.
References $operators.
Referenced by ilDclFormulaFieldRepresentation\buildFieldCreationInput(), ilDclTable\getFieldsForFormula(), and ilDclTokenizer\getMathTokens().
 Here is the caller graph for this function:
      
  | 
  protected | 
Check if a given token is a math expression.
Definition at line 125 of file class.ilDclExpressionParser.php.
References $functions, $operators, $token, and getFunctions().
Referenced by parse().
 Here is the call graph for this function:
 Here is the caller graph for this function:| ilDclExpressionParser::parse | ( | ) | 
Parse expression and return result.
This method loops the tokens and checks if Token is of type string or math. Concatenates results to produce resulting string of parsed expression.
| ilException | 
Definition at line 61 of file class.ilDclExpressionParser.php.
References $token, calculateFunctions(), formatScientific(), ilDclTokenizer\getMathTokens(), ilDclTokenizer\getTokens(), isMathToken(), parseMath(), and substituteFieldValues().
 Here is the call graph for this function:
      
  | 
  protected | 
Parse a math expression.
| Exception | 
Definition at line 254 of file class.ilDclExpressionParser.php.
References $operators, $token, calculate(), and parseMath().
Referenced by parse(), and parseMath().
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  protected | 
Given an array of tokens, replace each token that is a placeholder (e.g.
[[Field name]]) with it's value
Definition at line 204 of file class.ilDclExpressionParser.php.
References $token.
Referenced by calculateFunctions(), and parse().
 Here is the caller graph for this function:
      
  | 
  staticprotected | 
Definition at line 37 of file class.ilDclExpressionParser.php.
      
  | 
  staticprotected | 
Definition at line 39 of file class.ilDclExpressionParser.php.
      
  | 
  staticprotected | 
Definition at line 38 of file class.ilDclExpressionParser.php.
      
  | 
  staticprotected | 
Definition at line 36 of file class.ilDclExpressionParser.php.
      
  | 
  protected | 
Definition at line 27 of file class.ilDclExpressionParser.php.
Referenced by __construct().
      
  | 
  protected | 
Definition at line 26 of file class.ilDclExpressionParser.php.
Referenced by __construct().
      
  | 
  staticprotected | 
Definition at line 40 of file class.ilDclExpressionParser.php.
Referenced by getFunctions(), and isMathToken().
      
  | 
  staticprotected | 
Definition at line 28 of file class.ilDclExpressionParser.php.
Referenced by getOperators(), isMathToken(), and parseMath().
      
  | 
  protected | 
Definition at line 25 of file class.ilDclExpressionParser.php.
Referenced by __construct().
| const ilDclExpressionParser::N_DECIMALS = 1 | 
Definition at line 21 of file class.ilDclExpressionParser.php.
| const ilDclExpressionParser::SCIENTIFIC_NOTATION_LOWER = 0.000000001 | 
Definition at line 23 of file class.ilDclExpressionParser.php.
| const ilDclExpressionParser::SCIENTIFIC_NOTATION_UPPER = 1000000000000 | 
Definition at line 22 of file class.ilDclExpressionParser.php.