public static ASTNode create(boolean isSuper, ASTNode lhs, ASTNode rhs) { if (lhs instanceof SimpleAccessVariable) { return writeVariable(isSuper, ((SimpleAccessVariable) lhs).symbol, rhs); } else if (lhs instanceof AccessVector) { return writeVector(isSuper, (AccessVector) lhs, rhs); } else if (lhs instanceof FieldAccess) { return writeField(isSuper, (FieldAccess) lhs, rhs); } else if (lhs instanceof FunctionCall) { return writeFunction(isSuper, (FunctionCall) lhs, rhs); } else if (lhs instanceof Constant) { // TODO: move this to the parser? RAny value = ((Constant) lhs).getValue(); if (value instanceof RString) { RString svalue = (RString) value; if (svalue.size() == 1) { String name = svalue.getString(0); return writeVariable(isSuper, RSymbol.getSymbol(name), rhs); } } throw RError.getUnknownObject(rhs); // TODO it's own exception } Utils.nyi(); return null; }