MediaWiki REL1_34
|
Public Member Functions | |
doExpression ( $expr) | |
Evaluate a mathematical expression. | |
doOperation ( $op, &$stack) | |
Public Attributes | |
$maxStackSize = 100 | |
$names | |
$precedence | |
$words | |
Definition at line 71 of file ExprParser.php.
MediaWiki\Extensions\ParserFunctions\ExprParser::doExpression | ( | $expr | ) |
Evaluate a mathematical expression.
The algorithm here is based on the infix to RPN algorithm given in http://montcs.bloomu.edu/~bobmon/Information/RPN/infix2rpn.shtml It's essentially the same as Dijkstra's shunting yard algorithm.
string | $expr |
ExprError |
Definition at line 185 of file ExprParser.php.
References $matches, MediaWiki\Extensions\ParserFunctions\ExprParser\doOperation(), MediaWiki\Extensions\ParserFunctions\EXPR_ABS, MediaWiki\Extensions\ParserFunctions\EXPR_ARCCOS, MediaWiki\Extensions\ParserFunctions\EXPR_ARCSINE, MediaWiki\Extensions\ParserFunctions\EXPR_ARCTAN, MediaWiki\Extensions\ParserFunctions\EXPR_CEIL, MediaWiki\Extensions\ParserFunctions\EXPR_COSINE, MediaWiki\Extensions\ParserFunctions\EXPR_DIVIDE, MediaWiki\Extensions\ParserFunctions\EXPR_EQUALITY, MediaWiki\Extensions\ParserFunctions\EXPR_EXP, MediaWiki\Extensions\ParserFunctions\EXPR_EXPONENT, MediaWiki\Extensions\ParserFunctions\EXPR_FLOOR, MediaWiki\Extensions\ParserFunctions\EXPR_GREATER, MediaWiki\Extensions\ParserFunctions\EXPR_GREATEREQ, MediaWiki\Extensions\ParserFunctions\EXPR_LESS, MediaWiki\Extensions\ParserFunctions\EXPR_LESSEQ, MediaWiki\Extensions\ParserFunctions\EXPR_LN, MediaWiki\Extensions\ParserFunctions\EXPR_MINUS, MediaWiki\Extensions\ParserFunctions\EXPR_NEGATIVE, MediaWiki\Extensions\ParserFunctions\EXPR_NOT, MediaWiki\Extensions\ParserFunctions\EXPR_NOTEQ, MediaWiki\Extensions\ParserFunctions\EXPR_NUMBER_CLASS, MediaWiki\Extensions\ParserFunctions\EXPR_OPEN, MediaWiki\Extensions\ParserFunctions\EXPR_PI, MediaWiki\Extensions\ParserFunctions\EXPR_PLUS, MediaWiki\Extensions\ParserFunctions\EXPR_POSITIVE, MediaWiki\Extensions\ParserFunctions\EXPR_POW, MediaWiki\Extensions\ParserFunctions\EXPR_SINE, MediaWiki\Extensions\ParserFunctions\EXPR_SQRT, MediaWiki\Extensions\ParserFunctions\EXPR_TANGENS, MediaWiki\Extensions\ParserFunctions\EXPR_TIMES, MediaWiki\Extensions\ParserFunctions\EXPR_TRUNC, and MediaWiki\Extensions\ParserFunctions\EXPR_WHITE_CLASS.
MediaWiki\Extensions\ParserFunctions\ExprParser::doOperation | ( | $op, | |
& | $stack ) |
int | $op | |
array | &$stack |
ExprError |
Definition at line 402 of file ExprParser.php.
References MediaWiki\Extensions\ParserFunctions\EXPR_ABS, MediaWiki\Extensions\ParserFunctions\EXPR_AND, MediaWiki\Extensions\ParserFunctions\EXPR_ARCCOS, MediaWiki\Extensions\ParserFunctions\EXPR_ARCSINE, MediaWiki\Extensions\ParserFunctions\EXPR_ARCTAN, MediaWiki\Extensions\ParserFunctions\EXPR_CEIL, MediaWiki\Extensions\ParserFunctions\EXPR_COSINE, MediaWiki\Extensions\ParserFunctions\EXPR_DIVIDE, MediaWiki\Extensions\ParserFunctions\EXPR_EQUALITY, MediaWiki\Extensions\ParserFunctions\EXPR_EXP, MediaWiki\Extensions\ParserFunctions\EXPR_EXPONENT, MediaWiki\Extensions\ParserFunctions\EXPR_FLOOR, MediaWiki\Extensions\ParserFunctions\EXPR_FMOD, MediaWiki\Extensions\ParserFunctions\EXPR_GREATER, MediaWiki\Extensions\ParserFunctions\EXPR_GREATEREQ, MediaWiki\Extensions\ParserFunctions\EXPR_LESS, MediaWiki\Extensions\ParserFunctions\EXPR_LESSEQ, MediaWiki\Extensions\ParserFunctions\EXPR_LN, MediaWiki\Extensions\ParserFunctions\EXPR_MINUS, MediaWiki\Extensions\ParserFunctions\EXPR_MOD, MediaWiki\Extensions\ParserFunctions\EXPR_NEGATIVE, MediaWiki\Extensions\ParserFunctions\EXPR_NOT, MediaWiki\Extensions\ParserFunctions\EXPR_NOTEQ, MediaWiki\Extensions\ParserFunctions\EXPR_OR, MediaWiki\Extensions\ParserFunctions\EXPR_PLUS, MediaWiki\Extensions\ParserFunctions\EXPR_POSITIVE, MediaWiki\Extensions\ParserFunctions\EXPR_POW, MediaWiki\Extensions\ParserFunctions\EXPR_ROUND, MediaWiki\Extensions\ParserFunctions\EXPR_SINE, MediaWiki\Extensions\ParserFunctions\EXPR_SQRT, MediaWiki\Extensions\ParserFunctions\EXPR_TANGENS, MediaWiki\Extensions\ParserFunctions\EXPR_TIMES, and MediaWiki\Extensions\ParserFunctions\EXPR_TRUNC.
Referenced by MediaWiki\Extensions\ParserFunctions\ExprParser\doExpression().
MediaWiki\Extensions\ParserFunctions\ExprParser::$maxStackSize = 100 |
Definition at line 72 of file ExprParser.php.
MediaWiki\Extensions\ParserFunctions\ExprParser::$names |
Definition at line 113 of file ExprParser.php.
MediaWiki\Extensions\ParserFunctions\ExprParser::$precedence |
Definition at line 74 of file ExprParser.php.
MediaWiki\Extensions\ParserFunctions\ExprParser::$words |
Definition at line 150 of file ExprParser.php.