packages/sql-faker/src/Compiler/Bison/Ast/BisonSymbolNode.php

1<?php
2
3declare(strict_types=1);
4
5namespace SqlFaker\Compiler\Bison\Ast;
6
7/**
8 * A symbol on the right-hand side of one rule alternative.
9 *
10 * The form records how the symbol was written: a name refers to a rule or a
11 * declared terminal, while a quoted character is a terminal that stands for
12 * itself. The parser needs the difference because only the first can be a rule.
13 *
14 * @visibility root
15 */
16final class BisonSymbolNode
17{
18    /**
19     * @param BisonSymbolForm $type How the symbol was spelled in the grammar
20     * @param string $value The symbol's name, or the character it stands for
21     */
22    public function __construct(
23        public readonly BisonSymbolForm $type,
24        public readonly string $value,
25    ) {
26    }
27}
28