Beispiel #1
0
 public ParseException generateParseException() {
   jj_expentries.removeAllElements();
   boolean[] la1tokens = new boolean[16];
   for (int i = 0; i < 16; i++) {
     la1tokens[i] = false;
   }
   if (jj_kind >= 0) {
     la1tokens[jj_kind] = true;
     jj_kind = -1;
   }
   for (int i = 0; i < 4; i++) {
     if (jj_la1[i] == jj_gen) {
       for (int j = 0; j < 32; j++) {
         if ((jj_la1_0[i] & (1 << j)) != 0) {
           la1tokens[j] = true;
         }
       }
     }
   }
   for (int i = 0; i < 16; i++) {
     if (la1tokens[i]) {
       jj_expentry = new int[1];
       jj_expentry[0] = i;
       jj_expentries.addElement(jj_expentry);
     }
   }
   int[][] exptokseq = new int[jj_expentries.size()][];
   for (int i = 0; i < jj_expentries.size(); i++) {
     exptokseq[i] = (int[]) jj_expentries.elementAt(i);
   }
   return new ParseException(token, exptokseq, tokenImage);
 }
Beispiel #2
0
 public static int[] getLineMarkers(byte[] b) {
   java.util.Vector ls = new java.util.Vector(50000);
   ls.addElement(new Integer(0));
   for (int i = 0; i < b.length - 2; i++) {
     if (b[i] == '\n') {
       ls.addElement(new Integer(i + 1));
     }
   }
   int[] arr = new int[ls.size()];
   for (int i = 0; i < arr.length; i++) {
     arr[i] = ((Integer) ls.elementAt(i)).intValue();
   }
   ls.removeAllElements();
   ls = null;
   return arr;
 }