1<?php
2
3declare(strict_types=1);
4
5namespace Antlr\Antlr4\Runtime\Error\Listeners;
6
7use Antlr\Antlr4\Runtime\Error\Exceptions\RecognitionException;
8use Antlr\Antlr4\Runtime\Recognizer;
9
10final class ConsoleErrorListener extends BaseErrorListener
11{
12    public function syntaxError(
13        Recognizer $recognizer,
14        ?object $offendingSymbol,
15        int $line,
16        int $charPositionInLine,
17        string $msg,
18        ?RecognitionException $e
19    ) : void {
20        \fwrite(\STDERR, \sprintf("line %d:%d %s\n", $line, $charPositionInLine, $msg));
21    }
22}
23