use of org.eclipse.titan.designer.AST.Assignments in project titan.EclipsePlug-ins by eclipse.
the class ImportModule method addDeclaration.
@Override
public /**
* {@inheritDoc}
*/
void addDeclaration(final DeclarationCollector declarationCollector, final Identifier targetModuleId) {
final Module savedReferredModule = referredModule;
if (savedReferredModule != null) {
final Assignments assignments = savedReferredModule.getAssignments();
for (int i = 0; i < assignments.getNofAssignments(); i++) {
final Assignment temporalAssignment = assignments.getAssignmentByIndex(i);
if (savedReferredModule.isVisible(CompilationTimeStamp.getBaseTimestamp(), targetModuleId, temporalAssignment)) {
temporalAssignment.addDeclaration(declarationCollector, 0);
}
}
if (savedReferredModule instanceof TTCN3Module) {
final TTCN3Module ttcnmodule = (TTCN3Module) savedReferredModule;
final List<ImportModule> imports = ttcnmodule.getImports();
for (final ImportModule importation : imports) {
if (importation.getVisibilityModifier() == VisibilityModifier.Public) {
importation.addDeclaration(declarationCollector, targetModuleId);
} else if (importation.getVisibilityModifier() == VisibilityModifier.Friend) {
// one
if (ttcnmodule.isVisible(CompilationTimeStamp.getBaseTimestamp(), targetModuleId, importation)) {
importation.addDeclaration(declarationCollector, targetModuleId);
}
}
}
}
final Identifier moduleId = declarationCollector.getReference().getModuleIdentifier();
final List<ISubReference> subrefs = declarationCollector.getReference().getSubreferences();
if (moduleId == null && subrefs.size() == 1 && identifier.getName().equals(subrefs.get(0).getId().getName())) {
declarationCollector.addDeclaration(savedReferredModule.getIdentifier().getDisplayName(), savedReferredModule.getIdentifier().getLocation(), (Assignment) null);
}
}
}
use of org.eclipse.titan.designer.AST.Assignments in project titan.EclipsePlug-ins by eclipse.
the class ImportModule method hasImportedAssignmentWithID.
@Override
public /**
* {@inheritDoc}
*/
boolean hasImportedAssignmentWithID(final CompilationTimeStamp timestamp, final Identifier identifier) {
if (referredModule == null) {
return false;
}
if (hasImportOfImport) {
if (referredModule instanceof TTCN3Module) {
final TTCN3Module ttcnmodule = (TTCN3Module) referredModule;
final List<ImportModule> imports = ttcnmodule.getImports();
for (final ImportModule importation : imports) {
if (importation.hasImportedAssignmentWithID(timestamp, identifier)) {
return true;
}
}
}
}
if (hasNormalImport) {
final Assignments assignments = referredModule.getAssignments();
if (assignments != null && assignments.hasLocalAssignmentWithID(timestamp, identifier)) {
return true;
}
}
return false;
}
Aggregations