1 | <?php |
||
8 | class ValueResult { |
||
9 | private $result = []; |
||
10 | /* |
||
11 | The next operation to perform. Will be one of the following: |
||
12 | ARG - A new value e.g, "a","b" becomes ["a", "b"] |
||
13 | CONCAT - Concat onto the current arg e.g "a" + "b" becomes ["ab"] |
||
14 | NOT - Boolean operation "a" != "b" becomes [true] |
||
15 | EQUALS - Boolean operation "a" = "b" becomes [false] |
||
16 | */ |
||
17 | private $mode = Tokenizer::ARG; |
||
18 | |||
19 | //Processes $newValue using $mode. Either concats to the current argument, adds a new argument |
||
20 | //Or usess the two arguments for a boolean comparison |
||
21 | public function processValue($newValue) { |
||
40 | |||
41 | public function arg($value) { |
||
44 | |||
45 | public function concat($value) { |
||
48 | |||
49 | public function not($value) { |
||
52 | |||
53 | public function equals($value) { |
||
56 | |||
57 | public function greater($value) { |
||
60 | |||
61 | public function lower($value) { |
||
64 | |||
65 | public function add($value) { |
||
68 | |||
69 | public function sub($value) { |
||
72 | |||
73 | public function mult($value) { |
||
76 | |||
77 | public function div($value) { |
||
80 | |||
81 | public function setMode($mode) { |
||
84 | |||
85 | public function getMode() { |
||
88 | |||
89 | public function getResult() { |
||
92 | |||
93 | public function pop() { |
||
96 | |||
97 | private function write($index, $value, $allowNull = false) { |
||
102 | |||
103 | //Postprocessing - replace values with null where allowed, or override a value at position |
||
104 | public function postProcess(ValueData $data, $val, $overrideVal, $allowNull) { |
||
113 | |||
114 | public function clear() { |
||
117 | } |
||
118 |