Logo Search packages:      
Sourcecode: jflex version File versions

static short [][] java_cup::runtime::lr_parser::unpackFromStrings ( String[]  sa  )  [inline, static, protected]

Utility function: unpacks parse tables from strings

Definition at line 1220 of file lr_parser.java.

    {
      // Concatanate initialization strings.
      StringBuffer sb = new StringBuffer(sa[0]);
      for (int i=1; i<sa.length; i++)
      sb.append(sa[i]);
      int n=0; // location in initialization string
      int size1 = (((int)sb.charAt(n))<<16) | ((int)sb.charAt(n+1)); n+=2;
      short[][] result = new short[size1][];
      for (int i=0; i<size1; i++) {
        int size2 = (((int)sb.charAt(n))<<16) | ((int)sb.charAt(n+1)); n+=2;
        result[i] = new short[size2];
        for (int j=0; j<size2; j++)
          result[i][j] = (short) (sb.charAt(n++)-2);
      }
      return result;
    }


Generated by  Doxygen 1.6.0   Back to index