use of org.eclipse.n4js.transpiler.im.SymbolTableEntryOriginal in project n4js by eclipse.
the class N4IDLVersionedImportsTransformation method transformVersionedImportSpecifier.
/**
* Replaces the given versioned import specifier, by multiple named imports.
*
* Only adds new imports for type versions that are actually used in the module.
*/
private void transformVersionedImportSpecifier(VersionedNamedImportSpecifier_IM importSpecifier) {
// determine the type versions that are actually used in this module
Collection<SymbolTableEntryOriginal> typeVersionSTEs = findSymbolTableEntriesForVersionedTypeImport(importSpecifier);
// Add a new named import for each imported type version
typeVersionSTEs.forEach(ste -> {
// remove specifier reference from entry (as we have just removed it from the IM)
ste.setImportSpecifier(null);
// add new import for this specific version
addNamedImport(ste, null);
// obtain newly created specifier via STE
ImportSpecifier createdSpecifier = ste.getImportSpecifier();
// make sure to retain trace of the original IM specifier
getState().tracer.copyTrace(importSpecifier, createdSpecifier);
});
// remove implicitly versioned import from IM
remove(importSpecifier);
}
use of org.eclipse.n4js.transpiler.im.SymbolTableEntryOriginal in project n4js by eclipse.
the class ParameterizedPropertyAccessExpression_IMImpl method getPropertyName.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getPropertyName() {
String _xifexpression = null;
boolean _isAnyPlusAccess = this.isAnyPlusAccess();
if (_isAnyPlusAccess) {
_xifexpression = this.getNameOfAnyPlusProperty();
} else {
final SymbolTableEntry e = this.getRewiredTarget();
if ((e instanceof SymbolTableEntryOriginal)) {
final String exName = ((SymbolTableEntryOriginal) e).exportedName();
if ((exName != null)) {
return exName;
} else {
SymbolTableEntry _property_IM = this.getProperty_IM();
String _name = null;
if (_property_IM != null) {
_name = _property_IM.getName();
}
return _name;
}
} else {
SymbolTableEntry _property_IM_1 = this.getProperty_IM();
String _name_1 = null;
if (_property_IM_1 != null) {
_name_1 = _property_IM_1.getName();
}
return _name_1;
}
}
return _xifexpression;
}
use of org.eclipse.n4js.transpiler.im.SymbolTableEntryOriginal in project n4js by eclipse.
the class DelegatingGetterDeclarationImpl method setDelegationBaseType.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDelegationBaseType(SymbolTableEntryOriginal newDelegationBaseType) {
SymbolTableEntryOriginal oldDelegationBaseType = delegationBaseType;
delegationBaseType = newDelegationBaseType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ImPackage.DELEGATING_GETTER_DECLARATION__DELEGATION_BASE_TYPE, oldDelegationBaseType, delegationBaseType));
}
use of org.eclipse.n4js.transpiler.im.SymbolTableEntryOriginal in project n4js by eclipse.
the class DelegatingMethodDeclarationImpl method setDelegationTarget.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDelegationTarget(SymbolTableEntryOriginal newDelegationTarget) {
SymbolTableEntryOriginal oldDelegationTarget = delegationTarget;
delegationTarget = newDelegationTarget;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ImPackage.DELEGATING_METHOD_DECLARATION__DELEGATION_TARGET, oldDelegationTarget, delegationTarget));
}
use of org.eclipse.n4js.transpiler.im.SymbolTableEntryOriginal in project n4js by eclipse.
the class DelegatingMemberImpl method setDelegationTarget.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDelegationTarget(SymbolTableEntryOriginal newDelegationTarget) {
SymbolTableEntryOriginal oldDelegationTarget = delegationTarget;
delegationTarget = newDelegationTarget;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ImPackage.DELEGATING_MEMBER__DELEGATION_TARGET, oldDelegationTarget, delegationTarget));
}
Aggregations