switch (lval.getTag()) {
case JCTree.IDENT:
return builder.build(lval);
case JCTree.SELECT: {
final JCFieldAccess s = (JCFieldAccess)lval;
JCTree selected = TreeInfo.skipParens(s.selected);
Symbol lid = TreeInfo.symbol(s.selected);
if (lid != null && lid.kind == TYP) return builder.build(lval);
return abstractRval(s.selected, new TreeBuilder() {
public JCTree build(final JCTree selected) {
return builder.build(make.Select((JCExpression)selected, s.sym));
}
});
}
case JCTree.INDEXED: {
final JCArrayAccess i = (JCArrayAccess)lval;
return abstractRval(i.indexed, new TreeBuilder() {
public JCTree build(final JCTree indexed) {
return abstractRval(i.index, syms.intType, new TreeBuilder() {
public JCTree build(final JCTree index) {
JCTree newLval = make.Indexed((JCExpression)indexed,
(JCExpression)index);
newLval.setType(i.type);
return builder.build(newLval);
}
});
}
});