Пример #1
0
 public final void literalArg() throws ParseException {
   /*@bgen(jjtree) literalArg */
   SelfCompilingNode jjtn000 =
       (SelfCompilingNode) n3phele.service.nShell.ShellNode.jjtCreate(JJTLITERALARG);
   boolean jjtc000 = true;
   jjtree.openNodeScope(jjtn000);
   Token t;
   try {
     switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
       case NON_SPACE_ARG:
         t = jj_consume_token(NON_SPACE_ARG);
         break;
       case LITERAL_STRING:
         t = jj_consume_token(LITERAL_STRING);
         break;
       case LITERALBLOCK:
         t = jj_consume_token(LITERALBLOCK);
         break;
       default:
         jj_la1[7] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
     }
     jjtree.closeNodeScope(jjtn000, true);
     jjtc000 = false;
     jjtn000.jjtSetValue(t.image);
   } finally {
     if (jjtc000) {
       jjtree.closeNodeScope(jjtn000, true);
     }
   }
 }
Пример #2
0
 public final void expression() throws ParseException {
   /*@bgen(jjtree) expression */
   SelfCompilingNode jjtn000 =
       (SelfCompilingNode) n3phele.service.nShell.ShellNode.jjtCreate(JJTEXPRESSION);
   boolean jjtc000 = true;
   jjtree.openNodeScope(jjtn000);
   Token t;
   try {
     switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
       case VARIABLE:
         t = jj_consume_token(VARIABLE);
         jjtree.pushNode(getExpressionNode(t.image, t.beginLine, t.beginColumn));
         break;
       case WRAPPEDEXPRESSION:
         t = jj_consume_token(WRAPPEDEXPRESSION);
         jjtree.pushNode(getExpressionNode(t.image, t.beginLine, t.beginColumn));
         break;
       case EXPRESSION:
         t = jj_consume_token(EXPRESSION);
         jjtree.pushNode(getExpressionNode(t.image, t.beginLine, t.beginColumn));
         break;
       default:
         jj_la1[12] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
     }
     jjtree.closeNodeScope(jjtn000, true);
     jjtc000 = false;
     if (t.specialToken != null) jjtn000.jjtSetValue(t.specialToken.image);
   } finally {
     if (jjtc000) {
       jjtree.closeNodeScope(jjtn000, true);
     }
   }
 }
Пример #3
0
 public final void fileElement() throws ParseException {
   /*@bgen(jjtree) fileElement */
   SelfCompilingNode jjtn000 =
       (SelfCompilingNode) n3phele.service.nShell.ShellNode.jjtCreate(JJTFILEELEMENT);
   boolean jjtc000 = true;
   jjtree.openNodeScope(jjtn000);
   Token f;
   Token m;
   try {
     f = jj_consume_token(FILESPEC);
     m = f;
     switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
       case COLON:
         jj_consume_token(COLON);
         m = jj_consume_token(FILESPEC);
         break;
       default:
         jj_la1[21] = jj_gen;
         ;
     }
     jjtree.closeNodeScope(jjtn000, true);
     jjtc000 = false;
     jjtn000.jjtSetValue(f.image + ":" + m.image);
   } finally {
     if (jjtc000) {
       jjtree.closeNodeScope(jjtn000, true);
     }
   }
 }
Пример #4
0
 public final void variableAssign() throws ParseException {
   /*@bgen(jjtree) variableAssign */
   SelfCompilingNode jjtn000 =
       (SelfCompilingNode) n3phele.service.nShell.ShellNode.jjtCreate(JJTVARIABLEASSIGN);
   boolean jjtc000 = true;
   jjtree.openNodeScope(jjtn000);
   Token t;
   try {
     t = jj_consume_token(VARIABLEASSIGN);
     switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
       case ON:
       case CREATEVM:
       case ONEXIT:
       case ASSIMILATEVM:
       case DESTROY:
       case LOG:
         simpleCommand();
         break;
       case VARIABLE:
       case EXPRESSION:
       case STRING_LITERAL:
       case NUMBER_CONSTANT:
       case WRAPPEDEXPRESSION:
         expressionOrConstant();
         break;
       default:
         jj_la1[11] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
     }
     jjtree.closeNodeScope(jjtn000, true);
     jjtc000 = false;
     jjtn000.jjtSetValue(t.image);
   } 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
 public final void option() throws ParseException {
   /*@bgen(jjtree) option */
   SelfCompilingNode jjtn000 =
       (SelfCompilingNode) n3phele.service.nShell.ShellNode.jjtCreate(JJTOPTION);
   boolean jjtc000 = true;
   jjtree.openNodeScope(jjtn000);
   Token t;
   try {
     switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
       case OPTION:
         t = jj_consume_token(OPTION);
         arg();
         break;
       case NO_ARG_OPTION:
         t = jj_consume_token(NO_ARG_OPTION);
         break;
       default:
         jj_la1[5] = jj_gen;
         jj_consume_token(-1);
         throw new ParseException();
     }
     jjtree.closeNodeScope(jjtn000, true);
     jjtc000 = false;
     jjtn000.jjtSetValue(t.image);
   } 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
 public final void variable() throws ParseException {
   /*@bgen(jjtree) variable */
   SelfCompilingNode jjtn000 =
       (SelfCompilingNode) n3phele.service.nShell.ShellNode.jjtCreate(JJTVARIABLE);
   boolean jjtc000 = true;
   jjtree.openNodeScope(jjtn000);
   Token t;
   try {
     t = jj_consume_token(VARIABLE);
     jjtree.closeNodeScope(jjtn000, true);
     jjtc000 = false;
     jjtn000.jjtSetValue(t.image);
   } finally {
     if (jjtc000) {
       jjtree.closeNodeScope(jjtn000, true);
     }
   }
 }
Пример #7
0
 public final void passThru(boolean lastWasExp) throws ParseException {
   /*@bgen(jjtree) passThru */
   SelfCompilingNode jjtn000 =
       (SelfCompilingNode) n3phele.service.nShell.ShellNode.jjtCreate(JJTPASSTHRU);
   boolean jjtc000 = true;
   jjtree.openNodeScope(jjtn000);
   Token t;
   String result = null;
   Token first = null;
   String prefix = "";
   try {
     label_7:
     while (true) {
       t = passThruFragment();
       if (first == null) {
         first = t;
         if (lastWasExp) {
           if (first.specialToken != null) {
             prefix = first.specialToken.image;
           }
         }
       }
       result =
           result == null
               ? prefix + t.image
               : result + (t.specialToken != null ? t.specialToken.image : "") + t.image;
       switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
         case STRING_LITERAL:
         case NUMBER_CONSTANT:
         case PASSTHRU:
         case PASSTHRUMORE:;
           break;
         default:
           jj_la1[16] = jj_gen;
           break label_7;
       }
     }
     jjtree.closeNodeScope(jjtn000, true);
     jjtc000 = false;
     jjtn000.jjtSetValue(result);
   } 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);
     }
   }
 }
Пример #8
0
 public List<ShellFragment> compile() throws ParseException {
   List<ShellFragment> result = new ArrayList<ShellFragment>();
   SelfCompilingNode s = script();
   s.compile(result);
   return result;
 }