1 | <?php |
||
18 | class NumberValueNode extends AbstractValueNode |
||
19 | { |
||
20 | /** |
||
21 | * @return int|float |
||
22 | */ |
||
23 | public function parse() |
||
47 | |||
48 | /** |
||
49 | * @param LeafInterface $leaf |
||
50 | * @return bool |
||
51 | */ |
||
52 | private function isHex(LeafInterface $leaf): bool |
||
56 | |||
57 | /** |
||
58 | * @param string $value |
||
59 | * @return int |
||
60 | */ |
||
61 | private function parseHex(string $value): int |
||
65 | |||
66 | /** |
||
67 | * @param LeafInterface $leaf |
||
68 | * @return bool |
||
69 | */ |
||
70 | private function isBinary(LeafInterface $leaf): bool |
||
74 | |||
75 | /** |
||
76 | * @param string $value |
||
77 | * @return int |
||
78 | */ |
||
79 | private function parseBin(string $value): int |
||
83 | |||
84 | /** |
||
85 | * @param LeafInterface $leaf |
||
86 | * @return bool |
||
87 | */ |
||
88 | private function isExponential(LeafInterface $leaf): bool |
||
92 | |||
93 | /** |
||
94 | * @param string $value |
||
95 | * @return float |
||
96 | */ |
||
97 | private function parseExponential(string $value): float |
||
101 | |||
102 | /** |
||
103 | * @param LeafInterface $leaf |
||
104 | * @return bool |
||
105 | */ |
||
106 | private function isFloat(LeafInterface $leaf): bool |
||
110 | |||
111 | /** |
||
112 | * @param string $value |
||
113 | * @return float |
||
114 | */ |
||
115 | private function parseFloat(string $value): float |
||
119 | |||
120 | /** |
||
121 | * @param LeafInterface $leaf |
||
122 | * @return bool |
||
123 | */ |
||
124 | private function isInt(LeafInterface $leaf): bool |
||
128 | |||
129 | /** |
||
130 | * @param string $value |
||
131 | * @return int |
||
132 | */ |
||
133 | private function parseInt(string $value): int |
||
137 | } |
||
138 |