1 | <?php |
||
18 | class SyntaxErrorException extends \Exception |
||
19 | { |
||
20 | /** |
||
21 | * SyntaxErrorException constructor. |
||
22 | * @param StringStream $stream |
||
23 | * @param int $code |
||
24 | * @param Exception|null $previous |
||
25 | */ |
||
26 | 7 | public function __construct(StringStream $stream, int $code = 0, Exception $previous = null) |
|
37 | |||
38 | /** |
||
39 | * @return int |
||
40 | */ |
||
41 | public function getErrorLine() |
||
45 | |||
46 | /** |
||
47 | * @return string |
||
48 | */ |
||
49 | public function getUnexpectedChar() |
||
53 | |||
54 | /** |
||
55 | * @internal |
||
56 | * @param StringStream $stream |
||
57 | * @return int |
||
58 | */ |
||
59 | 7 | private function getParseErrorLineNumber(StringStream $stream) : int |
|
74 | |||
75 | /** |
||
76 | * @param StringStream $stream |
||
77 | * @return string |
||
78 | */ |
||
79 | private function getFullString(StringStream $stream) : string |
||
90 | |||
91 | /** |
||
92 | * @var int |
||
93 | */ |
||
94 | private $error_line; |
||
95 | /** |
||
96 | * @var string |
||
97 | */ |
||
98 | private $unexpected_char; |
||
99 | |||
100 | /** |
||
101 | * @var string |
||
102 | */ |
||
103 | private $messageTemplate = "Parse error: syntax error, unexpected '%s' on line %d."; |
||
104 | } |