Test Failed
Push — master ( 33bfdc...47f867 )
by Kirill
02:32
created

BaseParser   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 574
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 8

Importance

Changes 0
Metric Value
dl 0
loc 574
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 8

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A bootLexer() 0 4 1
B bootGrammar() 0 376 1
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\Frontend;
11
12
use Railt\Lexer\Factory;
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 BaseParser has been auto-generated.
28
 * Generated at: 03-10-2018 22:13:43
29
 *
30
 * --- DO NOT EDIT THIS FILE ---
31
 */
32
class BaseParser 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_ANGLE_OPEN = 'T_ANGLE_OPEN';
48
    public const T_ANGLE_CLOSE = 'T_ANGLE_CLOSE';
49
    public const T_COMMA = 'T_COMMA';
50
    public const T_HEX_NUMBER = 'T_HEX_NUMBER';
51
    public const T_BIN_NUMBER = 'T_BIN_NUMBER';
52
    public const T_NUMBER = 'T_NUMBER';
53
    public const T_TRUE = 'T_TRUE';
54
    public const T_FALSE = 'T_FALSE';
55
    public const T_NULL = 'T_NULL';
56
    public const T_BLOCK_STRING = 'T_BLOCK_STRING';
57
    public const T_STRING = 'T_STRING';
58
    public const T_DEBUG = 'T_DEBUG';
59
    public const T_NAMESPACE = 'T_NAMESPACE';
60
    public const T_NAMESPACE_SEPARATOR = 'T_NAMESPACE_SEPARATOR';
61
    public const T_IMPORT = 'T_IMPORT';
62
    public const T_LET = 'T_LET';
63
    public const T_CONST = 'T_CONST';
64
    public const T_EXTEND = 'T_EXTEND';
65
    public const T_EXTENDS = 'T_EXTENDS';
66
    public const T_IMPLEMENTS = 'T_IMPLEMENTS';
67
    public const T_ON = 'T_ON';
68
    public const T_FRAGMENT = 'T_FRAGMENT';
69
    public const T_TYPE = 'T_TYPE';
70
    public const T_ENUM = 'T_ENUM';
71
    public const T_UNION = 'T_UNION';
72
    public const T_INTERFACE = 'T_INTERFACE';
73
    public const T_SCHEMA = 'T_SCHEMA';
74
    public const T_SCALAR = 'T_SCALAR';
75
    public const T_DIRECTIVE = 'T_DIRECTIVE';
76
    public const T_INPUT = 'T_INPUT';
77
    public const T_PLUS = 'T_PLUS';
78
    public const T_MINUS = 'T_MINUS';
79
    public const T_DIV = 'T_DIV';
80
    public const T_MUL = 'T_MUL';
81
    public const T_VARIABLE = 'T_VARIABLE';
82
    public const T_NAME = 'T_NAME';
83
    public const T_COMMENT = 'T_COMMENT';
84
    public const T_HTAB = 'T_HTAB';
85
    public const T_LF = 'T_LF';
86
    public const T_CR = 'T_CR';
87
    public const T_WHITESPACE = 'T_WHITESPACE';
88
    public const T_UTF32BE_BOM = 'T_UTF32BE_BOM';
89
    public const T_UTF32LE_BOM = 'T_UTF32LE_BOM';
90
    public const T_UTF16BE_BOM = 'T_UTF16BE_BOM';
91
    public const T_UTF16LE_BOM = 'T_UTF16LE_BOM';
92
    public const T_UTF8_BOM = 'T_UTF8_BOM';
93
    public const T_UTF7_BOM = 'T_UTF7_BOM';
94
95
    /**
96
     * Lexical tokens list.
97
     *
98
     * @var string[]
99
     */
100
    protected const LEXER_TOKENS = [
101
        self::T_AND => '&',
102
        self::T_OR => '\\|',
103
        self::T_PARENTHESIS_OPEN => '\\(',
104
        self::T_PARENTHESIS_CLOSE => '\\)',
105
        self::T_BRACKET_OPEN => '\\[',
106
        self::T_BRACKET_CLOSE => '\\]',
107
        self::T_BRACE_OPEN => '{',
108
        self::T_BRACE_CLOSE => '}',
109
        self::T_NON_NULL => '!',
110
        self::T_THREE_DOTS => '\\.{3}',
111
        self::T_COLON => ':',
112
        self::T_EQUAL => '=',
113
        self::T_DIRECTIVE_AT => '@',
114
        self::T_ANGLE_OPEN => '<',
115
        self::T_ANGLE_CLOSE => '>',
116
        self::T_COMMA => ',',
117
        self::T_HEX_NUMBER => '\\-?0x([0-9a-fA-F]+)',
118
        self::T_BIN_NUMBER => '\\-?0b([0-1]+)',
119
        self::T_NUMBER => '\\-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][\\+\\-]?[0-9]+)?',
120
        self::T_TRUE => '(?<=\\b)true\\b',
121
        self::T_FALSE => '(?<=\\b)false\\b',
122
        self::T_NULL => '(?<=\\b)null\\b',
123
        self::T_BLOCK_STRING => '"""((?:\\\\"""|(?!""").)*)"""',
124
        self::T_STRING => '"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"',
125
        self::T_DEBUG => '(?<=\\b)__dump\\b',
126
        self::T_NAMESPACE => '(?<=\\b)namespace\\b',
127
        self::T_NAMESPACE_SEPARATOR => '/',
128
        self::T_IMPORT => '(?<=\\b)import\\b',
129
        self::T_LET => '(?<=\\b)let\\b',
130
        self::T_CONST => '(?<=\\b)const\\b',
131
        self::T_EXTEND => '(?<=\\b)extend\\b',
132
        self::T_EXTENDS => '(?<=\\b)extends\\b',
133
        self::T_IMPLEMENTS => '(?<=\\b)implements\\b',
134
        self::T_ON => '(?<=\\b)on\\b',
135
        self::T_FRAGMENT => '(?<=\\b)fragment\\b',
136
        self::T_TYPE => '(?<=\\b)type\\b',
137
        self::T_ENUM => '(?<=\\b)enum\\b',
138
        self::T_UNION => '(?<=\\b)union\\b',
139
        self::T_INTERFACE => '(?<=\\b)interface\\b',
140
        self::T_SCHEMA => '(?<=\\b)schema\\b',
141
        self::T_SCALAR => '(?<=\\b)scalar\\b',
142
        self::T_DIRECTIVE => '(?<=\\b)directive\\b',
143
        self::T_INPUT => '(?<=\\b)input\\b',
144
        self::T_PLUS => '\\\\+',
145
        self::T_MINUS => '\\\\-',
146
        self::T_DIV => '\\\\/',
147
        self::T_MUL => '\\\\*',
148
        self::T_VARIABLE => '\\$([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)',
149
        self::T_NAME => '[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*',
150
        self::T_COMMENT => '#[^\\n]*',
151
        self::T_HTAB => '\\x09',
152
        self::T_LF => '\\x0A',
153
        self::T_CR => '\\x0D',
154
        self::T_WHITESPACE => '\\x20',
155
        self::T_UTF32BE_BOM => '^\\x00\\x00\\xFE\\xFF',
156
        self::T_UTF32LE_BOM => '^\\xFE\\xFF\\x00\\x00',
157
        self::T_UTF16BE_BOM => '^\\xFE\\xFF',
158
        self::T_UTF16LE_BOM => '^\\xFF\\xFE',
159
        self::T_UTF8_BOM => '^\\xEF\\xBB\\xBF',
160
        self::T_UTF7_BOM => '^\\x2B\\x2F\\x76\\x38\\x2B\\x2F\\x76\\x39\\x2B\\x2F\\x76\\x2B\\x2B\\x2F\\x76\\x2F',
161
    ];
162
163
    /**
164
     * List of skipped tokens.
165
     *
166
     * @var string[]
167
     */
168
    protected const LEXER_SKIPPED_TOKENS = [
169
        'T_COMMENT',
170
        'T_HTAB',
171
        'T_LF',
172
        'T_CR',
173
        'T_WHITESPACE',
174
        'T_UTF32BE_BOM',
175
        'T_UTF32LE_BOM',
176
        'T_UTF16BE_BOM',
177
        'T_UTF16LE_BOM',
178
        'T_UTF8_BOM',
179
        'T_UTF7_BOM',
180
    ];
181
182
    /**
183
     * @var int
184
     */
185
    protected const LEXER_FLAGS = Factory::LOOKAHEAD;
186
187
    /**
188
     * List of rule delegates.
189
     *
190
     * @var string[]
191
     */
192
    protected const PARSER_DELEGATES = [
193
        'NumberValue' => \Railt\SDL\Frontend\AST\Value\NumberValueNode::class,
194
        'StringValue' => \Railt\SDL\Frontend\AST\Value\StringValueNode::class,
195
        'NullValue' => \Railt\SDL\Frontend\AST\Value\NullValueNode::class,
196
        'ConstantValue' => \Railt\SDL\Frontend\AST\Value\ConstantValueNode::class,
197
    ];
198
199
    /**
200
     * Parser root rule name.
201
     *
202
     * @var string
203
     */
204
    protected const PARSER_ROOT_RULE = 'Document';
205
206
    /**
207
     * @return ParserInterface
208
     * @throws \InvalidArgumentException
209
     * @throws \Railt\Lexer\Exception\BadLexemeException
210
     */
211
    protected function boot(): ParserInterface
212
    {
213
        return new Llk($this->bootLexer(), $this->bootGrammar());
214
    }
215
216
    /**
217
     * @return LexerInterface
218
     * @throws \InvalidArgumentException
219
     * @throws \Railt\Lexer\Exception\BadLexemeException
220
     */
221
    protected function bootLexer(): LexerInterface
222
    {
223
        return Factory::create(static::LEXER_TOKENS, static::LEXER_SKIPPED_TOKENS, static::LEXER_FLAGS);
224
    }
225
226
    /**
227
     * @return GrammarInterface
228
     */
229
    protected function bootGrammar(): GrammarInterface
230
    {
231
        return new Grammar([
232
            new Concatenation(0, ['__documentBody'], null), 
233
            (new Concatenation('Document', [0], 'Document'))->setDefaultId('Document'), 
234
            new Concatenation(2, ['DocumentBody'], null), 
235
            new Concatenation('__documentBody', ['DocumentHead', 2], null), 
236
            new Alternation(4, ['Instruction', 'Directive'], null), 
237
            new Repetition('DocumentHead', 0, -1, 4, null), 
238
            new Alternation(6, ['Instruction', 'Extension', 'Definition'], null), 
239
            new Repetition('DocumentBody', 0, -1, 6, null), 
240
            new Concatenation(8, ['StringValue'], null), 
241
            (new Concatenation('Description', [8], 'Description'))->setDefaultId('Description'), 
242
            new Terminal(10, 'T_EXTENDS', false), 
243
            new Concatenation(11, ['TypeInvocation'], null), 
244
            (new Concatenation('TypeDefinitionExtends', [10, 11], 'TypeDefinitionExtends'))->setDefaultId('TypeDefinitionExtends'), 
245
            new Concatenation(13, ['__typeHintList'], 'TypeHint'), 
246
            new Concatenation(14, ['__typeHintSingular'], null), 
247
            new Concatenation(15, [14], 'TypeHint'), 
248
            (new Alternation('TypeHint', [13, 15], null))->setDefaultId('TypeHint'), 
249
            new Concatenation(17, ['__typeHintNullableList'], null), 
250
            new Alternation('__typeHintList', ['__typeHintNonNullList', 17], null), 
251
            new Terminal(19, 'T_BRACKET_OPEN', false), 
252
            new Terminal(20, 'T_BRACKET_CLOSE', false), 
253
            new Concatenation('__typeHintNullableList', [19, '__typeHintSingular', 20], 'List'), 
254
            new Terminal(22, 'T_NON_NULL', false), 
255
            new Concatenation('__typeHintNonNullList', ['__typeHintNullableList', 22], 'NonNull'), 
256
            new Concatenation(24, ['__typeHintNullableSingular'], null), 
257
            new Alternation('__typeHintSingular', ['__typeHintNonNullSingular', 24], null), 
258
            new Concatenation('__typeHintNullableSingular', ['TypeInvocation'], null), 
259
            new Terminal(27, 'T_NON_NULL', false), 
260
            new Concatenation('__typeHintNonNullSingular', ['TypeInvocation', 27], 'NonNull'), 
261
            new Terminal(29, 'T_IMPLEMENTS', false), 
262
            new Repetition(30, 0, 1, '__implementsDelimiter', null), 
263
            new Concatenation(31, ['__implementsDelimiter', 'TypeInvocation'], 'TypeDefinitionImplements'), 
264
            new Repetition(32, 0, -1, 31, null), 
265
            (new Concatenation('TypeDefinitionImplements', [29, 30, 'TypeInvocation', 32], null))->setDefaultId('TypeDefinitionImplements'), 
266
            new Terminal(34, 'T_COMMA', false), 
267
            new Terminal(35, 'T_AND', false), 
268
            new Alternation('__implementsDelimiter', [34, 35], null), 
269
            new Terminal('NameWithoutReserved', 'T_NAME', true), 
270
            new Terminal(38, 'T_TRUE', true), 
271
            new Terminal(39, 'T_FALSE', true), 
272
            new Terminal(40, 'T_NULL', true), 
273
            new Alternation('NameWithReserved', ['NameExceptValues', 38, 39, 40], null), 
274
            new Terminal(42, 'T_NAMESPACE', true), 
275
            new Terminal(43, 'T_IMPORT', true), 
276
            new Terminal(44, 'T_LET', true), 
277
            new Terminal(45, 'T_CONST', true), 
278
            new Terminal(46, 'T_EXTEND', true), 
279
            new Terminal(47, 'T_EXTENDS', true), 
280
            new Terminal(48, 'T_IMPLEMENTS', true), 
281
            new Terminal(49, 'T_ON', true), 
282
            new Terminal(50, 'T_FRAGMENT', true), 
283
            new Terminal(51, 'T_TYPE', true), 
284
            new Terminal(52, 'T_ENUM', true), 
285
            new Terminal(53, 'T_UNION', true), 
286
            new Terminal(54, 'T_INPUT_UNION', true), 
287
            new Terminal(55, 'T_INTERFACE', true), 
288
            new Terminal(56, 'T_SCHEMA', true), 
289
            new Terminal(57, 'T_SCALAR', true), 
290
            new Terminal(58, 'T_DIRECTIVE', true), 
291
            new Terminal(59, 'T_INPUT', true), 
292
            new Alternation('NameExceptValues', ['NameWithoutReserved', 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59], null), 
293
            new Repetition(61, 0, 1, '__typeNameAtRoot', null), 
294
            new Terminal(62, 'T_NAMESPACE_SEPARATOR', false), 
295
            new Concatenation(63, [62, 'NameWithReserved'], 'TypeName'), 
296
            new Repetition(64, 0, -1, 63, null), 
297
            (new Concatenation('TypeName', [61, 'NameWithReserved', 64], null))->setDefaultId('TypeName'), 
298
            new Terminal(66, 'T_NAMESPACE_SEPARATOR', false), 
299
            new Concatenation('__typeNameAtRoot', [66], 'AtRoot'), 
300
            new Terminal(68, 'T_VARIABLE', true), 
301
            (new Concatenation('VariableName', [68], 'VariableName'))->setDefaultId('VariableName'), 
302
            new Concatenation(70, ['NameWithReserved'], null), 
303
            (new Concatenation('ConstantName', [70], 'ConstantName'))->setDefaultId('ConstantName'), 
304
            new Concatenation('EnumValueConstantName', ['NameExceptValues'], 'ConstantName'), 
305
            new Terminal(73, 'T_PARENTHESIS_OPEN', false), 
306
            new Repetition(74, 0, 1, '__argumentDefinitions', null), 
307
            new Terminal(75, 'T_PARENTHESIS_CLOSE', false), 
308
            new Concatenation('ArgumentDefinitions', [73, 74, 75], null), 
309
            new Repetition('__argumentDefinitions', 1, -1, 'ArgumentDefinition', null), 
310
            new Repetition(78, 0, 1, 'Description', null), 
311
            new Repetition(79, 0, 1, '__argumentDefinitionDefaultValue', null), 
312
            new Terminal(80, 'T_COMMA', false), 
313
            new Repetition(81, 0, 1, 80, null), 
314
            new Repetition(82, 0, -1, 'Directive', null), 
315
            new Terminal(83, 'T_COMMA', false), 
316
            new Repetition(84, 0, 1, 83, null), 
317
            (new Concatenation('ArgumentDefinition', [78, '__argumentDefinitionBody', 79, 81, 82, 84], 'ArgumentDefinition'))->setDefaultId('ArgumentDefinition'), 
318
            new Terminal(86, 'T_COLON', false), 
319
            new Concatenation(87, ['TypeHint'], null), 
320
            new Concatenation('__argumentDefinitionBody', ['ConstantName', 86, 87], null), 
321
            new Terminal(89, 'T_EQUAL', false), 
322
            new Concatenation('__argumentDefinitionDefaultValue', [89, 'Value'], 'DefaultValue'), 
323
            new Repetition(91, 0, 1, 'Description', null), 
324
            new Concatenation(92, ['DirectiveDefinitionBody'], null), 
325
            (new Concatenation('DirectiveDefinition', [91, 'DirectiveDefinitionHead', 92], 'DirectiveDefinition'))->setDefaultId('DirectiveDefinition'), 
326
            new Terminal(94, 'T_DIRECTIVE', false), 
327
            new Terminal(95, 'T_DIRECTIVE_AT', false), 
328
            new Repetition(96, 0, 1, 'ArgumentDefinitions', null), 
329
            new Concatenation('DirectiveDefinitionHead', [94, 95, 'TypeDefinition', 96], null), 
330
            new Terminal(98, 'T_ON', false), 
331
            new Concatenation(99, ['DirectiveLocations'], null), 
332
            new Concatenation('DirectiveDefinitionBody', [98, 99], null), 
333
            new Terminal(101, 'T_OR', false), 
334
            new Repetition(102, 0, 1, 101, null), 
335
            new Terminal(103, 'T_OR', false), 
336
            new Concatenation(104, [103, 'DirectiveLocation'], 'DirectiveLocations'), 
337
            new Repetition(105, 0, -1, 104, null), 
338
            (new Concatenation('DirectiveLocations', [102, 'DirectiveLocation', 105], null))->setDefaultId('DirectiveLocations'), 
339
            new Concatenation(107, ['ConstantName'], null), 
340
            (new Concatenation('DirectiveLocation', [107], 'DirectiveLocation'))->setDefaultId('DirectiveLocation'), 
341
            new Repetition(109, 0, 1, 'Description', null), 
342
            new Repetition(110, 0, 1, 'EnumDefinitionBody', null), 
343
            (new Concatenation('EnumDefinition', [109, 'EnumDefinitionHead', 110], 'EnumDefinition'))->setDefaultId('EnumDefinition'), 
344
            new Repetition(112, 0, 1, 'Description', null), 
345
            new Terminal(113, 'T_EXTEND', false), 
346
            new Concatenation(114, ['EnumDefinition'], null), 
347
            (new Concatenation('EnumExtension', [112, 113, 114], 'EnumExtension'))->setDefaultId('EnumExtension'), 
348
            new Terminal(116, 'T_ENUM', false), 
349
            new Repetition(117, 0, -1, 'Directive', null), 
350
            new Concatenation('EnumDefinitionHead', [116, 'TypeDefinition', 117], null), 
351
            new Terminal(119, 'T_BRACE_OPEN', false), 
352
            new Repetition(120, 0, -1, 'EnumValueDefinition', null), 
353
            new Terminal(121, 'T_BRACE_CLOSE', false), 
354
            new Concatenation('EnumDefinitionBody', [119, 120, 121], null), 
355
            new Repetition(123, 0, 1, 'Description', null), 
356
            new Repetition(124, 0, 1, '__enumDefinitionValue', null), 
357
            new Terminal(125, 'T_COMMA', false), 
358
            new Repetition(126, 0, 1, 125, null), 
359
            new Repetition(127, 0, -1, 'Directive', null), 
360
            new Terminal(128, 'T_COMMA', false), 
361
            new Repetition(129, 0, 1, 128, null), 
362
            (new Concatenation('EnumValueDefinition', [123, 'EnumValueConstantName', 124, 126, 127, 129], 'EnumValueDefinition'))->setDefaultId('EnumValueDefinition'), 
363
            new Terminal(131, 'T_COLON', false), 
364
            new Terminal(132, 'T_EQUAL', false), 
365
            new Concatenation(133, ['Value'], null), 
366
            new Concatenation('__enumDefinitionValue', [131, 'TypeHint', 132, 133], null), 
367
            new Repetition(135, 0, 1, 'Description', null), 
368
            new Repetition(136, 0, 1, 'ArgumentDefinitions', null), 
369
            new Terminal(137, 'T_COLON', false), 
370
            new Terminal(138, 'T_COMMA', false), 
371
            new Repetition(139, 0, 1, 138, null), 
372
            new Repetition(140, 0, -1, 'Directive', null), 
373
            new Terminal(141, 'T_COMMA', false), 
374
            new Repetition(142, 0, 1, 141, null), 
375
            (new Concatenation('FieldDefinition', [135, 'ConstantName', 136, 137, 'TypeHint', 139, 140, 142], 'FieldDefinition'))->setDefaultId('FieldDefinition'), 
376
            new Repetition(144, 0, 1, 'Description', null), 
377
            new Repetition(145, 0, 1, 'InputDefinitionBody', null), 
378
            (new Concatenation('InputDefinition', [144, 'InputDefinitionHead', 145], 'InputDefinition'))->setDefaultId('InputDefinition'), 
379
            new Repetition(147, 0, 1, 'Description', null), 
380
            new Terminal(148, 'T_EXTEND', false), 
381
            new Concatenation(149, ['InputDefinition'], null), 
382
            (new Concatenation('InputExtension', [147, 148, 149], 'InputExtension'))->setDefaultId('InputExtension'), 
383
            new Terminal(151, 'T_INPUT', false), 
384
            new Repetition(152, 0, -1, 'Directive', null), 
385
            new Concatenation('InputDefinitionHead', [151, 'TypeDefinition', 152], null), 
386
            new Terminal(154, 'T_BRACE_OPEN', false), 
387
            new Repetition(155, 0, -1, 'InputFieldDefinition', null), 
388
            new Terminal(156, 'T_BRACE_CLOSE', false), 
389
            new Concatenation('InputDefinitionBody', [154, 155, 156], null), 
390
            new Repetition(158, 0, 1, 'Description', null), 
391
            new Repetition(159, 0, 1, '__inputFieldDefinitionDefaultValue', null), 
392
            new Terminal(160, 'T_COMMA', false), 
393
            new Repetition(161, 0, 1, 160, null), 
394
            new Repetition(162, 0, -1, 'Directive', null), 
395
            new Terminal(163, 'T_COMMA', false), 
396
            new Repetition(164, 0, 1, 163, null), 
397
            (new Concatenation('InputFieldDefinition', [158, '__inputFieldDefinitionBody', 159, 161, 162, 164], 'InputFieldDefinition'))->setDefaultId('InputFieldDefinition'), 
398
            new Terminal(166, 'T_COLON', false), 
399
            new Concatenation(167, ['TypeHint'], null), 
400
            new Concatenation('__inputFieldDefinitionBody', ['ConstantName', 166, 167], null), 
401
            new Terminal(169, 'T_EQUAL', false), 
402
            new Concatenation(170, ['Value'], null), 
403
            new Concatenation('__inputFieldDefinitionDefaultValue', [169, 170], null), 
404
            new Repetition(172, 0, 1, 'Description', null), 
405
            new Repetition(173, 0, 1, 'InterfaceDefinitionBody', null), 
406
            (new Concatenation('InterfaceDefinition', [172, 'InterfaceDefinitionHead', 173], 'InterfaceDefinition'))->setDefaultId('InterfaceDefinition'), 
407
            new Repetition(175, 0, 1, 'Description', null), 
408
            new Terminal(176, 'T_EXTEND', false), 
409
            new Concatenation(177, ['InterfaceDefinition'], null), 
410
            (new Concatenation('InterfaceExtension', [175, 176, 177], 'InterfaceExtension'))->setDefaultId('InterfaceExtension'), 
411
            new Terminal(179, 'T_INTERFACE', false), 
412
            new Repetition(180, 0, 1, 'TypeDefinitionImplements', null), 
413
            new Repetition(181, 0, -1, 'Directive', null), 
414
            new Concatenation('InterfaceDefinitionHead', [179, 'TypeDefinition', 180, 181], null), 
415
            new Terminal(183, 'T_BRACE_OPEN', false), 
416
            new Repetition(184, 0, -1, 'FieldDefinition', null), 
417
            new Terminal(185, 'T_BRACE_CLOSE', false), 
418
            new Concatenation('InterfaceDefinitionBody', [183, 184, 185], null), 
419
            new Repetition(187, 0, 1, 'Description', null), 
420
            new Repetition(188, 0, 1, 'ObjectDefinitionBody', null), 
421
            (new Concatenation('ObjectDefinition', [187, 'ObjectDefinitionHead', 188], 'ObjectDefinition'))->setDefaultId('ObjectDefinition'), 
422
            new Repetition(190, 0, 1, 'Description', null), 
423
            new Terminal(191, 'T_EXTEND', false), 
424
            new Concatenation(192, ['ObjectDefinition'], null), 
425
            (new Concatenation('ObjectExtension', [190, 191, 192], 'ObjectExtension'))->setDefaultId('ObjectExtension'), 
426
            new Terminal(194, 'T_TYPE', false), 
427
            new Repetition(195, 0, 1, 'TypeDefinitionImplements', null), 
428
            new Repetition(196, 0, -1, 'Directive', null), 
429
            new Concatenation('ObjectDefinitionHead', [194, 'TypeDefinition', 195, 196], null), 
430
            new Terminal(198, 'T_BRACE_OPEN', false), 
431
            new Repetition(199, 0, -1, 'FieldDefinition', null), 
432
            new Terminal(200, 'T_BRACE_CLOSE', false), 
433
            new Concatenation('ObjectDefinitionBody', [198, 199, 200], null), 
434
            new Repetition(202, 0, 1, 'Description', null), 
435
            new Concatenation(203, ['ScalarDefinitionBody'], null), 
436
            (new Concatenation('ScalarDefinition', [202, 203], 'ScalarDefinition'))->setDefaultId('ScalarDefinition'), 
437
            new Repetition(205, 0, 1, 'Description', null), 
438
            new Terminal(206, 'T_EXTEND', false), 
439
            new Concatenation(207, ['ScalarDefinition'], null), 
440
            (new Concatenation('ScalarExtension', [205, 206, 207], 'ScalarExtension'))->setDefaultId('ScalarExtension'), 
441
            new Terminal(209, 'T_SCALAR', false), 
442
            new Repetition(210, 0, 1, 'TypeDefinitionExtends', null), 
443
            new Repetition(211, 0, -1, 'Directive', null), 
444
            new Concatenation('ScalarDefinitionBody', [209, 'TypeDefinition', 210, 211], null), 
445
            new Repetition(213, 0, 1, 'Description', null), 
446
            new Repetition(214, 0, 1, 'SchemaDefinitionBody', null), 
447
            (new Concatenation('SchemaDefinition', [213, 'SchemaDefinitionHead', 214], 'SchemaDefinition'))->setDefaultId('SchemaDefinition'), 
448
            new Repetition(216, 0, 1, 'Description', null), 
449
            new Terminal(217, 'T_EXTEND', false), 
450
            new Concatenation(218, ['SchemaDefinition'], null), 
451
            (new Concatenation('SchemaExtension', [216, 217, 218], 'SchemaExtension'))->setDefaultId('SchemaExtension'), 
452
            new Terminal(220, 'T_SCHEMA', false), 
453
            new Repetition(221, 0, 1, 'TypeName', null), 
454
            new Repetition(222, 0, -1, 'Directive', null), 
455
            new Concatenation('SchemaDefinitionHead', [220, 221, 222], null), 
456
            new Terminal(224, 'T_BRACE_OPEN', false), 
457
            new Repetition(225, 0, -1, 'SchemaFieldDefinition', null), 
458
            new Terminal(226, 'T_BRACE_CLOSE', false), 
459
            new Concatenation('SchemaDefinitionBody', [224, 225, 226], null), 
460
            new Terminal(228, 'T_COLON', false), 
461
            new Terminal(229, 'T_COMMA', false), 
462
            new Repetition(230, 0, 1, 229, null), 
463
            new Repetition(231, 0, -1, 'Directive', null), 
464
            new Terminal(232, 'T_COMMA', false), 
465
            new Repetition(233, 0, 1, 232, null), 
466
            (new Concatenation('SchemaFieldDefinition', ['ConstantName', 228, 'TypeHint', 230, 231, 233], 'SchemaFieldDefinition'))->setDefaultId('SchemaFieldDefinition'), 
467
            new Repetition(235, 0, 1, 'Description', null), 
468
            new Repetition(236, 0, 1, 'UnionDefinitionBody', null), 
469
            (new Concatenation('UnionDefinition', [235, 'UnionDefinitionHead', 236], 'UnionDefinition'))->setDefaultId('UnionDefinition'), 
470
            new Repetition(238, 0, 1, 'Description', null), 
471
            new Terminal(239, 'T_EXTEND', false), 
472
            new Concatenation(240, ['UnionDefinition'], null), 
473
            (new Concatenation('UnionExtension', [238, 239, 240], 'UnionExtension'))->setDefaultId('UnionExtension'), 
474
            new Terminal(242, 'T_UNION', false), 
475
            new Repetition(243, 0, -1, 'Directive', null), 
476
            new Concatenation('UnionDefinitionHead', [242, 'TypeDefinition', 243], null), 
477
            new Terminal(245, 'T_EQUAL', false), 
478
            new Repetition(246, 0, 1, 'UnionDefinitionTargets', null), 
479
            new Concatenation('UnionDefinitionBody', [245, 246], null), 
480
            new Terminal(248, 'T_OR', false), 
481
            new Repetition(249, 0, 1, 248, null), 
482
            new Terminal(250, 'T_OR', false), 
483
            new Concatenation(251, [250, 'TypeInvocation'], 'UnionDefinitionTargets'), 
484
            new Repetition(252, 0, -1, 251, null), 
485
            (new Concatenation('UnionDefinitionTargets', [249, 'TypeInvocation', 252], null))->setDefaultId('UnionDefinitionTargets'), 
486
            new Concatenation(254, ['UnionDefinition'], null), 
487
            new Alternation('Definition', ['DirectiveDefinition', 'SchemaDefinition', 'EnumDefinition', 'InputDefinition', 'InterfaceDefinition', 'ObjectDefinition', 'ScalarDefinition', 254], null), 
488
            new Concatenation(256, ['UnionExtension'], null), 
489
            new Alternation('Extension', ['EnumExtension', 'InputExtension', 'InterfaceExtension', 'ObjectExtension', 'ScalarExtension', 'SchemaExtension', 256], null), 
490
            new Repetition(258, 0, 1, '__genericDefinitionArguments', null), 
491
            (new Concatenation('TypeDefinition', ['TypeName', 258], 'TypeDefinition'))->setDefaultId('TypeDefinition'), 
492
            new Terminal(260, 'T_ANGLE_OPEN', false), 
493
            new Repetition(261, 0, -1, 'GenericDefinitionArgument', null), 
494
            new Terminal(262, 'T_ANGLE_CLOSE', false), 
495
            new Concatenation('__genericDefinitionArguments', [260, 261, 262], null), 
496
            new Terminal(264, 'T_COLON', false), 
497
            new Repetition(265, 0, 1, 'GenericDefinitionArgumentDefaultValue', null), 
498
            new Terminal(266, 'T_COMMA', false), 
499
            new Repetition(267, 0, 1, 266, null), 
500
            (new Concatenation('GenericDefinitionArgument', ['GenericDefinitionArgumentName', 264, 'GenericDefinitionArgumentValue', 265, 267], 'GenericDefinitionArgument'))->setDefaultId('GenericDefinitionArgument'), 
501
            new Concatenation(269, ['ConstantName'], null), 
502
            (new Concatenation('GenericDefinitionArgumentName', [269], 'GenericDefinitionArgumentName'))->setDefaultId('GenericDefinitionArgumentName'), 
503
            new Concatenation(271, ['TypeName'], null), 
504
            (new Concatenation('GenericDefinitionArgumentValue', [271], 'GenericDefinitionArgumentValue'))->setDefaultId('GenericDefinitionArgumentValue'), 
505
            new Terminal(273, 'T_EQUAL', false), 
506
            new Concatenation(274, ['TypeInvocation'], null), 
507
            (new Concatenation('GenericDefinitionArgumentDefaultValue', [273, 274], 'GenericDefinitionArgumentDefaultValue'))->setDefaultId('GenericDefinitionArgumentDefaultValue'), 
508
            new Terminal(276, 'T_PARENTHESIS_OPEN', false), 
509
            new Repetition(277, 0, -1, 'ArgumentValue', null), 
510
            new Terminal(278, 'T_PARENTHESIS_CLOSE', false), 
511
            new Concatenation('ArgumentValues', [276, 277, 278], null), 
512
            new Terminal(280, 'T_COLON', false), 
513
            new Terminal(281, 'T_COMMA', false), 
514
            new Repetition(282, 0, 1, 281, null), 
515
            (new Concatenation('ArgumentValue', ['ConstantName', 280, 'Value', 282], 'ArgumentValue'))->setDefaultId('ArgumentValue'), 
516
            new Terminal(284, 'T_DIRECTIVE_AT', false), 
517
            new Repetition(285, 0, 1, 'ArgumentValues', null), 
518
            (new Concatenation('Directive', [284, 'TypeInvocation', 285], 'Directive'))->setDefaultId('Directive'), 
519
            new Terminal(287, 'T_FALSE', true), 
520
            new Concatenation(288, [287], 'BooleanValue'), 
521
            new Terminal(289, 'T_TRUE', true), 
522
            new Concatenation(290, [289], 'BooleanValue'), 
523
            (new Alternation('BooleanValue', [288, 290], null))->setDefaultId('BooleanValue'), 
524
            new Terminal(292, 'T_NUMBER', true), 
525
            new Concatenation(293, [292], 'NumberValue'), 
526
            new Terminal(294, 'T_HEX_NUMBER', true), 
527
            new Concatenation(295, [294], 'NumberValue'), 
528
            new Terminal(296, 'T_BIN_NUMBER', true), 
529
            new Concatenation(297, [296], 'NumberValue'), 
530
            (new Alternation('NumberValue', [293, 295, 297], null))->setDefaultId('NumberValue'), 
531
            new Terminal(299, 'T_BLOCK_STRING', true), 
532
            new Concatenation(300, [299], 'StringValue'), 
533
            new Terminal(301, 'T_STRING', true), 
534
            new Concatenation(302, [301], 'StringValue'), 
535
            (new Alternation('StringValue', [300, 302], null))->setDefaultId('StringValue'), 
536
            new Terminal(304, 'T_NULL', false), 
537
            (new Concatenation('NullValue', [304], 'NullValue'))->setDefaultId('NullValue'), 
538
            new Terminal(306, 'T_BRACE_OPEN', false), 
539
            new Repetition(307, 0, -1, 'ArgumentValue', null), 
540
            new Terminal(308, 'T_BRACE_CLOSE', false), 
541
            (new Concatenation('InputValue', [306, 307, 308], 'InputValue'))->setDefaultId('InputValue'), 
542
            new Terminal(310, 'T_BRACKET_OPEN', false), 
543
            new Repetition(311, 0, -1, '__listValue', null), 
544
            new Terminal(312, 'T_BRACKET_CLOSE', false), 
545
            (new Concatenation('ListValue', [310, 311, 312], 'ListValue'))->setDefaultId('ListValue'), 
546
            new Terminal(314, 'T_COMMA', false), 
547
            new Repetition(315, 0, 1, 314, null), 
548
            new Concatenation('__listValue', ['Value', 315], null), 
549
            new Concatenation(317, ['NameExceptValues'], null), 
550
            (new Concatenation('ConstantValue', [317], 'ConstantValue'))->setDefaultId('ConstantValue'), 
551
            new Concatenation(319, ['ConstantValue'], null), 
552
            new Alternation('Value', ['BooleanValue', 'NullValue', 'NumberValue', 'StringValue', 'InputValue', 'ListValue', 319], null), 
553
            new Repetition(321, 0, 1, '__genericInvocationArguments', null), 
554
            (new Concatenation('TypeInvocation', ['GenericInvocationName', 321], 'TypeInvocation'))->setDefaultId('TypeInvocation'), 
555
            new Concatenation(323, ['TypeName'], 'GenericInvocationName'), 
556
            new Concatenation(324, ['VariableName'], null), 
557
            new Concatenation(325, [324], 'GenericInvocationName'), 
558
            (new Alternation('GenericInvocationName', [323, 325], null))->setDefaultId('GenericInvocationName'), 
559
            new Terminal(327, 'T_ANGLE_OPEN', false), 
560
            new Repetition(328, 0, -1, 'GenericInvocationArgument', null), 
561
            new Terminal(329, 'T_ANGLE_CLOSE', false), 
562
            new Concatenation('__genericInvocationArguments', [327, 328, 329], null), 
563
            new Terminal(331, 'T_COLON', false), 
564
            new Terminal(332, 'T_COMMA', false), 
565
            new Repetition(333, 0, 1, 332, null), 
566
            new Concatenation('GenericInvocationArgument', ['GenericInvocationArgumentName', 331, 'GenericInvocationArgumentValue', 333], 'GenericInvocationArgument'), 
567
            new Concatenation(335, ['ConstantName'], 'GenericInvocationArgumentName'), 
568
            new Concatenation(336, ['VariableName'], null), 
569
            new Concatenation(337, [336], 'GenericInvocationArgumentName'), 
570
            (new Alternation('GenericInvocationArgumentName', [335, 337], null))->setDefaultId('GenericInvocationArgumentName'), 
571
            new Concatenation(339, ['TypeInvocation'], 'GenericInvocationArgumentValue'), 
572
            new Concatenation(340, ['VariableName'], null), 
573
            new Concatenation(341, [340], 'GenericInvocationArgumentValue'), 
574
            (new Alternation('GenericInvocationArgumentValue', [339, 341], null))->setDefaultId('GenericInvocationArgumentValue'), 
575
            new Terminal(343, 'T_IMPORT', false), 
576
            new Concatenation(344, ['Value'], 'ImportDefinition'), 
577
            new Concatenation(345, ['VariableName'], 'ImportDefinition'), 
578
            new Alternation(346, [344, 345], null), 
579
            (new Concatenation('ImportDefinition', [343, 346], null))->setDefaultId('ImportDefinition'), 
580
            new Terminal(348, 'T_NAMESPACE', false), 
581
            new Concatenation(349, ['TypeName'], null), 
582
            (new Concatenation('NamespaceDefinition', [348, 349], 'NamespaceDefinition'))->setDefaultId('NamespaceDefinition'), 
583
            new Concatenation(351, ['__variableDefinitionBody'], null), 
584
            (new Concatenation('VariableReassigment', [351], 'VariableReassigment'))->setDefaultId('VariableReassigment'), 
585
            new Terminal(353, 'T_LET', false), 
586
            new Concatenation(354, ['__variableDefinitionBody'], null), 
587
            (new Concatenation('VariableDefinition', [353, 354], 'VariableDefinition'))->setDefaultId('VariableDefinition'), 
588
            new Terminal(356, 'T_CONST', false), 
589
            new Concatenation(357, ['__variableDefinitionBody'], null), 
590
            (new Concatenation('ConstantDefinition', [356, 357], 'ConstantDefinition'))->setDefaultId('ConstantDefinition'), 
591
            new Terminal(359, 'T_EQUAL', false), 
592
            new Concatenation(360, ['VariableName', 359], null), 
593
            new Repetition(361, 1, -1, 360, null), 
594
            new Concatenation(362, ['VariableValue'], null), 
595
            new Concatenation('__variableDefinitionBody', [361, 362], null), 
596
            new Concatenation(364, ['VariableName'], 'VariableValue'), 
597
            new Concatenation(365, ['Value'], 'VariableValue'), 
598
            new Concatenation(366, ['TypeInvocation'], null), 
599
            new Concatenation(367, [366], 'VariableValue'), 
600
            (new Alternation('VariableValue', [364, 365, 367], null))->setDefaultId('VariableValue'), 
601
            new Concatenation(369, ['VariableReassigment'], null), 
602
            new Alternation('Instruction', ['NamespaceDefinition', 'ImportDefinition', 'ConstantDefinition', 'VariableDefinition', 369], null)
603
        ], static::PARSER_ROOT_RULE, static::PARSER_DELEGATES);
604
    }
605
}
606