Completed
Push — master ( 332a4c...198c54 )
by Kirill
02:13
created

Parser::bootGrammar()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 325

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 325
rs 8
c 0
b 0
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/**
3
 * This file is part of Railt package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Railt\SDL\Compiler;
11
12
use Railt\Lexer\Factory;
0 ignored issues
show
Bug introduced by
This use statement conflicts with another class in this namespace, Railt\SDL\Compiler\Factory.

Let’s assume that you have a directory layout like this:

.
|-- OtherDir
|   |-- Bar.php
|   `-- Foo.php
`-- SomeDir
    `-- Foo.php

and let’s assume the following content of Bar.php:

// Bar.php
namespace OtherDir;

use SomeDir\Foo; // This now conflicts the class OtherDir\Foo

If both files OtherDir/Foo.php and SomeDir/Foo.php are loaded in the same runtime, you will see a PHP error such as the following:

PHP Fatal error:  Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php

However, as OtherDir/Foo.php does not necessarily have to be loaded and the error is only triggered if it is loaded before OtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias:

// Bar.php
namespace OtherDir;

use SomeDir\Foo as SomeDirFoo; // There is no conflict anymore.
Loading history...
13
use Railt\Lexer\LexerInterface;
14
use Railt\Parser\Driver\Llk;
15
use Railt\Parser\Driver\Stateful;
16
use Railt\Parser\Grammar;
17
use Railt\Parser\ParserInterface;
18
use Railt\Parser\Rule\Alternation;
19
use Railt\Parser\Rule\Concatenation;
20
use Railt\Parser\Rule\Repetition;
21
use Railt\Parser\Rule\Terminal;
22
use Railt\Parser\GrammarInterface;
23
24
/**
25
 * --- DO NOT EDIT THIS FILE ---
26
 *
27
 * Class Parser has been auto-generated.
28
 * Generated at: 02-08-2018 21:51:44
29
 *
30
 * --- DO NOT EDIT THIS FILE ---
31
 */
32
class Parser extends Stateful
33
{
34
    public const T_AND = 'T_AND';
35
    public const T_OR = 'T_OR';
36
    public const T_PARENTHESIS_OPEN = 'T_PARENTHESIS_OPEN';
37
    public const T_PARENTHESIS_CLOSE = 'T_PARENTHESIS_CLOSE';
38
    public const T_BRACKET_OPEN = 'T_BRACKET_OPEN';
39
    public const T_BRACKET_CLOSE = 'T_BRACKET_CLOSE';
40
    public const T_BRACE_OPEN = 'T_BRACE_OPEN';
41
    public const T_BRACE_CLOSE = 'T_BRACE_CLOSE';
42
    public const T_NON_NULL = 'T_NON_NULL';
43
    public const T_THREE_DOTS = 'T_THREE_DOTS';
44
    public const T_COLON = 'T_COLON';
45
    public const T_EQUAL = 'T_EQUAL';
46
    public const T_DIRECTIVE_AT = 'T_DIRECTIVE_AT';
47
    public const T_HEX_NUMBER = 'T_HEX_NUMBER';
48
    public const T_BIN_NUMBER = 'T_BIN_NUMBER';
49
    public const T_NUMBER = 'T_NUMBER';
50
    public const T_TRUE = 'T_TRUE';
51
    public const T_FALSE = 'T_FALSE';
52
    public const T_NULL = 'T_NULL';
53
    public const T_BLOCK_STRING = 'T_BLOCK_STRING';
54
    public const T_STRING = 'T_STRING';
55
    public const T_EXTENDS = 'T_EXTENDS';
56
    public const T_IMPLEMENTS = 'T_IMPLEMENTS';
57
    public const T_ON = 'T_ON';
58
    public const T_TYPE = 'T_TYPE';
59
    public const T_ENUM = 'T_ENUM';
60
    public const T_UNION = 'T_UNION';
61
    public const T_INPUT_UNION = 'T_INPUT_UNION';
62
    public const T_INTERFACE = 'T_INTERFACE';
63
    public const T_SCHEMA = 'T_SCHEMA';
64
    public const T_SCALAR = 'T_SCALAR';
65
    public const T_DIRECTIVE = 'T_DIRECTIVE';
66
    public const T_INPUT = 'T_INPUT';
67
    public const T_EXTEND = 'T_EXTEND';
68
    public const T_FRAGMENT = 'T_FRAGMENT';
69
    public const T_VARIABLE = 'T_VARIABLE';
70
    public const T_NAME = 'T_NAME';
71
    public const T_WHITESPACE = 'T_WHITESPACE';
72
    public const T_COMMENT = 'T_COMMENT';
73
    public const T_COMMA = 'T_COMMA';
74
75
    /**
76
     * Lexical tokens list.
77
     *
78
     * @var string[]
79
     */
80
    protected const LEXER_TOKENS = [
81
        self::T_AND => '&',
82
        self::T_OR => '\\|',
83
        self::T_PARENTHESIS_OPEN => '\\(',
84
        self::T_PARENTHESIS_CLOSE => '\\)',
85
        self::T_BRACKET_OPEN => '\\[',
86
        self::T_BRACKET_CLOSE => '\\]',
87
        self::T_BRACE_OPEN => '{',
88
        self::T_BRACE_CLOSE => '}',
89
        self::T_NON_NULL => '!',
90
        self::T_THREE_DOTS => '\\.\\.\\.',
91
        self::T_COLON => ':',
92
        self::T_EQUAL => '=',
93
        self::T_DIRECTIVE_AT => '@',
94
        self::T_HEX_NUMBER => '\\-?0x([0-9a-fA-F]+)\\b',
95
        self::T_BIN_NUMBER => '\\-?0b([0-1]+)\\b',
96
        self::T_NUMBER => '\\-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][\\+\\-]?[0-9]+)?',
97
        self::T_TRUE => 'true\\b',
98
        self::T_FALSE => 'false\\b',
99
        self::T_NULL => 'null\\b',
100
        self::T_BLOCK_STRING => '"""((?:\\\\"""|(?!""").|\\s)*)"""',
101
        self::T_STRING => '"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"',
102
        self::T_EXTENDS => 'extends\\b',
103
        self::T_IMPLEMENTS => 'implements\\b',
104
        self::T_ON => 'on\\b',
105
        self::T_TYPE => 'type\\b',
106
        self::T_ENUM => 'enum\\b',
107
        self::T_UNION => 'union\\b',
108
        self::T_INPUT_UNION => 'inputUnion\\b',
109
        self::T_INTERFACE => 'interface\\b',
110
        self::T_SCHEMA => 'schema\\b',
111
        self::T_SCALAR => 'scalar\\b',
112
        self::T_DIRECTIVE => 'directive\\b',
113
        self::T_INPUT => 'input\\b',
114
        self::T_EXTEND => 'extend\\b',
115
        self::T_FRAGMENT => 'fragment\\b',
116
        self::T_VARIABLE => '\\$[_A-Za-z][_0-9A-Za-z]*',
117
        self::T_NAME => '[_A-Za-z][_0-9A-Za-z]*',
118
        self::T_WHITESPACE => '(\\xfe\\xff|\\x20|\\x09|\\x0a|\\x0d)+',
119
        self::T_COMMENT => '#[^\\n]*',
120
        self::T_COMMA => ',',
121
    ];
122
123
    /**
124
     * List of skipped tokens.
125
     *
126
     * @var string[]
127
     */
128
    protected const LEXER_SKIPPED_TOKENS = [
129
        'T_WHITESPACE',
130
        'T_COMMENT',
131
        'T_COMMA',
132
    ];
133
134
    /**
135
     * @var int
136
     */
137
    protected const LEXER_FLAGS = Factory::LOOKAHEAD;
138
139
    /**
140
     * List of rule delegates.
141
     *
142
     * @var string[]
143
     */
144
    protected const PARSER_DELEGATES = [
145
        'TypeName' => \Railt\SDL\Compiler\Ast\TypeNameNode::class,
146
        'Boolean' => \Railt\SDL\Compiler\Ast\Value\BooleanValueNode::class,
147
        'Number' => \Railt\SDL\Compiler\Ast\Value\NumberValueNode::class,
148
        'String' => \Railt\SDL\Compiler\Ast\Value\StringValueNode::class,
149
        'Null' => \Railt\SDL\Compiler\Ast\Value\NullValueNode::class,
150
        'Input' => \Railt\SDL\Compiler\Ast\Value\InputValueNode::class,
151
        'List' => \Railt\SDL\Compiler\Ast\Value\ListValueNode::class,
152
        'Constant' => \Railt\SDL\Compiler\Ast\Value\ConstantValueNode::class,
153
        'DirectiveDefinition' => \Railt\SDL\Compiler\Ast\Definition\DirectiveDefinitionNode::class,
154
        'EnumDefinition' => \Railt\SDL\Compiler\Ast\Definition\EnumDefinitionNode::class,
155
        'InputDefinition' => \Railt\SDL\Compiler\Ast\Definition\InputDefinitionNode::class,
156
        'InputUnionDefinition' => \Railt\SDL\Compiler\Ast\Definition\InputUnionDefinitionNode::class,
157
        'InterfaceDefinition' => \Railt\SDL\Compiler\Ast\Definition\InterfaceDefinitionNode::class,
158
        'ObjectDefinition' => \Railt\SDL\Compiler\Ast\Definition\ObjectDefinitionNode::class,
159
        'ScalarDefinition' => \Railt\SDL\Compiler\Ast\Definition\ScalarDefinitionNode::class,
160
        'SchemaDefinition' => \Railt\SDL\Compiler\Ast\Definition\SchemaDefinitionNode::class,
161
        'UnionDefinition' => \Railt\SDL\Compiler\Ast\Definition\UnionDefinitionNode::class,
162
    ];
163
164
    /**
165
     * Parser root rule name.
166
     *
167
     * @var string
168
     */
169
    protected const PARSER_ROOT_RULE = 'Document';
170
171
    /**
172
     * @return ParserInterface
173
     * @throws \InvalidArgumentException
174
     * @throws \Railt\Lexer\Exception\BadLexemeException
175
     */
176
    protected function boot(): ParserInterface
177
    {
178
        return new Llk($this->bootLexer(), $this->bootGrammar());
179
    }
180
181
    /**
182
     * @return LexerInterface
183
     * @throws \InvalidArgumentException
184
     * @throws \Railt\Lexer\Exception\BadLexemeException
185
     */
186
    protected function bootLexer(): LexerInterface
187
    {
188
        return Factory::create(static::LEXER_TOKENS, static::LEXER_SKIPPED_TOKENS, static::LEXER_FLAGS);
189
    }
190
191
    /**
192
     * @return GrammarInterface
193
     */
194
    protected function bootGrammar(): GrammarInterface
195
    {
196
        return new Grammar([
197
            new Repetition(0, 0, -1, 'DocumentImports', null), 
198
            new Repetition(1, 0, -1, 'DocumentDefinitions', null), 
199
            (new Concatenation('Document', [0, 1], 'Document'))->setDefaultId('Document'), 
200
            new Concatenation('DocumentImports', ['Directive'], null), 
201
            new Concatenation(4, ['Definition'], null), 
202
            new Alternation('DocumentDefinitions', ['Extension', 4], null), 
203
            new Terminal('NameWithoutReserved', 'T_NAME', true), 
204
            new Terminal(7, 'T_TRUE', true), 
205
            new Terminal(8, 'T_FALSE', true), 
206
            new Terminal(9, 'T_NULL', true), 
207
            new Alternation('NameWithReserved', ['NameExceptValues', 7, 8, 9], null), 
208
            new Terminal(11, 'T_NAMESPACE', true), 
209
            new Terminal(12, 'T_EXTENDS', true), 
210
            new Terminal(13, 'T_IMPLEMENTS', true), 
211
            new Terminal(14, 'T_ON', true), 
212
            new Terminal(15, 'T_TYPE', true), 
213
            new Terminal(16, 'T_ENUM', true), 
214
            new Terminal(17, 'T_UNION', true), 
215
            new Terminal(18, 'T_INPUT_UNION', true), 
216
            new Terminal(19, 'T_INTERFACE', true), 
217
            new Terminal(20, 'T_SCHEMA', true), 
218
            new Terminal(21, 'T_SCALAR', true), 
219
            new Terminal(22, 'T_DIRECTIVE', true), 
220
            new Terminal(23, 'T_INPUT', true), 
221
            new Terminal(24, 'T_EXTEND', true), 
222
            new Terminal(25, 'T_FRAGMENT', true), 
223
            new Alternation('NameExceptValues', ['NameWithoutReserved', 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25], null), 
224
            new Terminal(27, 'T_VARIABLE', true), 
225
            new Concatenation('Variable', [27], 'Variable'), 
226
            new Concatenation(29, ['NameWithReserved'], null), 
227
            (new Concatenation('TypeName', [29], 'TypeName'))->setDefaultId('TypeName'), 
228
            new Terminal(31, 'T_FALSE', true), 
229
            new Concatenation(32, [31], 'Boolean'), 
230
            new Terminal(33, 'T_TRUE', true), 
231
            new Concatenation(34, [33], 'Boolean'), 
232
            (new Alternation('Boolean', [32, 34], null))->setDefaultId('Boolean'), 
233
            new Terminal(36, 'T_NUMBER', true), 
234
            new Concatenation(37, [36], 'Number'), 
235
            new Terminal(38, 'T_HEX_NUMBER', true), 
236
            new Concatenation(39, [38], 'Number'), 
237
            new Terminal(40, 'T_BIN_NUMBER', true), 
238
            new Concatenation(41, [40], 'Number'), 
239
            (new Alternation('Number', [37, 39, 41], null))->setDefaultId('Number'), 
240
            new Terminal(43, 'T_BLOCK_STRING', true), 
241
            new Concatenation(44, [43], 'String'), 
242
            new Terminal(45, 'T_STRING', true), 
243
            new Concatenation(46, [45], 'String'), 
244
            (new Alternation('String', [44, 46], null))->setDefaultId('String'), 
245
            new Terminal(48, 'T_NULL', true), 
246
            (new Concatenation('Null', [48], 'Null'))->setDefaultId('Null'), 
247
            new Terminal(50, 'T_BRACE_OPEN', false), 
248
            new Repetition(51, 0, -1, '__inputPair', null), 
249
            new Terminal(52, 'T_BRACE_CLOSE', false), 
250
            (new Concatenation('Input', [50, 51, 52], 'Input'))->setDefaultId('Input'), 
251
            new Concatenation('__inputPairKey', ['NameWithReserved'], 'Key'), 
252
            new Terminal(55, 'T_COLON', false), 
253
            new Concatenation('__inputPair', ['__inputPairKey', 55, 'Value'], 'Pair'), 
254
            new Terminal(57, 'T_BRACKET_OPEN', false), 
255
            new Repetition(58, 0, -1, 'Value', null), 
256
            new Terminal(59, 'T_BRACKET_CLOSE', false), 
257
            (new Concatenation('List', [57, 58, 59], 'List'))->setDefaultId('List'), 
258
            new Concatenation(61, ['NameExceptValues'], null), 
259
            (new Concatenation('Constant', [61], 'Constant'))->setDefaultId('Constant'), 
260
            new Concatenation(63, ['Constant'], 'Value'), 
261
            new Concatenation(64, ['Boolean'], 'Value'), 
262
            new Concatenation(65, ['Number'], 'Value'), 
263
            new Concatenation(66, ['String'], 'Value'), 
264
            new Concatenation(67, ['Input'], 'Value'), 
265
            new Concatenation(68, ['Null'], 'Value'), 
266
            new Concatenation(69, ['List'], null), 
267
            new Concatenation(70, [69], 'Value'), 
268
            (new Alternation('Value', [63, 64, 65, 66, 67, 68, 70], null))->setDefaultId('Value'), 
269
            new Concatenation('Documentation', ['String'], 'Description'), 
270
            new Terminal(73, 'T_IMPLEMENTS', false), 
271
            new Terminal(74, 'T_AND', false), 
272
            new Concatenation(75, [74, 'TypeInvocation'], null), 
273
            new Repetition(76, 0, -1, 75, null), 
274
            new Concatenation('TypeDefinitionImplements', [73, 'TypeInvocation', 76], 'Implements'), 
275
            new Terminal(78, 'T_PARENTHESIS_OPEN', false), 
276
            new Repetition(79, 0, -1, '__genericArgumentDefinition', null), 
277
            new Terminal(80, 'T_PARENTHESIS_CLOSE', false), 
278
            (new Concatenation('TypeArguments', [78, 79, 80], 'TypeArguments'))->setDefaultId('TypeArguments'), 
279
            new Terminal(82, 'T_COLON', false), 
280
            new Concatenation('__genericArgumentDefinition', ['Variable', 82, 'TypeName'], 'TypeArgument'), 
281
            new Concatenation(84, ['__typeHintList'], 'TypeHint'), 
282
            new Concatenation(85, ['__typeHintValue'], null), 
283
            new Concatenation(86, [85], 'TypeHint'), 
284
            (new Alternation('TypeHint', [84, 86], null))->setDefaultId('TypeHint'), 
285
            new Terminal(88, 'T_BRACKET_OPEN', false), 
286
            new Terminal(89, 'T_BRACKET_CLOSE', false), 
287
            new Repetition(90, 0, 1, '__typeHintNotNull', null), 
288
            new Concatenation('__typeHintList', [88, '__typeHintValue', 89, 90], 'ListTypeHint'), 
289
            new Repetition(92, 0, 1, '__typeHintNotNull', null), 
290
            new Concatenation('__typeHintValue', ['TypeInvocation', 92], 'SingularTypeHint'), 
291
            new Terminal(94, 'T_NON_NULL', false), 
292
            new Concatenation('__typeHintNotNull', [94], 'NonNull'), 
293
            new Repetition(96, 0, 1, 'Documentation', null), 
294
            new Terminal(97, 'T_COLON', false), 
295
            new Repetition(98, 0, 1, '__argumentDefinitionDefaultValue', null), 
296
            new Repetition(99, 0, 1, 'Directives', null), 
297
            (new Concatenation('ArgumentDefinition', [96, 'NameWithReserved', 97, 'TypeHint', 98, 99], 'ArgumentDefinition'))->setDefaultId('ArgumentDefinition'), 
298
            new Terminal(101, 'T_EQUAL', false), 
299
            new Concatenation(102, ['Value'], null), 
300
            new Concatenation('__argumentDefinitionDefaultValue', [101, 102], null), 
301
            new Repetition(104, 0, 1, 'Documentation', null), 
302
            new Repetition(105, 0, 1, '__fieldDefinitionArguments', null), 
303
            new Terminal(106, 'T_COLON', false), 
304
            new Repetition(107, 0, 1, 'Directives', null), 
305
            (new Concatenation('FieldDefinition', [104, 'NameWithReserved', 105, 106, 'TypeHint', 107], 'FieldDefinition'))->setDefaultId('FieldDefinition'), 
306
            new Terminal(109, 'T_PARENTHESIS_OPEN', false), 
307
            new Repetition(110, 0, -1, '__fieldDefinitionArgument', null), 
308
            new Terminal(111, 'T_PARENTHESIS_CLOSE', false), 
309
            new Concatenation('__fieldDefinitionArguments', [109, 110, 111], 'FieldArguments'), 
310
            new Repetition(113, 0, 1, 'Directives', null), 
311
            new Concatenation('__fieldDefinitionArgument', ['ArgumentDefinition', 113], 'FieldArgument'), 
312
            new Repetition(115, 0, 1, 'Documentation', null), 
313
            new Concatenation(116, ['DirectiveDefinitionBody'], null), 
314
            (new Concatenation('DirectiveDefinition', [115, 116], 'DirectiveDefinition'))->setDefaultId('DirectiveDefinition'), 
315
            new Terminal(118, 'T_DIRECTIVE', false), 
316
            new Terminal(119, 'T_DIRECTIVE_AT', false), 
317
            new Repetition(120, 0, 1, '__directiveDefinitionArguments', null), 
318
            new Terminal(121, 'T_ON', false), 
319
            new Concatenation(122, ['__directiveDefinitionLocations'], null), 
320
            new Concatenation('DirectiveDefinitionBody', [118, 119, 'TypeName', 120, 121, 122], null), 
321
            new Terminal(124, 'T_PARENTHESIS_OPEN', false), 
322
            new Repetition(125, 0, -1, '__directiveDefinitionArgument', null), 
323
            new Terminal(126, 'T_PARENTHESIS_CLOSE', false), 
324
            new Concatenation('__directiveDefinitionArguments', [124, 125, 126], null), 
325
            new Concatenation('__directiveDefinitionArgument', ['ArgumentDefinition'], 'DirectiveArgument'), 
326
            new Terminal(129, 'T_OR', false), 
327
            new Repetition(130, 0, 1, 129, null), 
328
            new Repetition(131, 1, -1, '__directiveDefinitionLocation', null), 
329
            new Concatenation('__directiveDefinitionLocations', [130, 131], 'DirectiveLocations'), 
330
            new Terminal(133, 'T_OR', false), 
331
            new Concatenation(134, [133, 'NameWithReserved'], null), 
332
            new Repetition(135, 0, -1, 134, null), 
333
            new Concatenation('__directiveDefinitionLocation', ['NameWithReserved', 135], null), 
334
            new Repetition(137, 0, 1, 'Documentation', null), 
335
            new Concatenation(138, ['EnumDefinitionBody'], null), 
336
            (new Concatenation('EnumDefinition', [137, 'EnumDefinitionHead', 138], 'EnumDefinition'))->setDefaultId('EnumDefinition'), 
337
            new Terminal(140, 'T_ENUM', false), 
338
            new Repetition(141, 0, 1, 'Directives', null), 
339
            new Concatenation('EnumDefinitionHead', [140, 'TypeName', 141], null), 
340
            new Terminal(143, 'T_BRACE_OPEN', false), 
341
            new Terminal(144, 'T_BRACE_CLOSE', false), 
342
            new Concatenation('EnumDefinitionBody', [143, '__enumDefinitionFields', 144], null), 
343
            new Repetition(146, 0, -1, '__enumDefinitionField', null), 
344
            new Concatenation('__enumDefinitionFields', [146], 'EnumValues'), 
345
            new Terminal(148, 'T_COLON', false), 
346
            new Terminal(149, 'T_EQUAL', false), 
347
            new Concatenation(150, ['Value'], null), 
348
            new Concatenation('__enumDefinitionValue', [148, 'TypeHint', 149, 150], null), 
349
            new Repetition(152, 0, 1, 'Documentation', null), 
350
            new Repetition(153, 0, 1, '__enumDefinitionValue', null), 
351
            new Repetition(154, 0, 1, 'Directives', null), 
352
            new Concatenation('__enumDefinitionField', [152, 'NameExceptValues', 153, 154], 'EnumValue'), 
353
            new Repetition(156, 0, 1, 'Documentation', null), 
354
            new Concatenation(157, ['InputDefinitionBody'], null), 
355
            (new Concatenation('InputDefinition', [156, 'InputDefinitionHead', 157], 'InputDefinition'))->setDefaultId('InputDefinition'), 
356
            new Terminal(159, 'T_INPUT', false), 
357
            new Repetition(160, 0, 1, 'Directives', null), 
358
            new Concatenation('InputDefinitionHead', [159, 'TypeName', 160], null), 
359
            new Terminal(162, 'T_BRACE_OPEN', false), 
360
            new Repetition(163, 0, -1, '__inputDefinitionField', null), 
361
            new Terminal(164, 'T_BRACE_CLOSE', false), 
362
            new Concatenation('InputDefinitionBody', [162, 163, 164], null), 
363
            new Concatenation('__inputDefinitionField', ['InputFieldDefinition'], null), 
364
            new Repetition(167, 0, 1, 'Documentation', null), 
365
            new Terminal(168, 'T_COLON', false), 
366
            new Repetition(169, 0, 1, '__inputFieldDefinitionDefaultValue', null), 
367
            new Repetition(170, 0, 1, 'Directives', null), 
368
            (new Concatenation('InputFieldDefinition', [167, 'NameWithReserved', 168, 'TypeHint', 169, 170], 'InputFieldDefinition'))->setDefaultId('InputFieldDefinition'), 
369
            new Terminal(172, 'T_EQUAL', false), 
370
            new Concatenation(173, ['Value'], null), 
371
            new Concatenation('__inputFieldDefinitionDefaultValue', [172, 173], null), 
372
            new Repetition(175, 0, 1, 'Documentation', null), 
373
            new Repetition(176, 0, 1, 'InputUnionDefinitionBody', null), 
374
            (new Concatenation('InputUnionDefinition', [175, 'InputUnionDefinitionHead', 176], 'InputUnionDefinition'))->setDefaultId('InputUnionDefinition'), 
375
            new Terminal(178, 'T_INPUT_UNION', false), 
376
            new Repetition(179, 0, 1, 'Directives', null), 
377
            new Concatenation('InputUnionDefinitionHead', [178, 'TypeName', 179], null), 
378
            new Terminal(181, 'T_EQUAL', false), 
379
            new Terminal(182, 'T_OR', false), 
380
            new Repetition(183, 0, 1, 182, null), 
381
            new Repetition(184, 1, -1, '__inputUnionDefinitionTargets', null), 
382
            new Concatenation('InputUnionDefinitionBody', [181, 183, 184], null), 
383
            new Terminal(186, 'T_OR', false), 
384
            new Concatenation(187, [186, 'TypeName'], null), 
385
            new Repetition(188, 0, -1, 187, null), 
386
            new Concatenation('__inputUnionDefinitionTargets', ['TypeName', 188], null), 
387
            new Repetition(190, 0, 1, 'Documentation', null), 
388
            new Concatenation(191, ['InterfaceDefinitionBody'], null), 
389
            (new Concatenation('InterfaceDefinition', [190, 'InterfaceDefinitionHead', 191], 'InterfaceDefinition'))->setDefaultId('InterfaceDefinition'), 
390
            new Terminal(193, 'T_INTERFACE', false), 
391
            new Repetition(194, 0, 1, 'TypeArguments', null), 
392
            new Repetition(195, 0, 1, 'TypeDefinitionImplements', null), 
393
            new Repetition(196, 0, 1, 'Directives', null), 
394
            new Concatenation('InterfaceDefinitionHead', [193, 'TypeName', 194, 195, 196], null), 
395
            new Terminal(198, 'T_BRACE_OPEN', false), 
396
            new Repetition(199, 0, 1, '__interfaceFieldDefinitions', null), 
397
            new Repetition(200, 0, 1, 'ChildrenDefinitions', null), 
398
            new Terminal(201, 'T_BRACE_CLOSE', false), 
399
            new Concatenation('InterfaceDefinitionBody', [198, 199, 200, 201], null), 
400
            new Repetition(203, 0, -1, 'FieldDefinition', null), 
401
            new Concatenation('__interfaceFieldDefinitions', [203], 'FieldDefinitions'), 
402
            new Repetition(205, 0, 1, 'Documentation', null), 
403
            new Concatenation(206, ['ObjectDefinitionBody'], null), 
404
            (new Concatenation('ObjectDefinition', [205, 'ObjectDefinitionHead', 206], 'ObjectDefinition'))->setDefaultId('ObjectDefinition'), 
405
            new Terminal(208, 'T_TYPE', false), 
406
            new Repetition(209, 0, 1, 'TypeArguments', null), 
407
            new Repetition(210, 0, 1, 'TypeDefinitionImplements', null), 
408
            new Repetition(211, 0, 1, 'Directives', null), 
409
            new Concatenation('ObjectDefinitionHead', [208, 'TypeName', 209, 210, 211], null), 
410
            new Terminal(213, 'T_BRACE_OPEN', false), 
411
            new Repetition(214, 0, 1, '__objectFieldDefinitions', null), 
412
            new Repetition(215, 0, 1, 'ChildrenDefinitions', null), 
413
            new Terminal(216, 'T_BRACE_CLOSE', false), 
414
            new Concatenation('ObjectDefinitionBody', [213, 214, 215, 216], null), 
415
            new Repetition(218, 0, -1, 'FieldDefinition', null), 
416
            new Concatenation('__objectFieldDefinitions', [218], 'FieldDefinitions'), 
417
            new Repetition(220, 0, 1, 'Documentation', null), 
418
            new Concatenation(221, ['ScalarDefinitionBody'], null), 
419
            (new Concatenation('ScalarDefinition', [220, 221], 'ScalarDefinition'))->setDefaultId('ScalarDefinition'), 
420
            new Terminal(223, 'T_SCALAR', false), 
421
            new Repetition(224, 0, 1, '__scalarExtends', null), 
422
            new Repetition(225, 0, 1, 'Directives', null), 
423
            new Concatenation('ScalarDefinitionBody', [223, 'TypeName', 224, 225], null), 
424
            new Terminal(227, 'T_EXTENDS', false), 
425
            new Concatenation('__scalarExtends', [227, 'TypeName'], 'Extends'), 
426
            new Repetition(229, 0, 1, 'Documentation', null), 
427
            new Concatenation(230, ['SchemaDefinitionBody'], null), 
428
            (new Concatenation('SchemaDefinition', [229, 230], 'SchemaDefinition'))->setDefaultId('SchemaDefinition'), 
429
            new Terminal(232, 'T_SCHEMA', false), 
430
            new Repetition(233, 0, 1, 'TypeName', null), 
431
            new Terminal(234, 'T_BRACE_OPEN', false), 
432
            new Repetition(235, 0, -1, '__schemaField', null), 
433
            new Terminal(236, 'T_BRACE_CLOSE', false), 
434
            new Concatenation('SchemaDefinitionBody', [232, 233, 234, 235, 236], null), 
435
            new Repetition(238, 0, 1, 'Documentation', null), 
436
            new Terminal(239, 'T_COLON', false), 
437
            new Concatenation('__schemaField', [238, 'NameWithReserved', 239, 'TypeName'], 'SchemaField'), 
438
            new Repetition(241, 0, 1, 'Documentation', null), 
439
            new Repetition(242, 0, 1, 'UnionDefinitionBody', null), 
440
            (new Concatenation('UnionDefinition', [241, 'UnionDefinitionHead', 242], 'UnionDefinition'))->setDefaultId('UnionDefinition'), 
441
            new Terminal(244, 'T_UNION', false), 
442
            new Repetition(245, 0, 1, 'Directives', null), 
443
            new Concatenation('UnionDefinitionHead', [244, 'TypeName', 245], null), 
444
            new Terminal(247, 'T_EQUAL', false), 
445
            new Terminal(248, 'T_OR', false), 
446
            new Repetition(249, 0, 1, 248, null), 
447
            new Repetition(250, 1, -1, '__unionDefinitionTargets', null), 
448
            new Concatenation('UnionDefinitionBody', [247, 249, 250], null), 
449
            new Terminal(252, 'T_OR', false), 
450
            new Concatenation(253, [252, 'TypeName'], null), 
451
            new Repetition(254, 0, -1, 253, null), 
452
            new Concatenation('__unionDefinitionTargets', ['TypeName', 254], null), 
453
            new Concatenation(256, ['__typeDefinitions'], null), 
454
            new Alternation('Definition', ['DirectiveDefinition', 'SchemaDefinition', 256], null), 
455
            new Concatenation(258, ['__typeDefinitions'], null), 
456
            (new Concatenation('ChildrenDefinitions', [258], 'ChildrenDefinitions'))->setDefaultId('ChildrenDefinitions'), 
457
            new Concatenation(260, ['UnionDefinition'], null), 
458
            new Alternation('__typeDefinitions', ['EnumDefinition', 'InputDefinition', 'InputUnionDefinition', 'InterfaceDefinition', 'ObjectDefinition', 'ScalarDefinition', 260], null), 
459
            new Repetition(262, 0, 1, 'Documentation', null), 
460
            new Terminal(263, 'T_EXTEND', false), 
461
            new Concatenation(264, ['__enumExtensionVariants'], null), 
462
            (new Concatenation('EnumExtension', [262, 263, 264], 'EnumExtension'))->setDefaultId('EnumExtension'), 
463
            new Concatenation(266, ['EnumDefinitionHead', 'EnumDefinitionBody'], null), 
464
            new Alternation('__enumExtensionVariants', ['EnumDefinitionHead', 266], null), 
465
            new Repetition(268, 0, 1, 'Documentation', null), 
466
            new Terminal(269, 'T_EXTEND', false), 
467
            new Concatenation(270, ['__inputExtensionVariants'], null), 
468
            (new Concatenation('InputExtension', [268, 269, 270], 'InputExtension'))->setDefaultId('InputExtension'), 
469
            new Concatenation(272, ['InputDefinitionHead', 'InputDefinitionBody'], null), 
470
            new Alternation('__inputExtensionVariants', ['InputDefinitionHead', 272], null), 
471
            new Repetition(274, 0, 1, 'Documentation', null), 
472
            new Terminal(275, 'T_EXTEND', false), 
473
            new Concatenation(276, ['InputUnionDefinitionBody'], null), 
474
            (new Concatenation('InputUnionExtension', [274, 275, 'InputUnionDefinitionHead', 276], 'InputUnionExtension'))->setDefaultId('InputUnionExtension'), 
475
            new Repetition(278, 0, 1, 'Documentation', null), 
476
            new Terminal(279, 'T_EXTEND', false), 
477
            new Concatenation(280, ['__interfaceExtensionVariants'], null), 
478
            (new Concatenation('InterfaceExtension', [278, 279, 280], 'InterfaceExtension'))->setDefaultId('InterfaceExtension'), 
479
            new Concatenation(282, ['InterfaceDefinitionHead', 'InterfaceDefinitionBody'], null), 
480
            new Alternation('__interfaceExtensionVariants', ['InterfaceDefinitionHead', 282], null), 
481
            new Repetition(284, 0, 1, 'Documentation', null), 
482
            new Terminal(285, 'T_EXTEND', false), 
483
            new Concatenation(286, ['__objectExtensionVariants'], null), 
484
            (new Concatenation('ObjectExtension', [284, 285, 286], 'ObjectExtension'))->setDefaultId('ObjectExtension'), 
485
            new Concatenation(288, ['ObjectDefinitionHead', 'ObjectDefinitionBody'], null), 
486
            new Alternation('__objectExtensionVariants', ['ObjectDefinitionHead', 288], null), 
487
            new Repetition(290, 0, 1, 'Documentation', null), 
488
            new Terminal(291, 'T_EXTEND', false), 
489
            new Concatenation(292, ['ScalarDefinitionBody'], null), 
490
            (new Concatenation('ScalarExtension', [290, 291, 292], 'ScalarExtension'))->setDefaultId('ScalarExtension'), 
491
            new Repetition(294, 0, 1, 'Documentation', null), 
492
            new Terminal(295, 'T_EXTEND', false), 
493
            new Concatenation(296, ['SchemaDefinitionBody'], null), 
494
            (new Concatenation('SchemaExtension', [294, 295, 296], 'SchemaExtension'))->setDefaultId('SchemaExtension'), 
495
            new Repetition(298, 0, 1, 'Documentation', null), 
496
            new Terminal(299, 'T_EXTEND', false), 
497
            new Concatenation(300, ['UnionDefinitionBody'], null), 
498
            (new Concatenation('UnionExtension', [298, 299, 'UnionDefinitionHead', 300], 'UnionExtension'))->setDefaultId('UnionExtension'), 
499
            new Concatenation(302, ['UnionExtension'], null), 
500
            new Alternation('Extension', ['EnumExtension', 'InputExtension', 'InputUnionExtension', 'InterfaceExtension', 'ObjectExtension', 'ScalarExtension', 'SchemaExtension', 302], null), 
501
            new Terminal(304, 'T_COLON', false), 
502
            new Concatenation(305, ['Value'], null), 
503
            new Concatenation('ArgumentInvocation', ['NameWithReserved', 304, 305], null), 
504
            new Repetition(307, 1, -1, 'Directive', null), 
505
            (new Concatenation('Directives', [307], 'Directives'))->setDefaultId('Directives'), 
506
            new Terminal(309, 'T_DIRECTIVE_AT', false), 
507
            new Repetition(310, 0, 1, '__directiveInvocationArguments', null), 
508
            (new Concatenation('Directive', [309, 'TypeName', 310], 'Directive'))->setDefaultId('Directive'), 
509
            new Terminal(312, 'T_PARENTHESIS_OPEN', false), 
510
            new Repetition(313, 0, -1, '__directiveInvocationArgument', null), 
511
            new Terminal(314, 'T_PARENTHESIS_CLOSE', false), 
512
            new Concatenation('__directiveInvocationArguments', [312, 313, 314], null), 
513
            new Concatenation('__directiveInvocationArgument', ['ArgumentInvocation'], 'DirectiveArgument'), 
514
            new Concatenation(317, ['TypeName'], null), 
515
            (new Concatenation('TypeInvocation', [317], 'TypeInvocation'))->setDefaultId('TypeInvocation'), 
516
            new Concatenation('Invocation', ['Directive'], null)
517
        ], static::PARSER_ROOT_RULE, static::PARSER_DELEGATES);
518
    }
519
}
520