Examples of PredictionContext


Examples of org.antlr.v4.runtime.atn.PredictionContext

      "}\n";
    assertEquals(expecting, toDOTString(r, rootIsWildcard()));
  }

  @Test public void test_a$_bx() {
    PredictionContext x2 = x();
    PredictionContext a = a();
    PredictionContext b = createSingleton(x2, 2);
    PredictionContext r = PredictionContext.merge(a, b, rootIsWildcard(), null);
    System.out.println(toDOTString(r, rootIsWildcard()));
    String expecting =
      "digraph G {\n" +
      "rankdir=LR;\n" +
      "  s0[shape=record, label=\"<p0>|<p1>\"];\n" +
View Full Code Here

Examples of org.antlr.v4.runtime.atn.PredictionContext

      "}\n";
    assertEquals(expecting, toDOTString(r, rootIsWildcard()));
  }

  @Test public void test_a$_bx_fullctx() {
    PredictionContext x2 = x();
    PredictionContext a = a();
    PredictionContext b = createSingleton(x2, 2);
    PredictionContext r = PredictionContext.merge(a, b, fullCtx(), null);
    System.out.println(toDOTString(r, fullCtx()));
    String expecting =
      "digraph G {\n" +
      "rankdir=LR;\n" +
      "  s0[shape=record, label=\"<p0>|<p1>\"];\n" +
View Full Code Here

Examples of org.antlr.v4.runtime.atn.PredictionContext

  }

  @Ignore("Known inefficiency but deferring resolving the issue for now")
  @Test public void test_aex_bfx() {
    // TJP: this is inefficient as it leaves the top x nodes unmerged.
    PredictionContext x1 = x();
    PredictionContext x2 = x();
    PredictionContext e = createSingleton(x1, 5);
    PredictionContext f = createSingleton(x2, 6);
    PredictionContext a = createSingleton(e, 1);
    PredictionContext b = createSingleton(f, 2);
    PredictionContext r = PredictionContext.merge(a, b, rootIsWildcard(), null);
    System.out.println(toDOTString(r, rootIsWildcard()));
    String expecting =
      "digraph G {\n" +
      "rankdir=LR;\n" +
      "  s0[shape=record, label=\"<p0>|<p1>\"];\n" +
View Full Code Here

Examples of org.antlr.v4.runtime.atn.PredictionContext

  // Array merges

  @Test public void test_A$_A$_fullctx() {
    ArrayPredictionContext A1 = array(PredictionContext.EMPTY);
    ArrayPredictionContext A2 = array(PredictionContext.EMPTY);
    PredictionContext r = PredictionContext.merge(A1, A2, fullCtx(), null);
    System.out.println(toDOTString(r, fullCtx()));
    String expecting =
      "digraph G {\n" +
      "rankdir=LR;\n" +
      "  s0[label=\"$\"];\n" +
View Full Code Here

Examples of org.antlr.v4.runtime.atn.PredictionContext

    SingletonPredictionContext a = a();
    SingletonPredictionContext b = b();
    SingletonPredictionContext c = c();
    ArrayPredictionContext A1 = array(a, b);
    ArrayPredictionContext A2 = array(c);
    PredictionContext r = PredictionContext.merge(A1, A2, rootIsWildcard(), null);
    System.out.println(toDOTString(r, rootIsWildcard()));
    String expecting =
      "digraph G {\n" +
      "rankdir=LR;\n" +
      "  s0[shape=record, label=\"<p0>|<p1>|<p2>\"];\n" +
View Full Code Here

Examples of org.antlr.v4.runtime.atn.PredictionContext

  @Test public void test_Aa_Aa() {
    SingletonPredictionContext a1 = a();
    SingletonPredictionContext a2 = a();
    ArrayPredictionContext A1 = array(a1);
    ArrayPredictionContext A2 = array(a2);
    PredictionContext r = PredictionContext.merge(A1, A2, rootIsWildcard(), null);
    System.out.println(toDOTString(r, rootIsWildcard()));
    String expecting =
      "digraph G {\n" +
      "rankdir=LR;\n" +
      "  s0[label=\"0\"];\n" +
View Full Code Here

Examples of org.antlr.v4.runtime.atn.PredictionContext

    SingletonPredictionContext a = a();
    SingletonPredictionContext b = b();
    SingletonPredictionContext c = c();
    ArrayPredictionContext A1 = array(a);
    ArrayPredictionContext A2 = array(b, c);
    PredictionContext r = PredictionContext.merge(A1, A2, rootIsWildcard(), null);
    System.out.println(toDOTString(r, rootIsWildcard()));
    String expecting =
      "digraph G {\n" +
      "rankdir=LR;\n" +
      "  s0[shape=record, label=\"<p0>|<p1>|<p2>\"];\n" +
View Full Code Here

Examples of org.antlr.v4.runtime.atn.PredictionContext

    SingletonPredictionContext a = a();
    SingletonPredictionContext b = b();
    SingletonPredictionContext c = c();
    ArrayPredictionContext A1 = array(a, c);
    ArrayPredictionContext A2 = array(b);
    PredictionContext r = PredictionContext.merge(A1, A2, rootIsWildcard(), null);
    System.out.println(toDOTString(r, rootIsWildcard()));
    String expecting =
      "digraph G {\n" +
      "rankdir=LR;\n" +
      "  s0[shape=record, label=\"<p0>|<p1>|<p2>\"];\n" +
View Full Code Here

Examples of org.antlr.v4.runtime.atn.PredictionContext

  }

  @Test public void test_Aab_Aa() { // a,b + a
    ArrayPredictionContext A1 = array(a(), b());
    ArrayPredictionContext A2 = array(a());
    PredictionContext r = PredictionContext.merge(A1, A2, rootIsWildcard(), null);
    System.out.println(toDOTString(r, rootIsWildcard()));
    String expecting =
      "digraph G {\n" +
      "rankdir=LR;\n" +
      "  s0[shape=record, label=\"<p0>|<p1>\"];\n" +
View Full Code Here

Examples of org.antlr.v4.runtime.atn.PredictionContext

  }

  @Test public void test_Aab_Ab() { // a,b + b
    ArrayPredictionContext A1 = array(a(), b());
    ArrayPredictionContext A2 = array(b());
    PredictionContext r = PredictionContext.merge(A1, A2, rootIsWildcard(), null);
    System.out.println(toDOTString(r, rootIsWildcard()));
    String expecting =
      "digraph G {\n" +
      "rankdir=LR;\n" +
      "  s0[shape=record, label=\"<p0>|<p1>\"];\n" +
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.