Ignore:
Timestamp:
09/24/10 12:14:04 (14 years ago)
Author:
phdmakk
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/t3e-tools/t3q/src/org/etsi/t3q/visitor/NamingConventionsChecker.java

    r7 r28  
    148148 
    149149        public void checkPortInstance(LocationAST node) { 
     150                //TODO: quickly hacked together, revise, improve 
    150151                String regExp = T3Q.activeProfile.getNamingConventionsConfig() 
    151152                                .getPortInstanceRegExp(); 
     153                String typeRegExp = ""; 
     154                String portType = ""; 
     155                 
    152156                LocationAST portElementNode = node.getFirstChild().getNextSibling(); 
     157                LocationAST portTypeIdentifier = node.getParent().getFirstChild().getFirstChild().getFirstChild().getFirstChild(); 
     158                Symbol portTypeSymbol = portTypeIdentifier.getSymbol(); 
     159                if (portTypeSymbol!=null) { 
     160                        LocationAST portTypeDeclarationNode = portTypeSymbol.getDeclarationNode(); 
     161                        LocationAST portAttribs = portTypeDeclarationNode.getParent().getNextSibling().getFirstChild(); 
     162                        if (portAttribs.getType()==TTCN3ParserTokenTypes.MessageAttribs) { 
     163                                typeRegExp = T3Q.activeProfile.getNamingConventionsConfig() 
     164                                .getMessagePortInstanceRegExp(); 
     165                                portType = "MessagePortInstance"; 
     166                        } else { 
     167                                if (portAttribs.getType()==TTCN3ParserTokenTypes.StreamAttribs) { 
     168                                        typeRegExp = T3Q.activeProfile.getNamingConventionsConfig() 
     169                                        .getStreamPortInstanceRegExp(); 
     170                                        portType = "StreamPortInstance"; 
     171                                } 
     172                        } 
     173                } else { 
     174                        //handle 
     175                } 
    153176                do { 
    154177                        checkIdentifierForNamingConventionCompliance(portElementNode, 
    155178                                        regExp, "PortInstance"); 
     179                        if (portTypeSymbol==null) { 
     180                                checker 
     181                                .getLoggingInterface() 
     182                                .logInformation( 
     183                                                node.getLine(), 
     184                                                node.getEndLine(), 
     185                                                MessageClass.NAMING, 
     186                                                "The definition for port type \"" + 
     187                                                portTypeIdentifier.getText()+ 
     188                                                "\" cannot be resolved. It cannot be determined which naming convention port instance \"" 
     189                                                                + portElementNode.getFirstChild().getFirstChild().getText() 
     190                                                                + "\" shall comply to!"  
     191                                                                , "2.1"); 
     192 
     193                        } else { 
     194                                checkIdentifierForNamingConventionCompliance(portElementNode, 
     195                                                typeRegExp, portType); 
     196                        } 
    156197                } while ((portElementNode = portElementNode.getNextSibling()) != null); 
    157198        } 
    158199 
     200        //TODO: differentiate between stream and message ports 
     201         
    159202        public void checkTestcase(LocationAST node) { 
    160203                String regExp = T3Q.activeProfile.getNamingConventionsConfig() 
Note: See TracChangeset for help on using the changeset viewer.