1 | <?php |
||
12 | class GeezParser |
||
13 | { |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $geez_number; |
||
18 | |||
19 | /** |
||
20 | * @var Queue |
||
21 | */ |
||
22 | protected $parsed; |
||
23 | |||
24 | /** |
||
25 | * GeezParser constructor. |
||
26 | * |
||
27 | * @param $geez_number |
||
28 | * |
||
29 | * @throws NotGeezArgumentException |
||
30 | */ |
||
31 | public function __construct($geez_number) |
||
36 | |||
37 | /** |
||
38 | * @param $geez_number |
||
39 | * |
||
40 | * @throws NotGeezArgumentException |
||
41 | */ |
||
42 | protected function setGeezNumber($geez_number) |
||
50 | |||
51 | public function getParsed() |
||
55 | |||
56 | /** |
||
57 | * Swing the magic wand and say the spell. |
||
58 | */ |
||
59 | public function parse() |
||
73 | |||
74 | /** |
||
75 | * Get the length of the string. |
||
76 | * |
||
77 | * @param $geez_number |
||
78 | * |
||
79 | * @return int |
||
80 | */ |
||
81 | protected function getLength($geez_number) |
||
85 | |||
86 | /** |
||
87 | * Parse a geez character. |
||
88 | * |
||
89 | * @param $index integer |
||
90 | * @param $block integer |
||
91 | * |
||
92 | * @throws \Geezify\Exception\NotGeezArgumentException |
||
93 | */ |
||
94 | protected function parseCharacter($index, &$block) |
||
105 | |||
106 | /** |
||
107 | * Get the ascii number from geez number string. |
||
108 | * |
||
109 | * @param $index |
||
110 | * |
||
111 | * @throws \Geezify\Exception\NotGeezArgumentException |
||
112 | * |
||
113 | * @return int |
||
114 | */ |
||
115 | protected function parseGeezAtIndex($index) |
||
121 | |||
122 | /** |
||
123 | * Fetch z character at $index from the geez number string. |
||
124 | * |
||
125 | * @param $geez_number |
||
126 | * @param $index |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | protected function getCharacterAt($geez_number, $index) |
||
134 | |||
135 | /** |
||
136 | * Convert geez number character to ascii. |
||
137 | * |
||
138 | * @param $geez_number |
||
139 | * |
||
140 | * @throws NotGeezArgumentException |
||
141 | * |
||
142 | * @return int |
||
143 | */ |
||
144 | protected function getAsciiNumber($geez_number) |
||
154 | |||
155 | /** |
||
156 | * @param $ascii_number |
||
157 | * |
||
158 | * @return bool |
||
159 | */ |
||
160 | protected function isNotGeezSeparator($ascii_number) |
||
164 | |||
165 | /** |
||
166 | * Push to the queue. |
||
167 | * |
||
168 | * @param $block |
||
169 | * @param $separator |
||
170 | */ |
||
171 | protected function pushToQueue($block, $separator) |
||
177 | } |
||
178 |