File: parser.grammar

package info (click to toggle)
graphviz 1.7.16-2
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 11,124 kB
  • ctags: 12,650
  • sloc: ansic: 131,002; sh: 7,483; makefile: 1,954; tcl: 1,760; yacc: 1,758; perl: 253; awk: 150; lex: 96
file content (756 lines) | stat: -rw-r--r-- 10,487 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756

state 0
	$accept : _file $end 
	file : _    (4)

	$end  reduce 4
	error  shift 3
	T_graph  shift 4
	T_digraph  shift 6
	T_strict  shift 5
	.  error

	file  goto 1
	graph_type  goto 2

state 1
	$accept :  file_$end 

	$end  accept
	.  error


state 2
	file :  graph_type_T_symbol $$1 { stmt_list } 

	T_symbol  shift 7
	.  error


state 3
	file :  error_    (3)

	.  reduce 3


state 4
	graph_type :  T_graph_    (5)

	.  reduce 5


state 5
	graph_type :  T_strict_T_graph 
	graph_type :  T_strict_T_digraph 

	T_graph  shift 8
	T_digraph  shift 9
	.  error


state 6
	graph_type :  T_digraph_    (7)

	.  reduce 7


state 7
	file :  graph_type T_symbol_$$1 { stmt_list } 
	$$1 : _    (1)

	.  reduce 1

	$$1  goto 10

state 8
	graph_type :  T_strict T_graph_    (6)

	.  reduce 6


state 9
	graph_type :  T_strict T_digraph_    (8)

	.  reduce 8


state 10
	file :  graph_type T_symbol $$1_{ stmt_list } 

	{  shift 11
	.  error


state 11
	file :  graph_type T_symbol $$1 {_stmt_list } 
	stmt_list : _    (23)

	error  shift 16
	T_graph  shift 27
	T_node  shift 28
	T_edge  shift 29
	T_symbol  shift 30
	T_subgraph  shift 31
	{  shift 25
	}  reduce 23
	.  error

	node_name  goto 26
	node_id  goto 21
	subg_stmt  goto 20
	stmt_list  goto 12
	attr_class  goto 22
	attr_set  goto 23
	stmt_list1  goto 13
	stmt  goto 14
	stmt1  goto 15
	node_stmt  goto 17
	edge_stmt  goto 18
	attr_stmt  goto 19
	subg_hdr  goto 24

state 12
	file :  graph_type T_symbol $$1 { stmt_list_} 

	}  shift 32
	.  error


state 13
	stmt_list :  stmt_list1_    (22)
	stmt_list1 :  stmt_list1_stmt 

	error  shift 16
	T_graph  shift 27
	T_node  shift 28
	T_edge  shift 29
	T_symbol  shift 30
	T_subgraph  shift 31
	{  shift 25
	}  reduce 22
	.  error

	node_name  goto 26
	node_id  goto 21
	subg_stmt  goto 20
	attr_class  goto 22
	attr_set  goto 23
	stmt  goto 33
	stmt1  goto 15
	node_stmt  goto 17
	edge_stmt  goto 18
	attr_stmt  goto 19
	subg_hdr  goto 24

state 14
	stmt_list1 :  stmt_    (24)

	.  reduce 24


state 15
	stmt :  stmt1_    (26)
	stmt :  stmt1_; 

	;  shift 34
	.  reduce 26


state 16
	stmt :  error_    (28)

	.  reduce 28


state 17
	stmt1 :  node_stmt_    (29)

	.  reduce 29


state 18
	stmt1 :  edge_stmt_    (30)

	.  reduce 30


state 19
	stmt1 :  attr_stmt_    (31)

	.  reduce 31


state 20
	stmt1 :  subg_stmt_    (32)
	edge_stmt :  subg_stmt_$$51 edgeRHS $$52 opt_attr_list 
	$$51 : _    (51)

	T_edgeop  reduce 51
	.  reduce 32

	$$51  goto 35

state 21
	node_stmt :  node_id_$$46 opt_attr_list 
	edge_stmt :  node_id_$$48 edgeRHS $$49 opt_attr_list 
	$$46 : _    (46)
	$$48 : _    (48)

	T_edgeop  reduce 48
	.  reduce 46

	$$46  goto 36
	$$48  goto 37

state 22
	attr_stmt :  attr_class_attr_list 

	[  shift 39
	.  error

	attr_list  goto 38

state 23
	attr_stmt :  attr_set_    (34)

	.  reduce 34


state 24
	subg_stmt :  subg_hdr_{ stmt_list } 
	subg_stmt :  subg_hdr_    (63)

	{  shift 40
	.  reduce 63


state 25
	subg_stmt :  {_$$61 stmt_list } 
	$$61 : _    (61)

	.  reduce 61

	$$61  goto 41

state 26
	node_id :  node_name_node_port 
	node_port : _    (37)

	:  shift 45
	@  shift 46
	.  reduce 37

	node_port  goto 42
	port_location  goto 43
	port_angle  goto 44

state 27
	attr_class :  T_graph_    (9)

	.  reduce 9


state 28
	attr_class :  T_node_    (10)

	.  reduce 10


state 29
	attr_class :  T_edge_    (11)

	.  reduce 11


state 30
	attr_set :  T_symbol_$$20 = T_symbol 
	node_name :  T_symbol_    (36)
	$$20 : _    (20)

	=  reduce 20
	.  reduce 36

	$$20  goto 47

state 31
	subg_hdr :  T_subgraph_T_symbol 

	T_symbol  shift 48
	.  error


state 32
	file :  graph_type T_symbol $$1 { stmt_list }_    (2)

	.  reduce 2


state 33
	stmt_list1 :  stmt_list1 stmt_    (25)

	.  reduce 25


state 34
	stmt :  stmt1 ;_    (27)

	.  reduce 27


state 35
	edge_stmt :  subg_stmt $$51_edgeRHS $$52 opt_attr_list 

	T_edgeop  shift 50
	.  error

	edgeRHS  goto 49

state 36
	node_stmt :  node_id $$46_opt_attr_list 
	rec_attr_list : _    (18)

	.  reduce 18

	rec_attr_list  goto 52
	opt_attr_list  goto 51

state 37
	edge_stmt :  node_id $$48_edgeRHS $$49 opt_attr_list 

	T_edgeop  shift 50
	.  error

	edgeRHS  goto 53

state 38
	attr_stmt :  attr_class attr_list_    (33)

	.  reduce 33


state 39
	attr_list :  [_inside_attr_list ] 
	inside_attr_list : _    (13)

	T_symbol  shift 56
	.  reduce 13

	inside_attr_list  goto 54
	attr_set  goto 55

state 40
	subg_stmt :  subg_hdr {_stmt_list } 
	stmt_list : _    (23)

	error  shift 16
	T_graph  shift 27
	T_node  shift 28
	T_edge  shift 29
	T_symbol  shift 30
	T_subgraph  shift 31
	{  shift 25
	}  reduce 23
	.  error

	node_name  goto 26
	node_id  goto 21
	subg_stmt  goto 20
	stmt_list  goto 57
	attr_class  goto 22
	attr_set  goto 23
	stmt_list1  goto 13
	stmt  goto 14
	stmt1  goto 15
	node_stmt  goto 17
	edge_stmt  goto 18
	attr_stmt  goto 19
	subg_hdr  goto 24

state 41
	subg_stmt :  { $$61_stmt_list } 
	stmt_list : _    (23)

	error  shift 16
	T_graph  shift 27
	T_node  shift 28
	T_edge  shift 29
	T_symbol  shift 30
	T_subgraph  shift 31
	{  shift 25
	}  reduce 23
	.  error

	node_name  goto 26
	node_id  goto 21
	subg_stmt  goto 20
	stmt_list  goto 58
	attr_class  goto 22
	attr_set  goto 23
	stmt_list1  goto 13
	stmt  goto 14
	stmt1  goto 15
	node_stmt  goto 17
	edge_stmt  goto 18
	attr_stmt  goto 19
	subg_hdr  goto 24

state 42
	node_id :  node_name node_port_    (35)

	.  reduce 35


state 43
	node_port :  port_location_    (38)
	node_port :  port_location_port_angle 

	@  shift 46
	.  reduce 38

	port_angle  goto 59

state 44
	node_port :  port_angle_    (39)
	node_port :  port_angle_port_location 

	:  shift 45
	.  reduce 39

	port_location  goto 60

state 45
	port_location :  :_T_symbol 
	port_location :  :_( T_symbol $$43 , T_symbol ) 

	T_symbol  shift 61
	(  shift 62
	.  error


state 46
	port_angle :  @_T_symbol 

	T_symbol  shift 63
	.  error


state 47
	attr_set :  T_symbol $$20_= T_symbol 

	=  shift 64
	.  error


state 48
	subg_hdr :  T_subgraph T_symbol_    (64)

	.  reduce 64


state 49
	edge_stmt :  subg_stmt $$51 edgeRHS_$$52 opt_attr_list 
	$$52 : _    (52)

	.  reduce 52

	$$52  goto 65

state 50
	edgeRHS :  T_edgeop_node_id 
	edgeRHS :  T_edgeop_node_id $$55 edgeRHS 
	edgeRHS :  T_edgeop_subg_stmt 
	edgeRHS :  T_edgeop_subg_stmt $$58 edgeRHS 

	T_symbol  shift 68
	T_subgraph  shift 31
	{  shift 25
	.  error

	node_name  goto 26
	node_id  goto 66
	subg_stmt  goto 67
	subg_hdr  goto 24

state 51
	node_stmt :  node_id $$46 opt_attr_list_    (47)

	.  reduce 47


state 52
	rec_attr_list :  rec_attr_list_attr_list 
	opt_attr_list :  rec_attr_list_    (19)

	[  shift 39
	.  reduce 19

	attr_list  goto 69

state 53
	edge_stmt :  node_id $$48 edgeRHS_$$49 opt_attr_list 
	$$49 : _    (49)

	.  reduce 49

	$$49  goto 70

state 54
	attr_list :  [ inside_attr_list_] 

	]  shift 71
	.  error


state 55
	inside_attr_list :  attr_set_optcomma inside_attr_list 
	optcomma : _    (14)

	,  shift 73
	.  reduce 14

	optcomma  goto 72

state 56
	attr_set :  T_symbol_$$20 = T_symbol 
	$$20 : _    (20)

	.  reduce 20

	$$20  goto 47

state 57
	subg_stmt :  subg_hdr { stmt_list_} 

	}  shift 74
	.  error


state 58
	subg_stmt :  { $$61 stmt_list_} 

	}  shift 75
	.  error


state 59
	node_port :  port_location port_angle_    (41)

	.  reduce 41


state 60
	node_port :  port_angle port_location_    (40)

	.  reduce 40


state 61
	port_location :  : T_symbol_    (42)

	.  reduce 42


state 62
	port_location :  : (_T_symbol $$43 , T_symbol ) 

	T_symbol  shift 76
	.  error


state 63
	port_angle :  @ T_symbol_    (45)

	.  reduce 45


state 64
	attr_set :  T_symbol $$20 =_T_symbol 

	T_symbol  shift 77
	.  error


state 65
	edge_stmt :  subg_stmt $$51 edgeRHS $$52_opt_attr_list 
	rec_attr_list : _    (18)

	.  reduce 18

	rec_attr_list  goto 52
	opt_attr_list  goto 78

state 66
	edgeRHS :  T_edgeop node_id_    (54)
	edgeRHS :  T_edgeop node_id_$$55 edgeRHS 
	$$55 : _    (55)

	T_edgeop  reduce 55
	.  reduce 54

	$$55  goto 79

state 67
	edgeRHS :  T_edgeop subg_stmt_    (57)
	edgeRHS :  T_edgeop subg_stmt_$$58 edgeRHS 
	$$58 : _    (58)

	T_edgeop  reduce 58
	.  reduce 57

	$$58  goto 80

state 68
	node_name :  T_symbol_    (36)

	.  reduce 36


state 69
	rec_attr_list :  rec_attr_list attr_list_    (17)

	.  reduce 17


state 70
	edge_stmt :  node_id $$48 edgeRHS $$49_opt_attr_list 
	rec_attr_list : _    (18)

	.  reduce 18

	rec_attr_list  goto 52
	opt_attr_list  goto 81

state 71
	attr_list :  [ inside_attr_list ]_    (16)

	.  reduce 16


state 72
	inside_attr_list :  attr_set optcomma_inside_attr_list 
	inside_attr_list : _    (13)

	T_symbol  shift 56
	.  reduce 13

	inside_attr_list  goto 82
	attr_set  goto 55

state 73
	optcomma :  ,_    (15)

	.  reduce 15


state 74
	subg_stmt :  subg_hdr { stmt_list }_    (60)

	.  reduce 60


state 75
	subg_stmt :  { $$61 stmt_list }_    (62)

	.  reduce 62


state 76
	port_location :  : ( T_symbol_$$43 , T_symbol ) 
	$$43 : _    (43)

	.  reduce 43

	$$43  goto 83

state 77
	attr_set :  T_symbol $$20 = T_symbol_    (21)

	.  reduce 21


state 78
	edge_stmt :  subg_stmt $$51 edgeRHS $$52 opt_attr_list_    (53)

	.  reduce 53


state 79
	edgeRHS :  T_edgeop node_id $$55_edgeRHS 

	T_edgeop  shift 50
	.  error

	edgeRHS  goto 84

state 80
	edgeRHS :  T_edgeop subg_stmt $$58_edgeRHS 

	T_edgeop  shift 50
	.  error

	edgeRHS  goto 85

state 81
	edge_stmt :  node_id $$48 edgeRHS $$49 opt_attr_list_    (50)

	.  reduce 50


state 82
	inside_attr_list :  attr_set optcomma inside_attr_list_    (12)

	.  reduce 12


state 83
	port_location :  : ( T_symbol $$43_, T_symbol ) 

	,  shift 86
	.  error


state 84
	edgeRHS :  T_edgeop node_id $$55 edgeRHS_    (56)

	.  reduce 56


state 85
	edgeRHS :  T_edgeop subg_stmt $$58 edgeRHS_    (59)

	.  reduce 59


state 86
	port_location :  : ( T_symbol $$43 ,_T_symbol ) 

	T_symbol  shift 87
	.  error


state 87
	port_location :  : ( T_symbol $$43 , T_symbol_) 

	)  shift 88
	.  error


state 88
	port_location :  : ( T_symbol $$43 , T_symbol )_    (44)

	.  reduce 44


21/600 terminals, 35/2000 nonterminals
65/1200 grammar rules, 89/1500 states
0 shift/reduce, 0 reduce/reduce conflicts reported
35/2001 working sets used
memory: states,etc. 233/48000, parser 102/24000
32/2001 distinct lookahead sets
8 extra closures
68 shift entries, 11 exceptions
51 goto entries
39 entries saved by goto default
Optimizer space used: input 205/48000, output 225/24000
225 table entries, 132 zero
Maximum spread: 264, maximum offset: 263