public class org.antlr.v4.automata.ATNOptimizer
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: org.antlr.v4.automata.ATNOptimizer
super_class: java.lang.Object
{
public static void optimize(org.antlr.v4.tool.Grammar, org.antlr.v4.runtime.atn.ATN);
descriptor: (Lorg/antlr/v4/tool/Grammar;Lorg/antlr/v4/runtime/atn/ATN;)V
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 0
aload 1
invokestatic org.antlr.v4.automata.ATNOptimizer.optimizeSets:(Lorg/antlr/v4/tool/Grammar;Lorg/antlr/v4/runtime/atn/ATN;)V
1: aload 1
invokestatic org.antlr.v4.automata.ATNOptimizer.optimizeStates:(Lorg/antlr/v4/runtime/atn/ATN;)V
2: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 g Lorg/antlr/v4/tool/Grammar;
0 3 1 atn Lorg/antlr/v4/runtime/atn/ATN;
MethodParameters:
Name Flags
g
atn
private static void optimizeSets(org.antlr.v4.tool.Grammar, org.antlr.v4.runtime.atn.ATN);
descriptor: (Lorg/antlr/v4/tool/Grammar;Lorg/antlr/v4/runtime/atn/ATN;)V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=8, locals=20, args_size=2
start local 0 start local 1 0: aload 0
invokevirtual org.antlr.v4.tool.Grammar.isParser:()Z
ifeq 2
1: return
2: StackMap locals:
StackMap stack:
aload 1
getfield org.antlr.v4.runtime.atn.ATN.decisionToState:Ljava/util/List;
astore 2
start local 2 3: aload 2
invokeinterface java.util.List.iterator:()Ljava/util/Iterator;
astore 4
goto 82
StackMap locals: org.antlr.v4.tool.Grammar org.antlr.v4.runtime.atn.ATN java.util.List top java.util.Iterator
StackMap stack:
4: aload 4
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast org.antlr.v4.runtime.atn.DecisionState
astore 3
start local 3 5: aload 3
getfield org.antlr.v4.runtime.atn.DecisionState.ruleIndex:I
iflt 9
6: aload 0
aload 3
getfield org.antlr.v4.runtime.atn.DecisionState.ruleIndex:I
invokevirtual org.antlr.v4.tool.Grammar.getRule:(I)Lorg/antlr/v4/tool/Rule;
astore 5
start local 5 7: aload 5
getfield org.antlr.v4.tool.Rule.name:Ljava/lang/String;
iconst_0
invokevirtual java.lang.String.charAt:(I)C
invokestatic java.lang.Character.isLowerCase:(C)Z
ifeq 9
8: goto 82
end local 5 9: StackMap locals: org.antlr.v4.tool.Grammar org.antlr.v4.runtime.atn.ATN java.util.List org.antlr.v4.runtime.atn.DecisionState java.util.Iterator
StackMap stack:
new org.antlr.v4.runtime.misc.IntervalSet
dup
iconst_0
newarray 10
invokespecial org.antlr.v4.runtime.misc.IntervalSet.<init>:([I)V
astore 5
start local 5 10: iconst_0
istore 6
start local 6 11: goto 27
12: StackMap locals: org.antlr.v4.runtime.misc.IntervalSet int
StackMap stack:
aload 3
iload 6
invokevirtual org.antlr.v4.runtime.atn.DecisionState.transition:(I)Lorg/antlr/v4/runtime/atn/Transition;
astore 7
start local 7 13: aload 7
instanceof org.antlr.v4.runtime.atn.EpsilonTransition
ifne 15
14: goto 26
15: StackMap locals: org.antlr.v4.runtime.atn.Transition
StackMap stack:
aload 7
getfield org.antlr.v4.runtime.atn.Transition.target:Lorg/antlr/v4/runtime/atn/ATNState;
invokevirtual org.antlr.v4.runtime.atn.ATNState.getNumberOfTransitions:()I
iconst_1
if_icmpeq 17
16: goto 26
17: StackMap locals:
StackMap stack:
aload 7
getfield org.antlr.v4.runtime.atn.Transition.target:Lorg/antlr/v4/runtime/atn/ATNState;
iconst_0
invokevirtual org.antlr.v4.runtime.atn.ATNState.transition:(I)Lorg/antlr/v4/runtime/atn/Transition;
astore 8
start local 8 18: aload 8
getfield org.antlr.v4.runtime.atn.Transition.target:Lorg/antlr/v4/runtime/atn/ATNState;
instanceof org.antlr.v4.runtime.atn.BlockEndState
ifne 20
19: goto 26
20: StackMap locals: org.antlr.v4.runtime.atn.Transition
StackMap stack:
aload 8
instanceof org.antlr.v4.runtime.atn.NotSetTransition
ifeq 22
21: goto 26
22: StackMap locals:
StackMap stack:
aload 8
instanceof org.antlr.v4.runtime.atn.AtomTransition
ifne 25
23: aload 8
instanceof org.antlr.v4.runtime.atn.RangeTransition
ifne 25
24: aload 8
instanceof org.antlr.v4.runtime.atn.SetTransition
ifeq 26
25: StackMap locals:
StackMap stack:
aload 5
iload 6
invokevirtual org.antlr.v4.runtime.misc.IntervalSet.add:(I)V
end local 8 end local 7 26: StackMap locals:
StackMap stack:
iinc 6 1
StackMap locals:
StackMap stack:
27: iload 6
aload 3
invokevirtual org.antlr.v4.runtime.atn.DecisionState.getNumberOfTransitions:()I
if_icmplt 12
end local 6 28: aload 5
invokevirtual org.antlr.v4.runtime.misc.IntervalSet.getIntervals:()Ljava/util/List;
invokeinterface java.util.List.size:()I
iconst_1
isub
istore 6
start local 6 29: goto 81
30: StackMap locals:
StackMap stack:
aload 5
invokevirtual org.antlr.v4.runtime.misc.IntervalSet.getIntervals:()Ljava/util/List;
iload 6
invokeinterface java.util.List.get:(I)Ljava/lang/Object;
checkcast org.antlr.v4.runtime.misc.Interval
astore 7
start local 7 31: aload 7
invokevirtual org.antlr.v4.runtime.misc.Interval.length:()I
iconst_1
if_icmpgt 33
32: goto 80
33: StackMap locals: org.antlr.v4.runtime.misc.Interval
StackMap stack:
aload 3
aload 7
getfield org.antlr.v4.runtime.misc.Interval.a:I
invokevirtual org.antlr.v4.runtime.atn.DecisionState.transition:(I)Lorg/antlr/v4/runtime/atn/Transition;
getfield org.antlr.v4.runtime.atn.Transition.target:Lorg/antlr/v4/runtime/atn/ATNState;
iconst_0
invokevirtual org.antlr.v4.runtime.atn.ATNState.transition:(I)Lorg/antlr/v4/runtime/atn/Transition;
getfield org.antlr.v4.runtime.atn.Transition.target:Lorg/antlr/v4/runtime/atn/ATNState;
astore 8
start local 8 34: new org.antlr.v4.runtime.misc.IntervalSet
dup
iconst_0
newarray 10
invokespecial org.antlr.v4.runtime.misc.IntervalSet.<init>:([I)V
astore 9
start local 9 35: aload 7
getfield org.antlr.v4.runtime.misc.Interval.a:I
istore 10
start local 10 36: goto 64
37: StackMap locals: org.antlr.v4.runtime.atn.ATNState org.antlr.v4.runtime.misc.IntervalSet int
StackMap stack:
aload 3
iload 10
invokevirtual org.antlr.v4.runtime.atn.DecisionState.transition:(I)Lorg/antlr/v4/runtime/atn/Transition;
getfield org.antlr.v4.runtime.atn.Transition.target:Lorg/antlr/v4/runtime/atn/ATNState;
iconst_0
invokevirtual org.antlr.v4.runtime.atn.ATNState.transition:(I)Lorg/antlr/v4/runtime/atn/Transition;
astore 11
start local 11 38: aload 11
instanceof org.antlr.v4.runtime.atn.NotSetTransition
ifeq 40
39: new java.lang.UnsupportedOperationException
dup
ldc "Not yet implemented."
invokespecial java.lang.UnsupportedOperationException.<init>:(Ljava/lang/String;)V
athrow
40: StackMap locals: org.antlr.v4.runtime.atn.Transition
StackMap stack:
aload 11
invokevirtual org.antlr.v4.runtime.atn.Transition.label:()Lorg/antlr/v4/runtime/misc/IntervalSet;
astore 12
start local 12 41: aload 12
invokevirtual org.antlr.v4.runtime.misc.IntervalSet.getIntervals:()Ljava/util/List;
astore 13
start local 13 42: aload 13
invokeinterface java.util.List.size:()I
istore 14
start local 14 43: iconst_0
istore 15
start local 15 44: goto 61
45: StackMap locals: org.antlr.v4.tool.Grammar org.antlr.v4.runtime.atn.ATN java.util.List org.antlr.v4.runtime.atn.DecisionState java.util.Iterator org.antlr.v4.runtime.misc.IntervalSet int org.antlr.v4.runtime.misc.Interval org.antlr.v4.runtime.atn.ATNState org.antlr.v4.runtime.misc.IntervalSet int org.antlr.v4.runtime.atn.Transition org.antlr.v4.runtime.misc.IntervalSet java.util.List int int
StackMap stack:
aload 13
iload 15
invokeinterface java.util.List.get:(I)Ljava/lang/Object;
checkcast org.antlr.v4.runtime.misc.Interval
astore 16
start local 16 46: aload 16
getfield org.antlr.v4.runtime.misc.Interval.a:I
istore 17
start local 17 47: aload 16
getfield org.antlr.v4.runtime.misc.Interval.b:I
istore 18
start local 18 48: iload 17
iconst_m1
if_icmpeq 60
iload 18
iconst_m1
if_icmpeq 60
49: iload 17
istore 19
start local 19 50: goto 59
51: StackMap locals: org.antlr.v4.tool.Grammar org.antlr.v4.runtime.atn.ATN java.util.List org.antlr.v4.runtime.atn.DecisionState java.util.Iterator org.antlr.v4.runtime.misc.IntervalSet int org.antlr.v4.runtime.misc.Interval org.antlr.v4.runtime.atn.ATNState org.antlr.v4.runtime.misc.IntervalSet int org.antlr.v4.runtime.atn.Transition org.antlr.v4.runtime.misc.IntervalSet java.util.List int int org.antlr.v4.runtime.misc.Interval int int int
StackMap stack:
aload 9
iload 19
invokevirtual org.antlr.v4.runtime.misc.IntervalSet.contains:(I)Z
ifeq 58
52: aload 0
getfield org.antlr.v4.tool.Grammar.tool:Lorg/antlr/v4/Tool;
getfield org.antlr.v4.Tool.errMgr:Lorg/antlr/v4/tool/ErrorManager;
getstatic org.antlr.v4.tool.ErrorType.CHARACTERS_COLLISION_IN_SET:Lorg/antlr/v4/tool/ErrorType;
aload 0
getfield org.antlr.v4.tool.Grammar.fileName:Ljava/lang/String;
53: aconst_null
iconst_2
anewarray java.lang.Object
dup
iconst_0
54: iload 19
invokestatic org.antlr.v4.misc.CharSupport.getANTLRCharLiteralForChar:(I)Ljava/lang/String;
aastore
dup
iconst_1
55: aload 9
invokestatic org.antlr.v4.misc.CharSupport.getIntervalSetEscapedString:(Lorg/antlr/v4/runtime/misc/IntervalSet;)Ljava/lang/String;
aastore
56: invokevirtual org.antlr.v4.tool.ErrorManager.grammarError:(Lorg/antlr/v4/tool/ErrorType;Ljava/lang/String;Lorg/antlr/runtime/Token;[Ljava/lang/Object;)V
57: goto 60
58: StackMap locals:
StackMap stack:
iinc 19 1
StackMap locals:
StackMap stack:
59: iload 19
iload 18
if_icmple 51
end local 19 end local 18 end local 17 end local 16 60: StackMap locals: org.antlr.v4.tool.Grammar org.antlr.v4.runtime.atn.ATN java.util.List org.antlr.v4.runtime.atn.DecisionState java.util.Iterator org.antlr.v4.runtime.misc.IntervalSet int org.antlr.v4.runtime.misc.Interval org.antlr.v4.runtime.atn.ATNState org.antlr.v4.runtime.misc.IntervalSet int org.antlr.v4.runtime.atn.Transition org.antlr.v4.runtime.misc.IntervalSet java.util.List int int
StackMap stack:
iinc 15 1
StackMap locals:
StackMap stack:
61: iload 15
iload 14
if_icmplt 45
end local 15 62: aload 9
aload 12
invokevirtual org.antlr.v4.runtime.misc.IntervalSet.addAll:(Lorg/antlr/v4/runtime/misc/IntSet;)Lorg/antlr/v4/runtime/misc/IntervalSet;
pop
end local 14 end local 13 end local 12 end local 11 63: iinc 10 1
StackMap locals: org.antlr.v4.tool.Grammar org.antlr.v4.runtime.atn.ATN java.util.List org.antlr.v4.runtime.atn.DecisionState java.util.Iterator org.antlr.v4.runtime.misc.IntervalSet int org.antlr.v4.runtime.misc.Interval org.antlr.v4.runtime.atn.ATNState org.antlr.v4.runtime.misc.IntervalSet int
StackMap stack:
64: iload 10
aload 7
getfield org.antlr.v4.runtime.misc.Interval.b:I
if_icmple 37
end local 10 65: aload 9
invokevirtual org.antlr.v4.runtime.misc.IntervalSet.getIntervals:()Ljava/util/List;
invokeinterface java.util.List.size:()I
iconst_1
if_icmpne 72
66: aload 9
invokevirtual org.antlr.v4.runtime.misc.IntervalSet.size:()I
iconst_1
if_icmpne 69
67: aload 8
aload 9
invokevirtual org.antlr.v4.runtime.misc.IntervalSet.getMinElement:()I
invokestatic org.antlr.v4.runtime.atn.CodePointTransitions.createWithCodePoint:(Lorg/antlr/v4/runtime/atn/ATNState;I)Lorg/antlr/v4/runtime/atn/Transition;
astore 10
start local 10 68: goto 73
end local 10 69: StackMap locals:
StackMap stack:
aload 9
invokevirtual org.antlr.v4.runtime.misc.IntervalSet.getIntervals:()Ljava/util/List;
iconst_0
invokeinterface java.util.List.get:(I)Ljava/lang/Object;
checkcast org.antlr.v4.runtime.misc.Interval
astore 11
start local 11 70: aload 8
aload 11
getfield org.antlr.v4.runtime.misc.Interval.a:I
aload 11
getfield org.antlr.v4.runtime.misc.Interval.b:I
invokestatic org.antlr.v4.runtime.atn.CodePointTransitions.createWithCodePointRange:(Lorg/antlr/v4/runtime/atn/ATNState;II)Lorg/antlr/v4/runtime/atn/Transition;
astore 10
end local 11 start local 10 71: goto 73
end local 10 72: StackMap locals:
StackMap stack:
new org.antlr.v4.runtime.atn.SetTransition
dup
aload 8
aload 9
invokespecial org.antlr.v4.runtime.atn.SetTransition.<init>:(Lorg/antlr/v4/runtime/atn/ATNState;Lorg/antlr/v4/runtime/misc/IntervalSet;)V
astore 10
start local 10 73: StackMap locals: org.antlr.v4.runtime.atn.Transition
StackMap stack:
aload 3
aload 7
getfield org.antlr.v4.runtime.misc.Interval.a:I
invokevirtual org.antlr.v4.runtime.atn.DecisionState.transition:(I)Lorg/antlr/v4/runtime/atn/Transition;
getfield org.antlr.v4.runtime.atn.Transition.target:Lorg/antlr/v4/runtime/atn/ATNState;
iconst_0
aload 10
invokevirtual org.antlr.v4.runtime.atn.ATNState.setTransition:(ILorg/antlr/v4/runtime/atn/Transition;)V
74: aload 7
getfield org.antlr.v4.runtime.misc.Interval.a:I
iconst_1
iadd
istore 11
start local 11 75: goto 79
76: StackMap locals: int
StackMap stack:
aload 3
aload 7
getfield org.antlr.v4.runtime.misc.Interval.a:I
iconst_1
iadd
invokevirtual org.antlr.v4.runtime.atn.DecisionState.removeTransition:(I)Lorg/antlr/v4/runtime/atn/Transition;
astore 12
start local 12 77: aload 1
aload 12
getfield org.antlr.v4.runtime.atn.Transition.target:Lorg/antlr/v4/runtime/atn/ATNState;
invokevirtual org.antlr.v4.runtime.atn.ATN.removeState:(Lorg/antlr/v4/runtime/atn/ATNState;)V
end local 12 78: iinc 11 1
StackMap locals:
StackMap stack:
79: iload 11
aload 7
getfield org.antlr.v4.runtime.misc.Interval.b:I
if_icmple 76
end local 11 end local 10 end local 9 end local 8 end local 7 80: StackMap locals: org.antlr.v4.tool.Grammar org.antlr.v4.runtime.atn.ATN java.util.List org.antlr.v4.runtime.atn.DecisionState java.util.Iterator org.antlr.v4.runtime.misc.IntervalSet int
StackMap stack:
iinc 6 -1
StackMap locals:
StackMap stack:
81: iload 6
ifge 30
end local 6 end local 5 end local 3 82: StackMap locals: org.antlr.v4.tool.Grammar org.antlr.v4.runtime.atn.ATN java.util.List top java.util.Iterator
StackMap stack:
aload 4
invokeinterface java.util.Iterator.hasNext:()Z
ifne 4
83: return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 84 0 g Lorg/antlr/v4/tool/Grammar;
0 84 1 atn Lorg/antlr/v4/runtime/atn/ATN;
3 84 2 decisions Ljava/util/List<Lorg/antlr/v4/runtime/atn/DecisionState;>;
5 82 3 decision Lorg/antlr/v4/runtime/atn/DecisionState;
7 9 5 rule Lorg/antlr/v4/tool/Rule;
10 82 5 setTransitions Lorg/antlr/v4/runtime/misc/IntervalSet;
11 28 6 i I
13 26 7 epsTransition Lorg/antlr/v4/runtime/atn/Transition;
18 26 8 transition Lorg/antlr/v4/runtime/atn/Transition;
29 82 6 i I
31 80 7 interval Lorg/antlr/v4/runtime/misc/Interval;
34 80 8 blockEndState Lorg/antlr/v4/runtime/atn/ATNState;
35 80 9 matchSet Lorg/antlr/v4/runtime/misc/IntervalSet;
36 65 10 j I
38 63 11 matchTransition Lorg/antlr/v4/runtime/atn/Transition;
41 63 12 set Lorg/antlr/v4/runtime/misc/IntervalSet;
42 63 13 intervals Ljava/util/List<Lorg/antlr/v4/runtime/misc/Interval;>;
43 63 14 n I
44 62 15 k I
46 60 16 setInterval Lorg/antlr/v4/runtime/misc/Interval;
47 60 17 a I
48 60 18 b I
50 60 19 v I
68 69 10 newTransition Lorg/antlr/v4/runtime/atn/Transition;
71 72 10 newTransition Lorg/antlr/v4/runtime/atn/Transition;
73 80 10 newTransition Lorg/antlr/v4/runtime/atn/Transition;
70 71 11 matchInterval Lorg/antlr/v4/runtime/misc/Interval;
75 80 11 j I
77 78 12 removed Lorg/antlr/v4/runtime/atn/Transition;
MethodParameters:
Name Flags
g
atn
private static void optimizeStates(org.antlr.v4.runtime.atn.ATN);
descriptor: (Lorg/antlr/v4/runtime/atn/ATN;)V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=5, args_size=1
start local 0 0: new java.util.ArrayList
dup
invokespecial java.util.ArrayList.<init>:()V
astore 1
start local 1 1: iconst_0
istore 2
start local 2 2: aload 0
getfield org.antlr.v4.runtime.atn.ATN.states:Ljava/util/List;
invokeinterface java.util.List.iterator:()Ljava/util/Iterator;
astore 4
goto 8
StackMap locals: org.antlr.v4.runtime.atn.ATN java.util.List int top java.util.Iterator
StackMap stack:
3: aload 4
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast org.antlr.v4.runtime.atn.ATNState
astore 3
start local 3 4: aload 3
ifnull 8
5: aload 1
aload 3
invokeinterface java.util.List.add:(Ljava/lang/Object;)Z
pop
6: aload 3
iload 2
putfield org.antlr.v4.runtime.atn.ATNState.stateNumber:I
7: iinc 2 1
end local 3 8: StackMap locals:
StackMap stack:
aload 4
invokeinterface java.util.Iterator.hasNext:()Z
ifne 3
9: aload 0
getfield org.antlr.v4.runtime.atn.ATN.states:Ljava/util/List;
invokeinterface java.util.List.clear:()V
10: aload 0
getfield org.antlr.v4.runtime.atn.ATN.states:Ljava/util/List;
aload 1
invokeinterface java.util.List.addAll:(Ljava/util/Collection;)Z
pop
11: return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 12 0 atn Lorg/antlr/v4/runtime/atn/ATN;
1 12 1 compressed Ljava/util/List<Lorg/antlr/v4/runtime/atn/ATNState;>;
2 12 2 i I
4 8 3 s Lorg/antlr/v4/runtime/atn/ATNState;
MethodParameters:
Name Flags
atn
private void <init>();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lorg/antlr/v4/automata/ATNOptimizer;
}
SourceFile: "ATNOptimizer.java"