1<?php
2
3declare(strict_types=1);
4
5namespace Antlr\Antlr4\Runtime\Dfa;
6
7use Antlr\Antlr4\Runtime\Atn\SemanticContexts\SemanticContext;
8
9/**
10 * Map a predicate to a predicted alternative.
11 */
12final class PredPrediction
13{
14    /** @var SemanticContext */
15    public $pred;
16
17    /** @var int */
18    public $alt;
19
20    public function __construct(SemanticContext $pred, int $alt)
21    {
22        $this->pred = $pred;
23        $this->alt = $alt;
24    }
25
26    public function __toString() : string
27    {
28        return \sprintf('(%s, %d)', (string) $this->pred, $this->alt);
29    }
30}
31