1<?php
2
3declare(strict_types=1);
4
5namespace JMS\Serializer\Type;
6
7use Hoa\Compiler\Llk\Parser;
8use Hoa\Compiler\Llk\Rule\Choice;
9use Hoa\Compiler\Llk\Rule\Concatenation;
10use Hoa\Compiler\Llk\Rule\Repetition;
11use Hoa\Compiler\Llk\Rule\Token;
12
13/**
14 * @internal
15 *
16 * @generated Use regenerate-parser.php to refresh this class.
17 */
18final class InnerParser extends Parser
19{
20    public function __construct()
21    {
22        parent::__construct(
23            [
24                'default' => [
25                    'skip' => '\s+',
26                    'parenthesis_' => '<',
27                    '_parenthesis' => '>',
28                    'empty_string' => '""|\'\'',
29                    'number' => '(\+|\-)?(0|[1-9]\d*)(\.\d+)?',
30                    'null' => 'null',
31                    'comma' => ',',
32                    'name' => '(?:[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\\\)*[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*',
33                    'quote_:quoted_string' => '"',
34                    'apostrophe_:apostrophed_string' => '\'',
35                ],
36                'quoted_string' => [
37                    'quoted_string' => '[^"]+',
38                    '_quote:default' => '"',
39                ],
40                'apostrophed_string' => [
41                    'apostrophed_string' => '[^\']+',
42                    '_apostrophe:default' => '\'',
43                ],
44            ],
45            [
46                'type' => new Choice('type', ['simple_type', 'compound_type'], null),
47                1 => new Token(1, 'name', null, -1, true),
48                2 => new Concatenation(2, [1], '#simple_type'),
49                3 => new Token(3, 'number', null, -1, true),
50                4 => new Concatenation(4, [3], '#simple_type'),
51                5 => new Token(5, 'null', null, -1, true),
52                6 => new Concatenation(6, [5], '#simple_type'),
53                7 => new Token(7, 'empty_string', null, -1, true),
54                8 => new Concatenation(8, [7], '#simple_type'),
55                9 => new Token(9, 'quote_', null, -1, false),
56                10 => new Token(10, 'quoted_string', null, -1, true),
57                11 => new Token(11, '_quote', null, -1, false),
58                12 => new Concatenation(12, [9, 10, 11], '#simple_type'),
59                13 => new Token(13, 'apostrophe_', null, -1, false),
60                14 => new Token(14, 'apostrophed_string', null, -1, true),
61                15 => new Token(15, '_apostrophe', null, -1, false),
62                16 => new Concatenation(16, [13, 14, 15], '#simple_type'),
63                'simple_type' => new Choice('simple_type', [2, 4, 6, 8, 12, 16], null),
64                18 => new Token(18, 'name', null, -1, true),
65                19 => new Token(19, 'parenthesis_', null, -1, false),
66                20 => new Token(20, 'comma', null, -1, false),
67                21 => new Concatenation(21, [20, 'type'], '#compound_type'),
68                22 => new Repetition(22, 0, -1, 21, null),
69                23 => new Token(23, '_parenthesis', null, -1, false),
70                'compound_type' => new Concatenation('compound_type', [18, 19, 'type', 22, 23], null),
71            ],
72            []
73        );
74
75        $this->getRule('type')->setPPRepresentation(' simple_type() | compound_type()');
76        $this->getRule('simple_type')->setDefaultId('#simple_type');
77        $this->getRule('simple_type')->setPPRepresentation(' <name> | <number> | <null> | <empty_string> | ::quote_:: <quoted_string> ::_quote:: | ::apostrophe_:: <apostrophed_string> ::_apostrophe::');
78        $this->getRule('compound_type')->setDefaultId('#compound_type');
79        $this->getRule('compound_type')->setPPRepresentation(' <name> ::parenthesis_:: type() ( ::comma:: type() )* ::_parenthesis::');
80    }
81}
82