File: antlr-4.9.2.patch

package info (click to toggle)
sphinx-a4doc 1.6.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,088 kB
  • sloc: python: 9,560; makefile: 15
file content (792 lines) | stat: -rw-r--r-- 27,370 bytes parent folder | download | duplicates (2)
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
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
From: Colin Watson <cjwatson@debian.org>
Date: Wed, 6 Nov 2024 12:33:38 +0000
Subject: Regenerate lexer/parser with ANTLR 4.9.2

I couldn't find the procedure used to generate the previous files
documented anywhere, so I made this up which seems to produce a
reasonable `git diff`:

  antlr4 -Dlanguage=Python3 sphinx_a4doc/syntax/ANTLRv4Lexer.g4
  antlr4 -Dlanguage=Python3 -visitor sphinx_a4doc/syntax/ANTLRv4Parser.g4
  mv sphinx_a4doc/syntax/ANTLRv4Lexer.py sphinx_a4doc/syntax/ANTLRv4Parser.py sphinx_a4doc/syntax/ANTLRv4ParserListener.py sphinx_a4doc/syntax/ANTLRv4ParserVisitor.py sphinx_a4doc/syntax/gen/syntax/
  rm sphinx_a4doc/syntax/*.interp sphinx_a4doc/syntax/ANTLRv4Parser.tokens

I then edited `sphinx_a4doc/syntax/gen/syntax/ANTLRv4Lexer.py` manually
to remove `from .LexerAdaptor import LexerAdaptor` imports, which I
couldn't find a way to suppress.  (There's probably a better way to do
this.)

I chose version 4.9.2 partly because it's the version in Debian testing,
but also because 4.10 makes an incompatible changes to the format of ATN
serialization data, which seemed more invasive.  You may want to do that
at some point, but for now I thought it was best to get things working
on Python 3.13 in a more minimal way.

Fixes: #20

Forwarded: https://github.com/taminomara/sphinx-a4doc/pull/22
Bug: https://github.com/taminomara/sphinx-a4doc/issues/20
Bug-Debian: https://bugs.debian.org/1082311
Last-Update: 2024-11-06
---
 setup.cfg                                          |   2 +-
 sphinx_a4doc/syntax/gen/syntax/ANTLRv4Lexer.py     |  34 ++++--
 sphinx_a4doc/syntax/gen/syntax/ANTLRv4Parser.py    | 136 ++++++++++++++++++++-
 .../syntax/gen/syntax/ANTLRv4ParserListener.py     |   5 +
 .../syntax/gen/syntax/ANTLRv4ParserVisitor.py      |   3 +-
 5 files changed, 163 insertions(+), 17 deletions(-)

diff --git a/setup.cfg b/setup.cfg
index 9d3ca7b..2c9534d 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -27,7 +27,7 @@ zip_safe = False
 include_package_data = True
 install_requires =
     sphinx>=1.8.0
-    antlr4-python3-runtime==4.7.1
+    antlr4-python3-runtime==4.9.2
     PyYAML
     svglib
 setup_requires =
diff --git a/sphinx_a4doc/syntax/gen/syntax/ANTLRv4Lexer.py b/sphinx_a4doc/syntax/gen/syntax/ANTLRv4Lexer.py
index bd1be1e..7f120e4 100644
--- a/sphinx_a4doc/syntax/gen/syntax/ANTLRv4Lexer.py
+++ b/sphinx_a4doc/syntax/gen/syntax/ANTLRv4Lexer.py
@@ -1,7 +1,11 @@
+# Generated from sphinx_a4doc/syntax/ANTLRv4Lexer.g4 by ANTLR 4.9.2
 from antlr4 import *
 from io import StringIO
-from typing.io import TextIO
 import sys
+if sys.version_info[1] > 5:
+    from typing import TextIO
+else:
+    from typing.io import TextIO
 
 
 from sphinx_a4doc.syntax.lexer_adaptor import LexerAdaptor
@@ -619,24 +623,25 @@ class ANTLRv4Lexer(LexerAdaptor):
 
     def __init__(self, input=None, output:TextIO = sys.stdout):
         super().__init__(input, output)
-        self.checkVersion("4.7")
+        self.checkVersion("4.9.2")
         self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
         self._actions = None
         self._predicates = None
 
 
     def action(self, localctx:RuleContext, ruleIndex:int, actionIndex:int):
-    	if self._actions is None:
-    		actions = dict()
-    		actions[7] = self.BEGIN_ARGUMENT_action 
-    		actions[105] = self.END_ARGUMENT_action 
-    		actions[115] = self.END_ACTION_action 
-    		self._actions = actions
-    	action = self._actions.get(ruleIndex, None)
-    	if action is not None:
-    		action(localctx, actionIndex)
-    	else:
-    		raise Exception("No registered action for:" + str(ruleIndex))
+        if self._actions is None:
+            actions = dict()
+            actions[7] = self.BEGIN_ARGUMENT_action 
+            actions[105] = self.END_ARGUMENT_action 
+            actions[115] = self.END_ACTION_action 
+            self._actions = actions
+        action = self._actions.get(ruleIndex, None)
+        if action is not None:
+            action(localctx, actionIndex)
+        else:
+            raise Exception("No registered action for:" + str(ruleIndex))
+
 
     def BEGIN_ARGUMENT_action(self, localctx:RuleContext , actionIndex:int):
         if actionIndex == 0:
@@ -651,3 +656,6 @@ class ANTLRv4Lexer(LexerAdaptor):
     def END_ACTION_action(self, localctx:RuleContext , actionIndex:int):
         if actionIndex == 2:
              self.handleEndAction() 
+     
+
+
diff --git a/sphinx_a4doc/syntax/gen/syntax/ANTLRv4Parser.py b/sphinx_a4doc/syntax/gen/syntax/ANTLRv4Parser.py
index e2e456a..5ff738f 100644
--- a/sphinx_a4doc/syntax/gen/syntax/ANTLRv4Parser.py
+++ b/sphinx_a4doc/syntax/gen/syntax/ANTLRv4Parser.py
@@ -1,8 +1,13 @@
+# Generated from sphinx_a4doc/syntax/ANTLRv4Parser.g4 by ANTLR 4.9.2
 # encoding: utf-8
 from antlr4 import *
 from io import StringIO
-from typing.io import TextIO
 import sys
+if sys.version_info[1] > 5:
+	from typing import TextIO
+else:
+	from typing.io import TextIO
+
 
 def serializedATN():
     with StringIO() as buf:
@@ -498,13 +503,15 @@ class ANTLRv4Parser ( Parser ):
 
     def __init__(self, input:TokenStream, output:TextIO = sys.stdout):
         super().__init__(input, output)
-        self.checkVersion("4.7")
+        self.checkVersion("4.9.2")
         self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
         self._predicates = None
 
 
 
+
     class GrammarSpecContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -628,7 +635,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class GrammarTypeContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -699,7 +708,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class PrequelConstructContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -789,7 +800,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class OptionsSpecContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -865,7 +878,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class OptionContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -924,7 +939,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class OptionValueContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -1110,7 +1127,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class DelegateGrammarsContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -1188,7 +1207,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class DelegateGrammarContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -1235,7 +1256,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class TokensSpecContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -1299,7 +1322,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class ChannelsSpecContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -1362,7 +1387,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class IdListContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -1443,7 +1470,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class ActionContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -1517,7 +1546,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class ActionScopeNameContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -1587,7 +1618,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class ActionBlockContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -1654,7 +1687,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class ArgActionBlockContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -1721,7 +1756,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class ModeSpecContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -1795,7 +1832,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class RulesContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -1853,7 +1892,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class RuleSpecContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -1935,7 +1976,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class ParserRuleSpecContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -2100,7 +2143,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class ExceptionGroupContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -2170,7 +2215,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class ExceptionHandlerContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -2227,7 +2274,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class FinallyClauseContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -2278,7 +2327,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class RulePrequelContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -2341,7 +2392,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class RuleReturnsContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -2392,7 +2445,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class ThrowsSpecContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -2465,7 +2520,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class LocalsSpecContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -2516,7 +2573,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class RuleActionContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -2573,7 +2632,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class RuleModifiersContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -2633,7 +2694,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class RuleModifierContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -2693,7 +2756,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class RuleBlockContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -2739,7 +2804,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class RuleAltListContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -2811,7 +2878,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class LabeledAltContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -2875,7 +2944,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class LexerRuleSpecContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -2969,7 +3040,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class LexerRuleBlockContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -3015,7 +3088,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class LexerAltListContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -3087,7 +3162,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class LexerAltContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -3158,7 +3235,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class LexerElementsContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -3221,7 +3300,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class LexerElementContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -3433,7 +3514,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class LabeledLexerElementContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -3515,7 +3598,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class LexerBlockContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -3571,7 +3656,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class LexerCommandsContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -3644,7 +3731,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class LexerCommandContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -3719,7 +3808,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class LexerCommandNameContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -3781,7 +3872,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class LexerCommandExprContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -3843,7 +3936,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class AltListContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -3915,7 +4010,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class AlternativeContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -4002,7 +4099,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class ElementContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -4246,7 +4345,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class LabeledElementContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -4328,7 +4429,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class EbnfSuffixContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -4425,7 +4528,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class LexerAtomContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -4662,7 +4767,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class AtomContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -4833,7 +4940,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class NotSetContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -4941,7 +5050,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class BlockSetContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -5023,7 +5134,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class SetElementContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -5208,7 +5321,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class BlockContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -5305,7 +5420,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class RulerefContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -5376,7 +5493,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class CharacterRangeContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -5433,7 +5552,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class TerminalContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -5554,7 +5675,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class ElementOptionsContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -5632,7 +5755,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class ElementOptionContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -5716,7 +5841,9 @@ class ANTLRv4Parser ( Parser ):
             self.exitRule()
         return localctx
 
+
     class IdentifierContext(ParserRuleContext):
+        __slots__ = 'parser'
 
         def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
             super().__init__(parent, invokingState)
@@ -5813,3 +5940,8 @@ class ANTLRv4Parser ( Parser ):
         finally:
             self.exitRule()
         return localctx
+
+
+
+
+
diff --git a/sphinx_a4doc/syntax/gen/syntax/ANTLRv4ParserListener.py b/sphinx_a4doc/syntax/gen/syntax/ANTLRv4ParserListener.py
index 0671a1e..c702917 100644
--- a/sphinx_a4doc/syntax/gen/syntax/ANTLRv4ParserListener.py
+++ b/sphinx_a4doc/syntax/gen/syntax/ANTLRv4ParserListener.py
@@ -1,3 +1,4 @@
+# Generated from sphinx_a4doc/syntax/ANTLRv4Parser.g4 by ANTLR 4.9.2
 from antlr4 import *
 if __name__ is not None and "." in __name__:
     from .ANTLRv4Parser import ANTLRv4Parser
@@ -770,3 +771,7 @@ class ANTLRv4ParserListener(ParseTreeListener):
     # Exit a parse tree produced by ANTLRv4Parser#tokenRefIdentifier.
     def exitTokenRefIdentifier(self, ctx:ANTLRv4Parser.TokenRefIdentifierContext):
         pass
+
+
+
+del ANTLRv4Parser
\ No newline at end of file
diff --git a/sphinx_a4doc/syntax/gen/syntax/ANTLRv4ParserVisitor.py b/sphinx_a4doc/syntax/gen/syntax/ANTLRv4ParserVisitor.py
index fd25669..fd36763 100644
--- a/sphinx_a4doc/syntax/gen/syntax/ANTLRv4ParserVisitor.py
+++ b/sphinx_a4doc/syntax/gen/syntax/ANTLRv4ParserVisitor.py
@@ -1,3 +1,4 @@
+# Generated from sphinx_a4doc/syntax/ANTLRv4Parser.g4 by ANTLR 4.9.2
 from antlr4 import *
 if __name__ is not None and "." in __name__:
     from .ANTLRv4Parser import ANTLRv4Parser
@@ -434,4 +435,4 @@ class ANTLRv4ParserVisitor(ParseTreeVisitor):
 
 
 
-del ANTLRv4Parser
+del ANTLRv4Parser
\ No newline at end of file