-CYStatement *CYExternal::Replace(CYContext &context) {
- return $E($ CYAssign($V(typed_->identifier_), $C1(typed_->Replace(context), $C2($V("dlsym"), $V("RTLD_DEFAULT"), $S(typed_->identifier_->Word())))));
+CYTarget *CYExtend::Replace(CYContext &context) {
+ return object_.Replace(context, lhs_);
+}
+
+CYStatement *CYExternalDefinition::Replace(CYContext &context) {
+ return $E($ CYAssign($V(name_), $ CYExternalExpression(abi_, type_, name_)));
+}
+
+CYTarget *CYExternalExpression::Replace(CYContext &context) {
+ CYExpression *expression(name_->Number(context));
+ if (expression == NULL)
+ expression = $C2($V("dlsym"), $V("RTLD_DEFAULT"), name_->PropertyName(context));
+ return $C1(type_->Replace(context), expression);