forked from jasder/antlr
move new classes into proper package locations
This commit is contained in:
parent
8d8f256a8c
commit
3a79aa15ba
|
@ -1,3 +1,5 @@
|
|||
package org.antlr.v4.runtime.atn;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class ArrayPredictionContext extends PredictionContext {
|
|
@ -1,3 +1,5 @@
|
|||
package org.antlr.v4.runtime.atn;
|
||||
|
||||
public class EmptyPredictionContext extends SingletonPredictionContext {
|
||||
public EmptyPredictionContext() {
|
||||
super(null,"$");
|
|
@ -1,3 +1,5 @@
|
|||
package org.antlr.v4.runtime.atn;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
|
@ -1,3 +1,5 @@
|
|||
package org.antlr.v4.runtime.atn;
|
||||
|
||||
public class SingletonPredictionContext extends PredictionContext {
|
||||
public final PredictionContext parent;
|
||||
public final String payload;
|
|
@ -1,4 +1,9 @@
|
|||
package org.antlr.v4.test;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.antlr.v4.runtime.atn.ArrayPredictionContext;
|
||||
import org.antlr.v4.runtime.atn.PredictionContext;
|
||||
import org.antlr.v4.runtime.atn.SingletonPredictionContext;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -225,11 +230,9 @@ public class TestGraphNodes extends TestCase {
|
|||
String expecting =
|
||||
"digraph G {\n" +
|
||||
"rankdir=LR;\n" +
|
||||
" s6 [label=\"[a, b, c]\"];\n" +
|
||||
" s8 [label=\"[a]\"];\n" +
|
||||
" s0 [label=\"$\"];\n" +
|
||||
" s6->s0;\n" +
|
||||
" s6->s0;\n" +
|
||||
" s6->s0;\n" +
|
||||
" s8->s0;\n" +
|
||||
"}\n";
|
||||
assertEquals(expecting, PredictionContext.toDotString(r));
|
||||
}
|
||||
|
@ -348,12 +351,14 @@ public class TestGraphNodes extends TestCase {
|
|||
String expecting =
|
||||
"digraph G {\n" +
|
||||
"rankdir=LR;\n" +
|
||||
" s12 [label=\"[a]\"];\n" +
|
||||
" s10 [label=\"[x, y]\"];\n" +
|
||||
" s14 [label=\"[a, c, d]\"];\n" +
|
||||
" s0 [label=\"$\"];\n" +
|
||||
" s12->s10;\n" +
|
||||
" s10->s0;\n" +
|
||||
" s10->s0;\n" +
|
||||
" s12 [label=\"[x, y]\"];\n" +
|
||||
" s14->s12;\n" +
|
||||
" s14->s0;\n" +
|
||||
" s14->s0;\n" +
|
||||
" s12->s0;\n" +
|
||||
" s12->s0;\n" +
|
||||
"}\n";
|
||||
assertEquals(expecting, PredictionContext.toDotString(r));
|
||||
}
|
Loading…
Reference in New Issue