1 | <?php |
||
19 | class Error |
||
20 | { |
||
21 | /** |
||
22 | * Gets the errors of a lexer and a parser. |
||
23 | * |
||
24 | * @param array $objs objects from where the errors will be extracted |
||
25 | * |
||
26 | * @return array Each element of the array represents an error. |
||
27 | * `$err[0]` holds the error message. |
||
28 | * `$err[1]` holds the error code. |
||
29 | * `$err[2]` holds the string that caused the issue. |
||
30 | * `$err[3]` holds the position of the string. |
||
31 | * (i.e. `array($msg, $code, $str, $pos)`) |
||
32 | */ |
||
33 | 4 | public static function get($objs) |
|
61 | |||
62 | /** |
||
63 | * Formats the specified errors. |
||
64 | * |
||
65 | * @param array $errors the errors to be formatted |
||
66 | * @param string $format The format of an error. |
||
67 | * '$1$d' is replaced by the position of this error. |
||
68 | * '$2$s' is replaced by the error message. |
||
69 | * '$3$d' is replaced by the error code. |
||
70 | * '$4$s' is replaced by the string that caused the |
||
71 | * issue. |
||
72 | * '$5$d' is replaced by the position of the string. |
||
73 | * |
||
74 | * @return array |
||
75 | */ |
||
76 | 2 | public static function format( |
|
96 | } |
||
97 |