| 26 | @Reviser public static class ArrayRefEx extends ArrayRef { |
| 27 | public ArrayRefEx(List<ASTree> c) { super(c); } |
| 28 | public Object eval(Environment env, Object value) { |
| 29 | if (value instanceof Object[]) { |
| 30 | Object index = ((ASTreeEx)index()).eval(env); |
| 31 | if (index instanceof Integer) |
| 32 | return ((Object[])value)[(Integer)index]; |
| 33 | } |
| 34 | |
| 35 | throw new StoneException("bad array access", this); |
| 36 | } |
| 37 | } |
| 38 | @Reviser public static class AssignEx extends BasicEvaluator.BinaryEx { |
| 39 | public AssignEx(List<ASTree> c) { super(c); } |