Examples of CodeGenerator


Examples of org.javacc.parser.CodeGenerator

  /**
   * Test method for {@link org.javacc.parser.NfaState#
   *     DumpNonAsciiMoveMethods(java.io.PrintWriter)}.
   */
  public void testDumpNonAsciiMoveMethodsInitialised() throws Exception {
    CodeGenerator cg = new CodeGenerator();
    setupState();
    NfaState.DumpNonAsciiMoveMethods(cg);
    assertEquals("private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)\n" +
        "{\n" +
        "   switch(hiByte)\n" +
        "   {\n" +
        "      case 0:\n" +
        "         return ((jjbitVec2[i2] & l2) != 0L);\n" +
        "      default :\n" +
        "         if ((jjbitVec0[i1] & l1) != 0L)\n" +
        "            return true;\n" +
        "         return false;\n" +
        "   }\n" +
        "}\n" +
        "private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2)\n" +
        "{\n" +
        "   switch(hiByte)\n" +
        "   {\n" +
        "      case 0:\n" +
        "         return ((jjbitVec4[i2] & l2) != 0L);\n" +
        "      case 2:\n" +
        "         return ((jjbitVec5[i2] & l2) != 0L);\n" +
        "      case 3:\n" +
        "         return ((jjbitVec6[i2] & l2) != 0L);\n" +
        "      case 4:\n" +
        "         return ((jjbitVec7[i2] & l2) != 0L);\n" +
        "      case 5:\n" +
        "         return ((jjbitVec8[i2] & l2) != 0L);\n" +
        "      case 6:\n" +
        "         return ((jjbitVec9[i2] & l2) != 0L);\n" +
        "      case 7:\n" +
        "         return ((jjbitVec10[i2] & l2) != 0L);\n" +
        "      case 9:\n" +
        "         return ((jjbitVec11[i2] & l2) != 0L);\n" +
        "      case 10:\n" +
        "         return ((jjbitVec12[i2] & l2) != 0L);\n" +
        "      case 11:\n" +
        "         return ((jjbitVec13[i2] & l2) != 0L);\n" +
        "      case 12:\n" +
        "         return ((jjbitVec14[i2] & l2) != 0L);\n" +
        "      case 13:\n" +
        "         return ((jjbitVec15[i2] & l2) != 0L);\n" +
        "      case 14:\n" +
        "         return ((jjbitVec16[i2] & l2) != 0L);\n" +
        "      case 15:\n" +
        "         return ((jjbitVec17[i2] & l2) != 0L);\n" +
        "      case 16:\n" +
        "         return ((jjbitVec18[i2] & l2) != 0L);\n" +
        "      case 17:\n" +
        "         return ((jjbitVec19[i2] & l2) != 0L);\n" +
        "      case 18:\n" +
        "         return ((jjbitVec20[i2] & l2) != 0L);\n" +
        "      case 19:\n" +
        "         return ((jjbitVec21[i2] & l2) != 0L);\n" +
        "      case 20:\n" +
        "         return ((jjbitVec0[i2] & l2) != 0L);\n" +
        "      case 22:\n" +
        "         return ((jjbitVec22[i2] & l2) != 0L);\n" +
        "      case 23:\n" +
        "         return ((jjbitVec23[i2] & l2) != 0L);\n" +
        "      case 24:\n" +
        "         return ((jjbitVec24[i2] & l2) != 0L);\n" +
        "      case 30:\n" +
        "         return ((jjbitVec25[i2] & l2) != 0L);\n" +
        "      case 31:\n" +
        "         return ((jjbitVec26[i2] & l2) != 0L);\n" +
        "      case 32:\n" +
        "         return ((jjbitVec27[i2] & l2) != 0L);\n" +
        "      case 33:\n" +
        "         return ((jjbitVec28[i2] & l2) != 0L);\n" +
        "      case 48:\n" +
        "         return ((jjbitVec29[i2] & l2) != 0L);\n" +
        "      case 49:\n" +
        "         return ((jjbitVec30[i2] & l2) != 0L);\n" +
        "      case 77:\n" +
        "         return ((jjbitVec31[i2] & l2) != 0L);\n" +
        "      case 159:\n" +
        "         return ((jjbitVec32[i2] & l2) != 0L);\n" +
        "      case 164:\n" +
        "         return ((jjbitVec33[i2] & l2) != 0L);\n" +
        "      case 215:\n" +
        "         return ((jjbitVec34[i2] & l2) != 0L);\n" +
        "      case 250:\n" +
        "         return ((jjbitVec35[i2] & l2) != 0L);\n" +
        "      case 251:\n" +
        "         return ((jjbitVec36[i2] & l2) != 0L);\n" +
        "      case 253:\n" +
        "         return ((jjbitVec37[i2] & l2) != 0L);\n" +
        "      case 254:\n" +
        "         return ((jjbitVec38[i2] & l2) != 0L);\n" +
        "      case 255:\n" +
        "         return ((jjbitVec39[i2] & l2) != 0L);\n" +
        "      default :\n" +
        "         if ((jjbitVec3[i1] & l1) != 0L)\n" +
        "            return true;\n" +
        "         return false;\n" +
        "   }\n" +
        "}\n" +
        "private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, long l2)\n" +
        "{\n" +
        "   switch(hiByte)\n" +
        "   {\n" +
        "      case 0:\n" +
        "         return ((jjbitVec40[i2] & l2) != 0L);\n" +
        "      case 2:\n" +
        "         return ((jjbitVec5[i2] & l2) != 0L);\n" +
        "      case 3:\n" +
        "         return ((jjbitVec41[i2] & l2) != 0L);\n" +
        "      case 4:\n" +
        "         return ((jjbitVec42[i2] & l2) != 0L);\n" +
        "      case 5:\n" +
        "         return ((jjbitVec43[i2] & l2) != 0L);\n" +
        "      case 6:\n" +
        "         return ((jjbitVec44[i2] & l2) != 0L);\n" +
        "      case 7:\n" +
        "         return ((jjbitVec45[i2] & l2) != 0L);\n" +
        "      case 9:\n" +
        "         return ((jjbitVec46[i2] & l2) != 0L);\n" +
        "      case 10:\n" +
        "         return ((jjbitVec47[i2] & l2) != 0L);\n" +
        "      case 11:\n" +
        "         return ((jjbitVec48[i2] & l2) != 0L);\n" +
        "      case 12:\n" +
        "         return ((jjbitVec49[i2] & l2) != 0L);\n" +
        "      case 13:\n" +
        "         return ((jjbitVec50[i2] & l2) != 0L);\n" +
        "      case 14:\n" +
        "         return ((jjbitVec51[i2] & l2) != 0L);\n" +
        "      case 15:\n" +
        "         return ((jjbitVec52[i2] & l2) != 0L);\n" +
        "      case 16:\n" +
        "         return ((jjbitVec53[i2] & l2) != 0L);\n" +
        "      case 17:\n" +
        "         return ((jjbitVec19[i2] & l2) != 0L);\n" +
        "      case 18:\n" +
        "         return ((jjbitVec20[i2] & l2) != 0L);\n" +
        "      case 19:\n" +
        "         return ((jjbitVec54[i2] & l2) != 0L);\n" +
        "      case 20:\n" +
        "         return ((jjbitVec0[i2] & l2) != 0L);\n" +
        "      case 22:\n" +
        "         return ((jjbitVec22[i2] & l2) != 0L);\n" +
        "      case 23:\n" +
        "         return ((jjbitVec55[i2] & l2) != 0L);\n" +
        "      case 24:\n" +
        "         return ((jjbitVec56[i2] & l2) != 0L);\n" +
        "      case 30:\n" +
        "         return ((jjbitVec25[i2] & l2) != 0L);\n" +
        "      case 31:\n" +
        "         return ((jjbitVec26[i2] & l2) != 0L);\n" +
        "      case 32:\n" +
        "         return ((jjbitVec57[i2] & l2) != 0L);\n" +
        "      case 33:\n" +
        "         return ((jjbitVec28[i2] & l2) != 0L);\n" +
        "      case 48:\n" +
        "         return ((jjbitVec58[i2] & l2) != 0L);\n" +
        "      case 49:\n" +
        "         return ((jjbitVec30[i2] & l2) != 0L);\n" +
        "      case 77:\n" +
        "         return ((jjbitVec31[i2] & l2) != 0L);\n" +
        "      case 159:\n" +
        "         return ((jjbitVec32[i2] & l2) != 0L);\n" +
        "      case 164:\n" +
        "         return ((jjbitVec33[i2] & l2) != 0L);\n" +
        "      case 215:\n" +
        "         return ((jjbitVec34[i2] & l2) != 0L);\n" +
        "      case 250:\n" +
        "         return ((jjbitVec35[i2] & l2) != 0L);\n" +
        "      case 251:\n" +
        "         return ((jjbitVec59[i2] & l2) != 0L);\n" +
        "      case 253:\n" +
        "         return ((jjbitVec37[i2] & l2) != 0L);\n" +
        "      case 254:\n" +
        "         return ((jjbitVec60[i2] & l2) != 0L);\n" +
        "      case 255:\n" +
        "         return ((jjbitVec61[i2] & l2) != 0L);\n" +
        "      default :\n" +
        "         if ((jjbitVec3[i1] & l1) != 0L)\n" +
        "            return true;\n" +
        "         return false;\n" +
        "   }\n" +
        "}\n", cg.getGeneratedCode().replaceAll("\r", ""));
  }
View Full Code Here

Examples of org.javacc.parser.CodeGenerator

  /**
   * Test method for {@link org.javacc.parser.NfaState#DumpMoveNfa(java.io.PrintWriter)}.
   */
  public void testDumpMoveNfa() {
    CodeGenerator cg = new CodeGenerator();
    try {
      NfaState.DumpMoveNfa(cg);
      fail("Should have bombed");
    } catch (ArrayIndexOutOfBoundsException e) {
      e = null;
    }
    assertEquals("", cg.getGeneratedCode());
    /*
     assertEquals("static private final void jjCheckNAdd(int state)\n" +
        "{\n" +
        "   if (jjrounds[state] != jjround)\n" +
        "   {\n" +
View Full Code Here

Examples of org.javacc.parser.CodeGenerator

  /**
   * Test method for {@link org.javacc.parser.NfaState#DumpMoveNfa(java.io.PrintWriter)}.
   */
  public void testDumpMoveNfaInitialised() throws Exception {
    CodeGenerator cg = new CodeGenerator();
    setupState();
    NfaState.DumpMoveNfa(cg);
    assertEquals("private int jjMoveNfa_3(int startState, int curPos)\n" +
        "{\n" +
        "   return curPos;\n" +
        "}\n", cg.getGeneratedCode().replaceAll("\r", ""));
  }
View Full Code Here

Examples of org.javacc.parser.CodeGenerator

  /**
   * Test method for {@link org.javacc.parser.NfaState#
   *     DumpStatesForState(java.io.PrintWriter)}.
   */
  public void testDumpStatesForState() throws Exception {
    CodeGenerator cg = new CodeGenerator();
    NfaState.DumpStatesForStateJavaOrCS(cg);
    assertEquals("protected static final int[][][] statesForState = null;\n" ,
            cg.getGeneratedCode().replaceAll("\r", ""));
  }
View Full Code Here

Examples of org.javacc.parser.CodeGenerator

  /**
   * Test method for {@link org.javacc.parser.NfaState#
   *     DumpStatesForState(java.io.PrintWriter)}.
   */
  public void testDumpStatesForStateInitialised() throws Exception {
    CodeGenerator cg = new CodeGenerator();
    setupState();
    NfaState.DumpStatesForStateJavaOrCS(cg);
    assertEquals("protected static final int[][][] statesForState = {\n" +
        " {\n" +
        "   { 0 },\n" +
        "   { 1 },\n" +
        "   { 2 },\n" +
        "   { 3, 4, 7, 13, 22, 31, 33, 48, },\n" +
        "   { 3, 4, 7, 13, 22, 31, 33, 48, },\n" +
        "   { 5 },\n" +
        "   { 6 },\n" +
        "   { 3, 4, 7, 13, 22, 31, 33, 48, },\n" +
        "   { 8 },\n" +
        "   { 9 },\n" +
        "   { 10 },\n" +
        "   { 11 },\n" +
        "   { 12 },\n" +
        "   { 3, 4, 7, 13, 22, 31, 33, 48, },\n" +
        "   { 14 },\n" +
        "   { 15 },\n" +
        "   { 16 },\n" +
        "   { 17 },\n" +
        "   { 18 },\n" +
        "   { 19 },\n" +
        "   { 20 },\n" +
        "   { 21 },\n" +
        "   { 3, 4, 7, 13, 22, 31, 33, 48, },\n" +
        "   { 23 },\n" +
        "   { 24 },\n" +
        "   { 25 },\n" +
        "   { 26 },\n" +
        "   { 27 },\n" +
        "   { 28 },\n" +
        "   { 29 },\n" +
        "   { 30 },\n" +
        "   { 3, 4, 7, 13, 22, 31, 33, 48, },\n" +
        "   { 32 },\n" +
        "   { 3, 4, 7, 13, 22, 31, 33, 48, },\n" +
        "   { 34 },\n" +
        "   { 35 },\n" +
        "   { 36 },\n" +
        "   { 37 },\n" +
        "   { 38 },\n" +
        "   { 39 },\n" +
        "   { 40 },\n" +
        "   { 41 },\n" +
        "   { 42 },\n" +
        "   { 43 },\n" +
        "   { 44 },\n" +
        "   { 45 },\n" +
        "   { 46 },\n" +
        "   { 47 },\n" +
        "   { 3, 4, 7, 13, 22, 31, 33, 48, },\n" +
        "   { 49 },\n" +
        "   { 50 },\n" +
        "   { 51 },\n" +
        "   { 52 },\n" +
        "   { 53 },\n" +
        "   { 54 },\n" +
        "   { 55 },\n" +
        "   { 56 },\n" +
        "   { 57 },\n" +
        "   { 58 },\n" +
        "   { 59 },\n" +
        "   { 60 },\n" +
        "   { 61 },\n" +
        "   { 62 },\n" +
        "   { 63 },\n" +
        "   { 64 },\n" +
        " },\n" +
        " null,\n" +
        " {\n" +
        "   { 0, 2, },\n" +
        "   { 1 },\n" +
        "   { 0, 2, },\n" +
        " },\n" +
        " null,\n" +
        " null,\n" +
        "\n" +
        "};\n",
        cg.getGeneratedCode().replaceAll("\r", ""));
  }
View Full Code Here

Examples of org.javacc.parser.CodeGenerator

  /**
   * Test method for {@link org.javacc.parser.NfaState#DumpStatesForKind(java.io.PrintWriter)}.
   */
  public void testDumpStatesForKind() {
    CodeGenerator cg = new CodeGenerator();
    NfaState.DumpStatesForKind(cg);
    assertEquals("protected static final int[][][] statesForState = null;\n" +
                 "protected static final int[][] kindForState = null;\n" ,
            cg.getGeneratedCode().replaceAll("\r", ""));
  }
View Full Code Here

Examples of org.javacc.parser.CodeGenerator

  /**
   * Test method for {@link org.javacc.parser.NfaState#DumpStatesForKind(java.io.PrintWriter)}.
   */
  public void testDumpStatesForKindInitialised() throws Exception {
    CodeGenerator cg = new CodeGenerator();
    setupState();
    NfaState.DumpStatesForKind(cg);
    assertEquals("protected static final int[][][] statesForState = {\n" +
        " {\n" +
        "   { 0 },\n" +
        "   { 1 },\n" +
        "   { 2 },\n" +
        "   { 3, 4, 7, 13, 22, 31, 33, 48, },\n" +
        "   { 3, 4, 7, 13, 22, 31, 33, 48, },\n" +
        "   { 5 },\n" +
        "   { 6 },\n" +
        "   { 3, 4, 7, 13, 22, 31, 33, 48, },\n" +
        "   { 8 },\n" +
        "   { 9 },\n" +
        "   { 10 },\n" +
        "   { 11 },\n" +
        "   { 12 },\n" +
        "   { 3, 4, 7, 13, 22, 31, 33, 48, },\n" +
        "   { 14 },\n" +
        "   { 15 },\n" +
        "   { 16 },\n" +
        "   { 17 },\n" +
        "   { 18 },\n" +
        "   { 19 },\n" +
        "   { 20 },\n" +
        "   { 21 },\n" +
        "   { 3, 4, 7, 13, 22, 31, 33, 48, },\n" +
        "   { 23 },\n" +
        "   { 24 },\n" +
        "   { 25 },\n" +
        "   { 26 },\n" +
        "   { 27 },\n" +
        "   { 28 },\n" +
        "   { 29 },\n" +
        "   { 30 },\n" +
        "   { 3, 4, 7, 13, 22, 31, 33, 48, },\n" +
        "   { 32 },\n" +
        "   { 3, 4, 7, 13, 22, 31, 33, 48, },\n" +
        "   { 34 },\n" +
        "   { 35 },\n" +
        "   { 36 },\n" +
        "   { 37 },\n" +
        "   { 38 },\n" +
        "   { 39 },\n" +
        "   { 40 },\n" +
        "   { 41 },\n" +
        "   { 42 },\n" +
        "   { 43 },\n" +
        "   { 44 },\n" +
        "   { 45 },\n" +
        "   { 46 },\n" +
        "   { 47 },\n" +
        "   { 3, 4, 7, 13, 22, 31, 33, 48, },\n" +
        "   { 49 },\n" +
        "   { 50 },\n" +
        "   { 51 },\n" +
        "   { 52 },\n" +
        "   { 53 },\n" +
        "   { 54 },\n" +
        "   { 55 },\n" +
        "   { 56 },\n" +
        "   { 57 },\n" +
        "   { 58 },\n" +
        "   { 59 },\n" +
        "   { 60 },\n" +
        "   { 61 },\n" +
        "   { 62 },\n" +
        "   { 63 },\n" +
        "   { 64 },\n" +
        " },\n" +
        " null,\n" +
        " {\n" +
        "   { 0, 2, },\n" +
        "   { 1 },\n" +
        "   { 0, 2, },\n" +
        " },\n" +
        " null,\n" +
        " null,\n" +
        "\n" +
        "};\n" +
        "protected static final int[][] kindForState = {\n" +
        "{ 20, 20, 20, 20, 80, 80, 80, 84, 84, 84, 84, 84, 84, 89,\n" +
        "  89, 89, 89, 89, 89, 89, 89, 89, 90, 90, 90, 90, 90, 90, 90,\n" +
        "  90, 90, 140, 140, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,\n" +
        "  84, 84, 84, 84, 84, 80, 80, 80, 84, 84, 84, 84, 84, 84, 84,\n" +
        "  84, 84, 84, 84, 84, 84},\n" +
        "null\n" +
        ",\n" +
        "{ 23, 23, 23},\n" +
        "null\n,\n" +
        "null\n\n" +
        "};\n",
            cg.getGeneratedCode().replaceAll("\r", ""));
  }
View Full Code Here

Examples of org.openquark.cal.machine.CodeGenerator

            // Now we want to generate code for the program.
            boolean bfor = forImmediateUse;
            forImmediateUse = true;

            CodeGenerator cg = makeCodeGenerator();

            forImmediateUse = bfor;

            Module module = program.getModule(adjunctModule);
            cg.generateSCCode(module, compilerLogger);

            cg.finishedGeneratingCode(compilerLogger);
       
        } catch (CompilerMessage.AbortCompilation e) {
            // Aborted compilation.
       
        } finally {
View Full Code Here

Examples of ptolemy.codegen.kernel.CodeGenerator

    public static long copyFilesToCodeDirectory(
            ptolemy.actor.TypedCompositeActor compositeActor)
            throws IOException, IllegalActionException {
        // This is static so that ptolemy.actor.lib.jni.CompiledCompositeActor
        // will not depend on ptolemy.codegen.
        CodeGenerator codeGenerator = _getCodeGenerator(compositeActor);
        return CodeGeneratorHelper.copyFilesToCodeDirectory(compositeActor,
                codeGenerator);
    }
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.