Changeset 41 for trunk/t3q/src/org/etsi
- Timestamp:
- 10/04/11 12:06:41 (13 years ago)
- Location:
- trunk/t3q/src/org/etsi/t3q/visitor
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/t3q/src/org/etsi/t3q/visitor/QualityChecker.java
r40 r41 30 30 31 31 import de.ugoe.cs.swe.trex.core.analyzer.astutil.ReferenceFinder; 32 import de.ugoe.cs.swe.trex.core.analyzer.astutil.ReferenceFinderWithCache; 32 33 import de.ugoe.cs.swe.trex.core.analyzer.astutil.ReferenceWithContext; 33 34 import de.ugoe.cs.swe.trex.core.analyzer.rfparser.ASTUtil; … … 54 55 private ArrayList<LocationAST> subsequentLogStatementNodes = new ArrayList<LocationAST>(); 55 56 private Stack<LocationAST> cyclicFunctionReferences = new Stack<LocationAST>(); 57 58 private ReferenceFinder referenceFinder; 56 59 57 60 … … 60 63 this.logger = new LoggingInterface(T3Q.activeProfile.getLoggingConfiguration()); 61 64 this.logger.setMaximumLogLevel(T3Q.getLogLevel()); 65 this.setReferenceFinder(new ReferenceFinderWithCache()); 62 66 } 63 67 … … 158 162 Symbol functionDefSymbol = functionDefIdentifierNode.getSymbol(); 159 163 160 ReferenceFinder referenceFinder = new ReferenceFinder(); 161 Map<String, List<ReferenceWithContext>> referenceMap = referenceFinder 164 Map<String, List<ReferenceWithContext>> referenceMap = getReferenceFinder() 162 165 .findReferences(functionDefSymbol); 163 166 if (referenceMap.isEmpty()) { … … 252 255 } 253 256 254 ReferenceFinder referenceFinder = new ReferenceFinder(); 255 Map<String, List<ReferenceWithContext>> referenceMap = referenceFinder 257 Map<String, List<ReferenceWithContext>> referenceMap = getReferenceFinder() 256 258 .findReferences(relevantSymbols); 257 259 Iterator<List<ReferenceWithContext>> referenceMapIterator = referenceMap … … 401 403 } 402 404 403 ReferenceFinder referenceFinder = new ReferenceFinder();404 405 String moduleDefinitionIdentifierText; 405 406 if (node.getType()!=TTCN3ParserTokenTypes.ModuleDefinition) { … … 410 411 for (LocationAST localDefinitionIdentifier : localDefinitionsIdentifiersList) { 411 412 Symbol symbol = localDefinitionIdentifier.getFirstChild().getSymbol(); 412 if ( referenceFinder.countReferences(symbol)==0) {413 if (getReferenceFinder().countReferences(symbol)==0) { 413 414 this.getLoggingInterface().logWarning(localDefinitionIdentifier.getLine(), 414 415 localDefinitionIdentifier.getEndLine(), … … 492 493 493 494 Symbol formalParSymbol = identifierNode.getFirstChild().getSymbol(); 494 ReferenceFinder referenceFinder = new ReferenceFinder();495 495 int referenceCount = 0; 496 referenceCount = referenceFinder.countReferences(formalParSymbol);496 referenceCount = getReferenceFinder().countReferences(formalParSymbol); 497 497 if (referenceCount == 0) { 498 498 String containingModuleDefinitionName = node.getContainingModuleDefinitionIdentifiersList().get(0).getFirstChild().getText(); … … 516 516 Symbol moduleSymbol = moduleIdentifier.getFirstChild().getSymbol(); 517 517 518 ReferenceFinder referenceFinder = new ReferenceFinder(); 519 Map<String, List<ReferenceWithContext>> referenceMap = referenceFinder.findReferences(moduleSymbol); 518 Map<String, List<ReferenceWithContext>> referenceMap = getReferenceFinder().findReferences(moduleSymbol); 520 519 Iterator<List<ReferenceWithContext>> referenceMapIterator = referenceMap.values().iterator(); 521 520 while (referenceMapIterator.hasNext()) { … … 544 543 Symbol moduleSymbol = moduleIdentifier.getFirstChild().getSymbol(); 545 544 546 ReferenceFinder referenceFinder = new ReferenceFinder(); 547 Map<String, List<ReferenceWithContext>> referenceMap = referenceFinder.findReferences(moduleSymbol); 545 Map<String, List<ReferenceWithContext>> referenceMap = getReferenceFinder().findReferences(moduleSymbol); 548 546 Iterator<List<ReferenceWithContext>> referenceMapIterator = referenceMap.values().iterator(); 549 547 while (referenceMapIterator.hasNext()) { … … 863 861 } 864 862 865 ReferenceFinder referenceFinder = new ReferenceFinder(); 866 867 Map<String, List<ReferenceWithContext>> referenceMap = referenceFinder 863 Map<String, List<ReferenceWithContext>> referenceMap = getReferenceFinder() 868 864 .findReferences(localDefinitionsSymbolsList); 869 865 … … 1017 1013 return; 1018 1014 } 1019 ReferenceFinder referenceFinder = new ReferenceFinder(); 1020 if (referenceFinder.countReferences(s) == 0) { 1015 if (getReferenceFinder().countReferences(s) == 0) { 1021 1016 // TODO: add stats counters 1022 1017 // TODO: add type information … … 1030 1025 } else { 1031 1026 int referencesOutsideImports = 0; 1032 Map<String, List<ReferenceWithContext>> referenceMap = referenceFinder.findReferences(s);1027 Map<String, List<ReferenceWithContext>> referenceMap = getReferenceFinder().findReferences(s); 1033 1028 Iterator<List<ReferenceWithContext>> referenceMapIterator = referenceMap.values().iterator(); 1034 1029 while (referenceMapIterator.hasNext()) { … … 2552 2547 } 2553 2548 2549 public void setReferenceFinder(ReferenceFinder referenceFinder) { 2550 this.referenceFinder = referenceFinder; 2551 } 2552 2553 public ReferenceFinder getReferenceFinder() { 2554 return referenceFinder; 2555 } 2556 2554 2557 2555 2558 -
trunk/t3q/src/org/etsi/t3q/visitor/QualityCheckerExtras.java
r7 r41 40 40 Symbol s = identifierNode.getFirstChild().getSymbol(); 41 41 //TODO: add safety check here 42 ReferenceFinder referenceFinder = new ReferenceFinder(); 43 if (referenceFinder.countReferences(s) == 0){ 42 if (getReferenceFinder().countReferences(s) == 0){ 44 43 //TODO: add stats counters 45 44 //TODO: add type information … … 92 91 Symbol altstepDefSymbol = altstepDefIdentifierNode.getSymbol(); 93 92 94 ReferenceFinder referenceFinder = new ReferenceFinder(); 95 Map<String, List<ReferenceWithContext>> referenceMap = referenceFinder 93 Map<String, List<ReferenceWithContext>> referenceMap = getReferenceFinder() 96 94 .findReferences(altstepDefSymbol); 97 95 if (referenceMap.isEmpty()) {
Note: See TracChangeset
for help on using the changeset viewer.