コード例 #1
0
ファイル: JJTDotParser.java プロジェクト: rssh/javachecker2
 public final void id() throws ParseException {
   /*@bgen(jjtree) id */
   SimpleNode jjtn000 = new SimpleNode(JJTID);
   boolean jjtc000 = true;
   jjtree.openNodeScope(jjtn000);
   Token tk = null;
   try {
     switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
       case IDENTIFIER:
         tk = jj_consume_token(IDENTIFIER);
         break;
       case STRING_LITERAL:
         tk = jj_consume_token(STRING_LITERAL);
         break;
       default:
         jj_la1[18] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
     }
     jjtree.closeNodeScope(jjtn000, true);
     jjtc000 = false;
     jjtn000.addTerm(createString(tk.image), 0);
   } finally {
     if (jjtc000) {
       jjtree.closeNodeScope(jjtn000, true);
     }
   }
 }
コード例 #2
0
ファイル: JJTDotParser.java プロジェクト: rssh/javachecker2
 public final void dotRecordElement() throws ParseException {
   /*@bgen(jjtree) dotRecordElement */
   SimpleNode jjtn000 = new SimpleNode(JJTDOTRECORDELEMENT);
   boolean jjtc000 = true;
   jjtree.openNodeScope(jjtn000);
   Token tk;
   try {
     switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
       case STRING_LITERAL:
         tk = jj_consume_token(STRING_LITERAL);
         jjtree.closeNodeScope(jjtn000, true);
         jjtc000 = false;
         jjtn000.addTerm(createString(tk.image), 0);
         break;
       case LBRACE:
         dotRecordV();
         break;
       default:
         jj_la1[25] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
     }
   } catch (Throwable jjte000) {
     if (jjtc000) {
       jjtree.clearNodeScope(jjtn000);
       jjtc000 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte000 instanceof RuntimeException) {
       {
         if (true) throw (RuntimeException) jjte000;
       }
     }
     if (jjte000 instanceof ParseException) {
       {
         if (true) throw (ParseException) jjte000;
       }
     }
     {
       if (true) throw (Error) jjte000;
     }
   } finally {
     if (jjtc000) {
       jjtree.closeNodeScope(jjtn000, true);
     }
   }
 }
コード例 #3
0
ファイル: JJTDotParser.java プロジェクト: rssh/javachecker2
 public final void port() throws ParseException {
   /*@bgen(jjtree) port */
   SimpleNode jjtn000 = new SimpleNode(JJTPORT);
   boolean jjtc000 = true;
   jjtree.openNodeScope(jjtn000);
   boolean l = false;
   boolean la = false;
   boolean a = false;
   boolean al = false;
   try {
     switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
       case 45:
         portLocation();
         l = true;
         la = true;
         switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
           case AT:
             portAngle();
             a = true;
             break;
           default:
             jj_la1[13] = jj_gen;
             ;
         }
         break;
       case AT:
         portAngle();
         a = true;
         al = true;
         switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
           case 45:
             portLocation();
             l = true;
             break;
           default:
             jj_la1[14] = jj_gen;
             ;
         }
         break;
       default:
         jj_la1[15] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
     }
     jjtree.closeNodeScope(jjtn000, true);
     jjtc000 = false;
     if (la) {
       if (!a) {
         jjtn000.addTerm(createNil(), 1);
       }
     } else if (al) {
       if (l) {
         Term tl = jjtn000.getSubtermAt(1);
         Term ta = jjtn000.getSubtermAt(0);
         jjtn000.setSubtermAt(0, tl);
         jjtn000.setSubtermAt(1, ta);
       } else {
         jjtn000.addTerm(createNil(), 0);
       }
     }
   } catch (Throwable jjte000) {
     if (jjtc000) {
       jjtree.clearNodeScope(jjtn000);
       jjtc000 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte000 instanceof RuntimeException) {
       {
         if (true) throw (RuntimeException) jjte000;
       }
     }
     if (jjte000 instanceof ParseException) {
       {
         if (true) throw (ParseException) jjte000;
       }
     }
     {
       if (true) throw (Error) jjte000;
     }
   } finally {
     if (jjtc000) {
       jjtree.closeNodeScope(jjtn000, true);
     }
   }
 }
コード例 #4
0
ファイル: JJTDotParser.java プロジェクト: rssh/javachecker2
 public final void dotAttributeAssignment() throws ParseException {
   /*@bgen(jjtree) dotAttributeAssignment */
   SimpleNode jjtn000 = new SimpleNode(JJTDOTATTRIBUTEASSIGNMENT);
   boolean jjtc000 = true;
   jjtree.openNodeScope(jjtn000);
   Token tkli = null;
   Token tklf = null;
   try {
     id();
     jj_consume_token(EQ);
     switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
       case STRING_LITERAL:
       case IDENTIFIER:
         id();
         break;
       case INTEGER_LITERAL:
         tkli = jj_consume_token(INTEGER_LITERAL);
         break;
       case FLOATING_POINT_LITERAL:
         tklf = jj_consume_token(FLOATING_POINT_LITERAL);
         break;
       case LBRACEBRACE:
         dotCompoundRecord();
         break;
       default:
         jj_la1[11] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
     }
     jjtree.closeNodeScope(jjtn000, true);
     jjtc000 = false;
     if (tkli != null) {
       jjtn000.addTerm(createIntegerOrLong(tkli.image), 1);
     } else if (tklf != null) {
       jjtn000.addTerm(createFloatOrDouble(tklf.image), 1);
     }
   } catch (Throwable jjte000) {
     if (jjtc000) {
       jjtree.clearNodeScope(jjtn000);
       jjtc000 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte000 instanceof RuntimeException) {
       {
         if (true) throw (RuntimeException) jjte000;
       }
     }
     if (jjte000 instanceof ParseException) {
       {
         if (true) throw (ParseException) jjte000;
       }
     }
     {
       if (true) throw (Error) jjte000;
     }
   } finally {
     if (jjtc000) {
       jjtree.closeNodeScope(jjtn000, true);
     }
   }
 }
コード例 #5
0
ファイル: JJTDotParser.java プロジェクト: rssh/javachecker2
 public final void dotAttrStmt() throws ParseException {
   /*@bgen(jjtree) dotAttrStmt */
   SimpleNode jjtn000 = new SimpleNode(JJTDOTATTRSTMT);
   boolean jjtc000 = true;
   jjtree.openNodeScope(jjtn000);
   Token tk1 = null;
   Token tk2 = null;
   Token tk3 = null;
   try {
     switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
       case GRAPH:
         tk1 = jj_consume_token(GRAPH);
         break;
       case NODE:
         tk2 = jj_consume_token(NODE);
         break;
       case EDGE:
         tk3 = jj_consume_token(EDGE);
         break;
       default:
         jj_la1[7] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
     }
     attrList();
     jjtree.closeNodeScope(jjtn000, true);
     jjtc000 = false;
     String kind = null;
     if (tk1 != null) {
       kind = "graph";
     } else if (tk2 != null) {
       kind = "node";
     } else if (tk3 != null) {
       kind = "edge";
     } else {
       {
         if (true) throw new RuntimeException("impossible");
       }
     }
     jjtn000.addTerm(createAtom(kind), 0);
   } catch (Throwable jjte000) {
     if (jjtc000) {
       jjtree.clearNodeScope(jjtn000);
       jjtc000 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte000 instanceof RuntimeException) {
       {
         if (true) throw (RuntimeException) jjte000;
       }
     }
     if (jjte000 instanceof ParseException) {
       {
         if (true) throw (ParseException) jjte000;
       }
     }
     {
       if (true) throw (Error) jjte000;
     }
   } finally {
     if (jjtc000) {
       jjtree.closeNodeScope(jjtn000, true);
     }
   }
 }
コード例 #6
0
ファイル: JJTDotParser.java プロジェクト: rssh/javachecker2
 /*
  * Program structuring syntax follows.
  */
 public final void dotGraph() throws ParseException {
   /*@bgen(jjtree) dotGraph */
   SimpleNode jjtn000 = new SimpleNode(JJTDOTGRAPH);
   boolean jjtc000 = true;
   jjtree.openNodeScope(jjtn000);
   Token tkStrict = null;
   Token tkDigraph = null;
   Token tkGraph = null;
   try {
     switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
       case STRICT:
         tkStrict = jj_consume_token(STRICT);
         break;
       default:
         jj_la1[0] = jj_gen;
         ;
     }
     switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
       case DIGRAPH:
         tkDigraph = jj_consume_token(DIGRAPH);
         break;
       case GRAPH:
         tkGraph = jj_consume_token(GRAPH);
         break;
       default:
         jj_la1[1] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
     }
     id();
     jj_consume_token(LBRACE);
     dotStmtList();
     jj_consume_token(RBRACE);
     jjtree.closeNodeScope(jjtn000, true);
     jjtc000 = false;
     if (tkStrict != null) {
       jjtn000.addTerm(createBoolean(true), 0);
     } else {
       jjtn000.addTerm(createBoolean(false), 0);
     }
     if (tkDigraph != null) {
       jjtn000.addTerm(createAtom("digraph"), 1);
     } else {
       jjtn000.addTerm(createAtom("graph"), 1);
     }
   } catch (Throwable jjte000) {
     if (jjtc000) {
       jjtree.clearNodeScope(jjtn000);
       jjtc000 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte000 instanceof RuntimeException) {
       {
         if (true) throw (RuntimeException) jjte000;
       }
     }
     if (jjte000 instanceof ParseException) {
       {
         if (true) throw (ParseException) jjte000;
       }
     }
     {
       if (true) throw (Error) jjte000;
     }
   } finally {
     if (jjtc000) {
       jjtree.closeNodeScope(jjtn000, true);
     }
   }
 }