Changeset 28 for branches/t3e-tools/t3q/src
- Timestamp:
- 09/24/10 12:14:04 (14 years ago)
- Location:
- branches/t3e-tools/t3q/src/org/etsi/t3q/visitor
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/t3e-tools/t3q/src/org/etsi/t3q/visitor/AbstractVisitor.java
r16 r28 778 778 public ContinueStatus visitSTEPSIZE(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 779 779 public ContinueStatus visitTIMESTAMP(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 780 public ContinueStatus visitINV(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 781 public ContinueStatus visitUNTIL(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 780 782 public ContinueStatus visitCONT(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 781 783 public ContinueStatus visitPAR(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 782 784 public ContinueStatus visitSEQ(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 785 public ContinueStatus visitSTREAM(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 786 public ContinueStatus visitONENTRY(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 787 public ContinueStatus visitONEXIT(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 788 public ContinueStatus visitNOTINV(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 789 public ContinueStatus visitFINISHED(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 790 public ContinueStatus visitDURATION(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 791 public ContinueStatus visitMODE(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 792 public ContinueStatus visitDELTA(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 793 public ContinueStatus visitPREV(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 794 public ContinueStatus visitAT(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 795 public ContinueStatus visitHISTORY(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 796 public ContinueStatus visitVALUES(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 797 public ContinueStatus visitAPPLY(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 798 public ContinueStatus visitFIND(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 799 public ContinueStatus visitVIOLATES(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 800 public ContinueStatus visitASSERT(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 801 public ContinueStatus visitStreamAttribs(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 802 public ContinueStatus visitStreamList(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 803 public ContinueStatus visitStreamDirection(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 804 public ContinueStatus visitModeSpecification(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 805 public ContinueStatus visitBasicMode(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 806 public ContinueStatus visitBasicModeOp(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 807 public ContinueStatus visitComplexMode(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 808 public ContinueStatus visitOnEntryBlock(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 809 public ContinueStatus visitOnExitBlock(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 810 public ContinueStatus visitUntilBlock(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 811 public ContinueStatus visitUntilGuardList(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 812 public ContinueStatus visitUntilGuardStatement(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 813 public ContinueStatus visitUntilGuardChar(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 814 public ContinueStatus visitInvariantBlock(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 815 public ContinueStatus visitInvariantList(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 816 public ContinueStatus visitModeList(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 817 public ContinueStatus visitSeqKeyword(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 818 public ContinueStatus visitParKeyword(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 819 public ContinueStatus visitNotInvKeyword(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 820 public ContinueStatus visitFinishedKeyword(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 821 public ContinueStatus visitDurationKeyword(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 822 public ContinueStatus visitDurationOperation(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 823 public ContinueStatus visitModeKeyword(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 824 public ContinueStatus visitModeDef(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 825 public ContinueStatus visitModeTypeDef(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 826 public ContinueStatus visitStreamDataOps(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 827 public ContinueStatus visitStreamValueOp(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 828 public ContinueStatus visitPortValueOp(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 829 public ContinueStatus visitStreamTimestampOp(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 830 public ContinueStatus visitPortTimestampOp(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 831 public ContinueStatus visitStreamDeltaOp(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 832 public ContinueStatus visitPortDeltaOp(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 833 public ContinueStatus visitStreamNavigationOps(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 834 public ContinueStatus visitStreamPrevOp(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 835 public ContinueStatus visitPortPrevOp(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 836 public ContinueStatus visitStreamAtOp(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 837 public ContinueStatus visitPortAtOp(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 838 public ContinueStatus visitStreamEvalStatements(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 839 public ContinueStatus visitStreamHistoryStatement(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 840 public ContinueStatus visitPortHistoryOp(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 841 public ContinueStatus visitStartValue(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 842 public ContinueStatus visitEndValue(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 843 public ContinueStatus visitStreamValuesStatement(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 844 public ContinueStatus visitPortValuesOp(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 845 public ContinueStatus visitStreamApplyStatement(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 846 public ContinueStatus visitPortApplyOp(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 847 public ContinueStatus visitStreamTemplateParameter(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 848 public ContinueStatus visitStreamFindStatement(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 849 public ContinueStatus visitPortFindOp(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 850 public ContinueStatus visitStreamViolatesStatement(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 851 public ContinueStatus visitPortViolatesOp(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 852 public ContinueStatus visitStreamAssignment(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 783 853 public ContinueStatus visitWS(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} 784 854 public ContinueStatus visitSL_COMMENT(LocationAST node) throws TTCN3BehaviorException {return ContinueStatus.getInstance(true,true);} … … 3142 3212 continueStatus=visitTIMESTAMP(node); 3143 3213 return continueStatus; 3214 case TTCN3ParserTokenTypes.INV: 3215 continueStatus=visitINV(node); 3216 return continueStatus; 3217 case TTCN3ParserTokenTypes.UNTIL: 3218 continueStatus=visitUNTIL(node); 3219 return continueStatus; 3144 3220 case TTCN3ParserTokenTypes.CONT: 3145 3221 continueStatus=visitCONT(node); … … 3150 3226 case TTCN3ParserTokenTypes.SEQ: 3151 3227 continueStatus=visitSEQ(node); 3228 return continueStatus; 3229 case TTCN3ParserTokenTypes.STREAM: 3230 continueStatus=visitSTREAM(node); 3231 return continueStatus; 3232 case TTCN3ParserTokenTypes.ONENTRY: 3233 continueStatus=visitONENTRY(node); 3234 return continueStatus; 3235 case TTCN3ParserTokenTypes.ONEXIT: 3236 continueStatus=visitONEXIT(node); 3237 return continueStatus; 3238 case TTCN3ParserTokenTypes.NOTINV: 3239 continueStatus=visitNOTINV(node); 3240 return continueStatus; 3241 case TTCN3ParserTokenTypes.FINISHED: 3242 continueStatus=visitFINISHED(node); 3243 return continueStatus; 3244 case TTCN3ParserTokenTypes.DURATION: 3245 continueStatus=visitDURATION(node); 3246 return continueStatus; 3247 case TTCN3ParserTokenTypes.MODE: 3248 continueStatus=visitMODE(node); 3249 return continueStatus; 3250 case TTCN3ParserTokenTypes.DELTA: 3251 continueStatus=visitDELTA(node); 3252 return continueStatus; 3253 case TTCN3ParserTokenTypes.PREV: 3254 continueStatus=visitPREV(node); 3255 return continueStatus; 3256 case TTCN3ParserTokenTypes.AT: 3257 continueStatus=visitAT(node); 3258 return continueStatus; 3259 case TTCN3ParserTokenTypes.HISTORY: 3260 continueStatus=visitHISTORY(node); 3261 return continueStatus; 3262 case TTCN3ParserTokenTypes.VALUES: 3263 continueStatus=visitVALUES(node); 3264 return continueStatus; 3265 case TTCN3ParserTokenTypes.APPLY: 3266 continueStatus=visitAPPLY(node); 3267 return continueStatus; 3268 case TTCN3ParserTokenTypes.FIND: 3269 continueStatus=visitFIND(node); 3270 return continueStatus; 3271 case TTCN3ParserTokenTypes.VIOLATES: 3272 continueStatus=visitVIOLATES(node); 3273 return continueStatus; 3274 case TTCN3ParserTokenTypes.ASSERT: 3275 continueStatus=visitASSERT(node); 3276 return continueStatus; 3277 case TTCN3ParserTokenTypes.StreamAttribs: 3278 continueStatus=visitStreamAttribs(node); 3279 return continueStatus; 3280 case TTCN3ParserTokenTypes.StreamList: 3281 continueStatus=visitStreamList(node); 3282 return continueStatus; 3283 case TTCN3ParserTokenTypes.StreamDirection: 3284 continueStatus=visitStreamDirection(node); 3285 return continueStatus; 3286 case TTCN3ParserTokenTypes.ModeSpecification: 3287 continueStatus=visitModeSpecification(node); 3288 return continueStatus; 3289 case TTCN3ParserTokenTypes.BasicMode: 3290 continueStatus=visitBasicMode(node); 3291 return continueStatus; 3292 case TTCN3ParserTokenTypes.BasicModeOp: 3293 continueStatus=visitBasicModeOp(node); 3294 return continueStatus; 3295 case TTCN3ParserTokenTypes.ComplexMode: 3296 continueStatus=visitComplexMode(node); 3297 return continueStatus; 3298 case TTCN3ParserTokenTypes.OnEntryBlock: 3299 continueStatus=visitOnEntryBlock(node); 3300 return continueStatus; 3301 case TTCN3ParserTokenTypes.OnExitBlock: 3302 continueStatus=visitOnExitBlock(node); 3303 return continueStatus; 3304 case TTCN3ParserTokenTypes.UntilBlock: 3305 continueStatus=visitUntilBlock(node); 3306 return continueStatus; 3307 case TTCN3ParserTokenTypes.UntilGuardList: 3308 continueStatus=visitUntilGuardList(node); 3309 return continueStatus; 3310 case TTCN3ParserTokenTypes.UntilGuardStatement: 3311 continueStatus=visitUntilGuardStatement(node); 3312 return continueStatus; 3313 case TTCN3ParserTokenTypes.UntilGuardChar: 3314 continueStatus=visitUntilGuardChar(node); 3315 return continueStatus; 3316 case TTCN3ParserTokenTypes.InvariantBlock: 3317 continueStatus=visitInvariantBlock(node); 3318 return continueStatus; 3319 case TTCN3ParserTokenTypes.InvariantList: 3320 continueStatus=visitInvariantList(node); 3321 return continueStatus; 3322 case TTCN3ParserTokenTypes.ModeList: 3323 continueStatus=visitModeList(node); 3324 return continueStatus; 3325 case TTCN3ParserTokenTypes.SeqKeyword: 3326 continueStatus=visitSeqKeyword(node); 3327 return continueStatus; 3328 case TTCN3ParserTokenTypes.ParKeyword: 3329 continueStatus=visitParKeyword(node); 3330 return continueStatus; 3331 case TTCN3ParserTokenTypes.NotInvKeyword: 3332 continueStatus=visitNotInvKeyword(node); 3333 return continueStatus; 3334 case TTCN3ParserTokenTypes.FinishedKeyword: 3335 continueStatus=visitFinishedKeyword(node); 3336 return continueStatus; 3337 case TTCN3ParserTokenTypes.DurationKeyword: 3338 continueStatus=visitDurationKeyword(node); 3339 return continueStatus; 3340 case TTCN3ParserTokenTypes.DurationOperation: 3341 continueStatus=visitDurationOperation(node); 3342 return continueStatus; 3343 case TTCN3ParserTokenTypes.ModeKeyword: 3344 continueStatus=visitModeKeyword(node); 3345 return continueStatus; 3346 case TTCN3ParserTokenTypes.ModeDef: 3347 continueStatus=visitModeDef(node); 3348 return continueStatus; 3349 case TTCN3ParserTokenTypes.ModeTypeDef: 3350 continueStatus=visitModeTypeDef(node); 3351 return continueStatus; 3352 case TTCN3ParserTokenTypes.StreamDataOps: 3353 continueStatus=visitStreamDataOps(node); 3354 return continueStatus; 3355 case TTCN3ParserTokenTypes.StreamValueOp: 3356 continueStatus=visitStreamValueOp(node); 3357 return continueStatus; 3358 case TTCN3ParserTokenTypes.PortValueOp: 3359 continueStatus=visitPortValueOp(node); 3360 return continueStatus; 3361 case TTCN3ParserTokenTypes.StreamTimestampOp: 3362 continueStatus=visitStreamTimestampOp(node); 3363 return continueStatus; 3364 case TTCN3ParserTokenTypes.PortTimestampOp: 3365 continueStatus=visitPortTimestampOp(node); 3366 return continueStatus; 3367 case TTCN3ParserTokenTypes.StreamDeltaOp: 3368 continueStatus=visitStreamDeltaOp(node); 3369 return continueStatus; 3370 case TTCN3ParserTokenTypes.PortDeltaOp: 3371 continueStatus=visitPortDeltaOp(node); 3372 return continueStatus; 3373 case TTCN3ParserTokenTypes.StreamNavigationOps: 3374 continueStatus=visitStreamNavigationOps(node); 3375 return continueStatus; 3376 case TTCN3ParserTokenTypes.StreamPrevOp: 3377 continueStatus=visitStreamPrevOp(node); 3378 return continueStatus; 3379 case TTCN3ParserTokenTypes.PortPrevOp: 3380 continueStatus=visitPortPrevOp(node); 3381 return continueStatus; 3382 case TTCN3ParserTokenTypes.StreamAtOp: 3383 continueStatus=visitStreamAtOp(node); 3384 return continueStatus; 3385 case TTCN3ParserTokenTypes.PortAtOp: 3386 continueStatus=visitPortAtOp(node); 3387 return continueStatus; 3388 case TTCN3ParserTokenTypes.StreamEvalStatements: 3389 continueStatus=visitStreamEvalStatements(node); 3390 return continueStatus; 3391 case TTCN3ParserTokenTypes.StreamHistoryStatement: 3392 continueStatus=visitStreamHistoryStatement(node); 3393 return continueStatus; 3394 case TTCN3ParserTokenTypes.PortHistoryOp: 3395 continueStatus=visitPortHistoryOp(node); 3396 return continueStatus; 3397 case TTCN3ParserTokenTypes.StartValue: 3398 continueStatus=visitStartValue(node); 3399 return continueStatus; 3400 case TTCN3ParserTokenTypes.EndValue: 3401 continueStatus=visitEndValue(node); 3402 return continueStatus; 3403 case TTCN3ParserTokenTypes.StreamValuesStatement: 3404 continueStatus=visitStreamValuesStatement(node); 3405 return continueStatus; 3406 case TTCN3ParserTokenTypes.PortValuesOp: 3407 continueStatus=visitPortValuesOp(node); 3408 return continueStatus; 3409 case TTCN3ParserTokenTypes.StreamApplyStatement: 3410 continueStatus=visitStreamApplyStatement(node); 3411 return continueStatus; 3412 case TTCN3ParserTokenTypes.PortApplyOp: 3413 continueStatus=visitPortApplyOp(node); 3414 return continueStatus; 3415 case TTCN3ParserTokenTypes.StreamTemplateParameter: 3416 continueStatus=visitStreamTemplateParameter(node); 3417 return continueStatus; 3418 case TTCN3ParserTokenTypes.StreamFindStatement: 3419 continueStatus=visitStreamFindStatement(node); 3420 return continueStatus; 3421 case TTCN3ParserTokenTypes.PortFindOp: 3422 continueStatus=visitPortFindOp(node); 3423 return continueStatus; 3424 case TTCN3ParserTokenTypes.StreamViolatesStatement: 3425 continueStatus=visitStreamViolatesStatement(node); 3426 return continueStatus; 3427 case TTCN3ParserTokenTypes.PortViolatesOp: 3428 continueStatus=visitPortViolatesOp(node); 3429 return continueStatus; 3430 case TTCN3ParserTokenTypes.StreamAssignment: 3431 continueStatus=visitStreamAssignment(node); 3152 3432 return continueStatus; 3153 3433 case TTCN3ParserTokenTypes.WS: -
branches/t3e-tools/t3q/src/org/etsi/t3q/visitor/NamingConventionsChecker.java
r7 r28 148 148 149 149 public void checkPortInstance(LocationAST node) { 150 //TODO: quickly hacked together, revise, improve 150 151 String regExp = T3Q.activeProfile.getNamingConventionsConfig() 151 152 .getPortInstanceRegExp(); 153 String typeRegExp = ""; 154 String portType = ""; 155 152 156 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 } 153 176 do { 154 177 checkIdentifierForNamingConventionCompliance(portElementNode, 155 178 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 } 156 197 } while ((portElementNode = portElementNode.getNextSibling()) != null); 157 198 } 158 199 200 //TODO: differentiate between stream and message ports 201 159 202 public void checkTestcase(LocationAST node) { 160 203 String regExp = T3Q.activeProfile.getNamingConventionsConfig() -
branches/t3e-tools/t3q/src/org/etsi/t3q/visitor/QualityChecker.java
r16 r28 2185 2185 } 2186 2186 2187 // ------------------------------------------------------------------------------------------- 2188 2187 //TODO: extract, duplicate of nested alt statements 2188 public void checkNoNestedModes(LocationAST node) { 2189 2190 LinkedList<LocationAST> nestedNodes = ASTUtil.findTypeNodes(node 2191 // .getFirstChild() 2192 , TTCN3ParserTokenTypes.ModeSpecification); 2193 if (nestedNodes != null && nestedNodes.size() > 0) { 2194 LocationAST nestedNode; 2195 2196 int[] nodeTypes = new int[] {TTCN3ParserTokenTypes.ModeSpecification}; 2197 for (int n = 0; n < nestedNodes.size(); n++) { 2198 nestedNode = nestedNodes.get(n); 2199 int nestingDepth = getConstructNesting(nestedNode, nodeTypes); 2200 if (nestingDepth > T3Q.activeProfile.getEmbeddedExtensionConfig().getAllowedModeNestingDepth()) { 2201 this.getLoggingInterface().logWarning(nestedNode.getLine(), nestedNode.getEndLine(), MessageClass.STYLE, "Mode nesting depth ("+nestingDepth+") exceeds maximum allowed nesting depth ("+T3Q.activeProfile.getEmbeddedExtensionConfig().getAllowedModeNestingDepth()+")!", "EC.XX, "+MiscTools.getMethodName()); 2202 } 2203 } 2204 } 2205 2206 } 2207 2208 // ------------------------------------------------------------------------------------------- 2209 2210 //TODO: further potential for reuse? 2189 2211 public void checkNoNestedAltStatements(LocationAST node) { 2190 2212 … … 2193 2215 // .getFirstChild() 2194 2216 , TTCN3ParserTokenTypes.AltConstruct); 2195 2196 2217 if (nestedAltConstructNodes != null && nestedAltConstructNodes.size() > 0) { 2197 2218 LocationAST nestedAltConstructNode; 2198 2219 2220 int[] nodeTypes = new int[] {TTCN3ParserTokenTypes.AltConstruct, TTCN3ParserTokenTypes.AltstepDef}; 2199 2221 for (int n = 0; n < nestedAltConstructNodes.size(); n++) { 2200 2222 nestedAltConstructNode = nestedAltConstructNodes.get(n); 2201 int nestingDepth = get AltConstructNesting(nestedAltConstructNode);2223 int nestingDepth = getConstructNesting(nestedAltConstructNode, nodeTypes); 2202 2224 if (nestingDepth > T3Q.activeProfile.getMaximumAllowedNestingDepth()) { 2203 2225 this.getLoggingInterface().logWarning(nestedAltConstructNode.getLine(), nestedAltConstructNode.getEndLine(), MessageClass.STYLE, "Alt statement nesting depth ("+nestingDepth+") exceeds maximum allowed nesting depth ("+T3Q.activeProfile.getMaximumAllowedNestingDepth()+")!", "6.3, "+MiscTools.getMethodName()); … … 2210 2232 // ------------------------------------------------------------------------------------------- 2211 2233 2212 private int get AltConstructNesting(LocationAST node){2234 private int getConstructNesting(LocationAST node, int[] nodeTypes){ 2213 2235 int nestingDepth = 1; 2214 LocationAST containing AltConstructNode = LocationAST.resolveParentsUntilType(node.getParent(), new int[] {TTCN3ParserTokenTypes.AltConstruct, TTCN3ParserTokenTypes.AltstepDef});2236 LocationAST containingConstructNode = LocationAST.resolveParentsUntilType(node.getParent(), nodeTypes); 2215 2237 2216 if (containing AltConstructNode != null){2217 nestingDepth += get AltConstructNesting(containingAltConstructNode);2238 if (containingConstructNode != null){ 2239 nestingDepth += getConstructNesting(containingConstructNode, nodeTypes); 2218 2240 } else { 2219 2241 nestingDepth = 0; -
branches/t3e-tools/t3q/src/org/etsi/t3q/visitor/T3QVisitor.java
r16 r28 28 28 } 29 29 30 //TODO: temporary addition 30 31 //TODO: temporary addition? 32 public ContinueStatus visitModeSpecification(LocationAST node) 33 throws TTCN3BehaviorException { 34 if (T3Q.activeProfile.getEmbeddedExtensionConfig() 35 .isCheckNoNestedModes()) { 36 checker.checkNoNestedModes(node); 37 } 38 return ContinueStatus.getInstance(true, true); 39 } 40 41 42 //TODO: temporary addition? 31 43 public ContinueStatus visitWaitStatement(LocationAST node) 32 44 throws TTCN3BehaviorException {
Note: See TracChangeset
for help on using the changeset viewer.