use of org.eclipse.titan.designer.AST.Assignments in project titan.EclipsePlug-ins by eclipse.
the class BrokenPartsViaReferences method collectBrokenModulesViaInvertedImports.
protected List<Module> collectBrokenModulesViaInvertedImports(final List<Module> startModules, final Map<Module, List<Module>> invertedImports) {
final List<Module> startModulesCopy = new ArrayList<Module>(startModules);
final List<Module> result = new ArrayList<Module>();
final MessageConsoleStream stream = TITANDebugConsole.getConsole().newMessageStream();
if (writeDebugInfo) {
for (Module startModule : startModules) {
TITANDebugConsole.println(" ** Module " + startModule.getName() + " can not be skipped as it was not yet analyzed.", stream);
}
}
for (int s = 0; s < startModulesCopy.size(); ++s) {
final Module startModule = startModulesCopy.get(s);
if (!result.contains(startModule)) {
result.add(startModule);
}
final List<Module> whereStartModuleUsed = invertedImports.get(startModule);
for (int d = 0; d < whereStartModuleUsed.size(); ++d) {
final Module dependentModule = whereStartModuleUsed.get(d);
if (!startModulesCopy.contains(dependentModule)) {
startModulesCopy.add(dependentModule);
if (writeDebugInfo) {
TITANDebugConsole.println(" ** Module " + dependentModule.getName() + " can not be skipped as it depends on " + startModule.getName() + " which needs to be checked.", stream);
}
}
}
startModule.notCheckRoot();
final Assignments assignments = startModule.getAssignments();
for (int d = 0; d < assignments.getNofAssignments(); ++d) {
final Assignment assignment = assignments.getAssignmentByIndex(d);
assignment.notCheckRoot();
}
}
return result;
}
use of org.eclipse.titan.designer.AST.Assignments in project titan.EclipsePlug-ins by eclipse.
the class ImportModule method addProposal.
// FIXME ezeket sem teszteltuk
@Override
public /**
* {@inheritDoc}
*/
void addProposal(final ProposalCollector propCollector, final Identifier targetModuleId) {
final List<ISubReference> subrefs = propCollector.getReference().getSubreferences();
if (propCollector.getReference().getModuleIdentifier() == null && subrefs.size() == 1) {
propCollector.addProposal(identifier, ImageCache.getImage(getOutlineIcon()), KIND);
}
final Module savedReferredModule = referredModule;
if (savedReferredModule != null) {
final Assignments assignments = savedReferredModule.getAssignments();
for (int i = 0, size = assignments.getNofAssignments(); i < size; i++) {
final Assignment temporalAssignment = assignments.getAssignmentByIndex(i);
if (savedReferredModule.isVisible(CompilationTimeStamp.getBaseTimestamp(), targetModuleId, temporalAssignment)) {
temporalAssignment.addProposal(propCollector, 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.addProposal(propCollector, targetModuleId);
} else if (importation.getVisibilityModifier() == VisibilityModifier.Friend) {
// The import is the friendly one
if (ttcnmodule.isVisible(CompilationTimeStamp.getBaseTimestamp(), targetModuleId, importation)) {
importation.addProposal(propCollector, targetModuleId);
}
}
}
}
}
}
use of org.eclipse.titan.designer.AST.Assignments in project titan.EclipsePlug-ins by eclipse.
the class ImportModule method addProposal.
/**
* Adds the imported module or definitions contained in it, to the list
* completion proposals.
*
* @param propCollector
* the proposal collector.
* @param targetModuleId
* the identifier of the module where the definition will
* be inserted. It is used to check if it is visible
* there or not.
*/
@Override
public /**
* {@inheritDoc}
*/
void addProposal(final ProposalCollector propCollector, final Identifier targetModuleId) {
final List<ISubReference> subrefs = propCollector.getReference().getSubreferences();
if (propCollector.getReference().getModuleIdentifier() == null && subrefs.size() == 1) {
propCollector.addProposal(identifier, ImageCache.getImage(getOutlineIcon()), KIND);
}
final Module savedReferredModule = referredModule;
if (savedReferredModule != null) {
final Assignments assignments = savedReferredModule.getAssignments();
for (int i = 0, size = assignments.getNofAssignments(); i < size; i++) {
final Assignment temporalAssignment = assignments.getAssignmentByIndex(i);
if (savedReferredModule.isVisible(CompilationTimeStamp.getBaseTimestamp(), targetModuleId, temporalAssignment)) {
temporalAssignment.addProposal(propCollector, 0);
}
}
}
}
use of org.eclipse.titan.designer.AST.Assignments in project titan.EclipsePlug-ins by eclipse.
the class ASN1Assignments method getLocalAssignmentByID.
@Override
public /**
* {@inheritDoc}
*/
Assignment getLocalAssignmentByID(final CompilationTimeStamp timestamp, final Identifier identifier) {
if (null == lastUniqueNessCheckTimeStamp) {
checkUniqueness(timestamp);
}
final String name = identifier.getName();
if (assignmentMap.containsKey(name)) {
final Assignment temp = assignmentMap.get(name);
if (temp instanceof Undefined_Assignment) {
final ASN1Assignment real = ((Undefined_Assignment) temp).getRealAssignment(timestamp);
if (null != real) {
return real;
}
}
return temp;
}
final Assignments temp = SpecialASN1Module.getSpecialModule().getAssignments();
if (!this.equals(temp)) {
return temp.getLocalAssignmentByID(timestamp, identifier);
}
return null;
}
use of org.eclipse.titan.designer.AST.Assignments in project titan.EclipsePlug-ins by eclipse.
the class UnrestrictedString_Type method getTypeRefd.
@Override
public /**
* {@inheritDoc}
*/
IType getTypeRefd(final CompilationTimeStamp timestamp, final IReferenceChain refChain) {
if (null == myScope) {
setIsErroneous(true);
return this;
}
final Identifier identifier = new Identifier(Identifier_type.ID_ASN, "CHARACTER STRING");
final Assignments assignments = myScope.getAssignmentsScope();
if (!assignments.hasAssignmentWithId(timestamp, identifier)) {
setIsErroneous(true);
return this;
}
final Assignment assignment = assignments.getLocalAssignmentByID(timestamp, identifier);
if (null == assignment || null == assignment.getType(timestamp)) {
setIsErroneous(true);
return this;
}
return assignment.getType(timestamp);
}
Aggregations