Exemple #1
0
  slice makeSliceType(Token begin, Token c1, Token c2, List sltypes) {
    boolean isTuple = false;
    if (c1 != null || c2 != null) {
      isTuple = true;
    }
    slice s = null;
    boolean extslice = false;

    if (isTuple) {
      List<slice> st;
      List<expr> etypes = new ArrayList<expr>();
      for (Object o : sltypes) {
        if (o instanceof Index) {
          Index i = (Index) o;
          etypes.add(i.getInternalValue());
        } else {
          extslice = true;
          break;
        }
      }
      if (!extslice) {
        expr t = new Tuple(begin, etypes, expr_contextType.Load);
        s = new Index(begin, t);
      }
    } else if (sltypes.size() == 1) {
      s = castSlice(sltypes.get(0));
    } else if (sltypes.size() != 0) {
      extslice = true;
    }
    if (extslice) {
      List<slice> st = castSlices(sltypes);
      s = new ExtSlice(begin, st);
    }
    return s;
  }
 public Object visitIndex(Index node) throws Exception {
   visit(node.getInternalValue());
   return null;
 }