Changeset 12
- Timestamp:
- 07/01/10 11:23:50 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/t3q/src/org/etsi/t3q/visitor/QualityChecker.java
r7 r12 1397 1397 1398 1398 public void checkTypeDefOrderInGroup(LocationAST node) { 1399 String previousDef Id= null;1400 String currentDef Id= null;1401 LocationAST identifierNode = node.getFirstChild();1402 String identifierText = identifierNode.getFirstChild().getText();1403 1404 if ( identifierNode.getNextSibling() != null) {1405 LocationAST moduleDefinition = identifierNode.getNextSibling()1399 String previousDefinitionIdentifierText = null; 1400 String currentDefinitionIdentifierText = null; 1401 LocationAST groupIdentifierNode = node.getFirstChild(); 1402 String groupIdentifierText = groupIdentifierNode.getFirstChild().getText(); 1403 1404 if (groupIdentifierNode.getNextSibling() != null) { 1405 LocationAST moduleDefinitionNode = groupIdentifierNode.getNextSibling() 1406 1406 .getNthChild(2); 1407 1407 do { 1408 if (moduleDefinition.getType() != TTCN3ParserTokenTypes.SemiColon) { 1409 if (moduleDefinition.getFirstChild().getType() == TTCN3ParserTokenTypes.TypeDef) { 1410 LinkedList<LocationAST> identifierList = ASTUtil 1411 .findTypeNodes(moduleDefinition, 1412 TTCN3ParserTokenTypes.Identifier); 1413 if (identifierList.size() > 0){ 1414 1415 LocationAST definitionIdentifier = identifierList 1416 .get(0); 1417 1418 currentDefId = definitionIdentifier.getFirstChild() 1419 .getText(); 1408 if (moduleDefinitionNode.getType() != TTCN3ParserTokenTypes.SemiColon) { 1409 if (LocationAST.getModuleDefinitionTypeNode(moduleDefinitionNode).getType() == TTCN3ParserTokenTypes.TypeDef) { 1410 ArrayList<LocationAST> moduleDefinitionIdentifiersList = LocationAST.getModuleDefinitionIdentifiersList(moduleDefinitionNode); 1411 for (LocationAST moduleDefinitionIdentifier : moduleDefinitionIdentifiersList) { 1412 currentDefinitionIdentifierText = moduleDefinitionIdentifier 1413 .getFirstChild().getText(); 1420 1414 // switched to case insensitive ordering 1421 if (previousDefId != null 1422 && (currentDefId 1423 .compareToIgnoreCase(previousDefId) <= 0)) { 1424 this.getLoggingInterface().logWarning( 1425 node.getLine(), 1426 node.getEndLine(), 1427 MessageClass.STRUCTURE, 1428 "Type definitions <\"" 1429 + previousDefId 1430 + "\",\"" 1431 + currentDefId 1432 + "\"> within group \"" 1433 + identifierText 1434 + "\" are not alphabetically ordered!" + 1435 "4.1, " + MiscTools.getMethodName()); 1415 if (previousDefinitionIdentifierText != null) { 1416 if (currentDefinitionIdentifierText 1417 .compareToIgnoreCase(previousDefinitionIdentifierText) <= 0) { 1418 this.getLoggingInterface() 1419 .logWarning( 1420 node.getLine(), 1421 node.getEndLine(), 1422 MessageClass.STRUCTURE, 1423 "Type definitions <\"" 1424 + previousDefinitionIdentifierText 1425 + "\",\"" 1426 + currentDefinitionIdentifierText 1427 + "\"> within group \"" 1428 + groupIdentifierText 1429 + "\" are not alphabetically ordered!" 1430 + "4.1, " 1431 + MiscTools 1432 .getMethodName()); 1433 } 1436 1434 } 1437 previousDefId = currentDefId; 1438 1435 previousDefinitionIdentifierText = currentDefinitionIdentifierText; 1439 1436 } 1440 1441 } 1442 } 1443 } while ((moduleDefinition = moduleDefinition.getNextSibling()) != null); 1437 } 1438 } 1439 } while ((moduleDefinitionNode = moduleDefinitionNode.getNextSibling()) != null); 1444 1440 } 1445 1441 }
Note: See TracChangeset
for help on using the changeset viewer.