1 | <?php |
||
22 | class NumberValueNode extends AbstractAstValueNode |
||
23 | { |
||
24 | /** |
||
25 | * @return int|float |
||
26 | */ |
||
27 | public function parse() |
||
51 | |||
52 | /** |
||
53 | * @param LeafInterface $leaf |
||
54 | * @return bool |
||
55 | */ |
||
56 | private function isHex(LeafInterface $leaf): bool |
||
60 | |||
61 | /** |
||
62 | * @param string $value |
||
63 | * @return int |
||
64 | */ |
||
65 | private function parseHex(string $value): int |
||
69 | |||
70 | /** |
||
71 | * @param LeafInterface $leaf |
||
72 | * @return bool |
||
73 | */ |
||
74 | private function isBinary(LeafInterface $leaf): bool |
||
78 | |||
79 | /** |
||
80 | * @param string $value |
||
81 | * @return int |
||
82 | */ |
||
83 | private function parseBin(string $value): int |
||
87 | |||
88 | /** |
||
89 | * @param LeafInterface $leaf |
||
90 | * @return bool |
||
91 | */ |
||
92 | private function isExponential(LeafInterface $leaf): bool |
||
96 | |||
97 | /** |
||
98 | * @param string $value |
||
99 | * @return float |
||
100 | */ |
||
101 | private function parseExponential(string $value): float |
||
105 | |||
106 | /** |
||
107 | * @param LeafInterface $leaf |
||
108 | * @return bool |
||
109 | */ |
||
110 | private function isFloat(LeafInterface $leaf): bool |
||
114 | |||
115 | /** |
||
116 | * @param string $value |
||
117 | * @return float |
||
118 | */ |
||
119 | private function parseFloat(string $value): float |
||
123 | |||
124 | /** |
||
125 | * @param LeafInterface $leaf |
||
126 | * @return bool |
||
127 | */ |
||
128 | private function isInt(LeafInterface $leaf): bool |
||
132 | |||
133 | /** |
||
134 | * @param string $value |
||
135 | * @return int |
||
136 | */ |
||
137 | private function parseInt(string $value): int |
||
141 | } |
||
142 |