- Timestamp:
- 08/06/10 16:40:42 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/t3e-tools/t3q/src/org/etsi/t3q/visitor/QualityChecker.java
r12 r16 2458 2458 } 2459 2459 2460 2461 //TODO: temporary duplicate of the above 2462 //- above needs refactoring 2463 //- this needs to be separated in a realtime checker 2464 public void checkWaitStatementPrecededByLog(LocationAST node) { 2465 // TODO: no more function statement or defs 2466 // TODO: fixed issue with statement blocks 2467 2468 // Fixed: currently based on SetLocalVerdict node, 2469 // consider starting at the fail or inconc node instead, checking 2470 // whether it is 2471 // within a set verdict context and proceed from there 2472 // fix: it is specific to the set verdict and not to inconc or fail 2473 // alone 2474 2475 boolean problemOccured = false; 2476 LocationAST parentNode = LocationAST.resolveParentsUntilType(node, 2477 new int[] { TTCN3ParserTokenTypes.FunctionStatement }); 2478 if (parentNode == null) { 2479 this.getLoggingInterface().logFix(node.getLine(), 2480 node.getEndLine(), 2481 MessageClass.LOGGING, 2482 "Cannot resolve the parent node", 2483 "5.4, " + MiscTools.getMethodName()); 2484 return; 2485 } 2486 2487 int functionStatementOrDefsVisitedCount = visitor.getFunctionStatementOrDefNodes() 2488 .size(); 2489 if (parentNode == visitor.getFunctionStatementOrDefNodes() 2490 .get(functionStatementOrDefsVisitedCount - 1)) { 2491 2492 int i = functionStatementOrDefsVisitedCount - 2; 2493 if (i >= 0) { 2494 LocationAST next = null; 2495 // skip semicolons 2496 next = visitor.getFunctionStatementOrDefNodes() 2497 .get(i) 2498 .getNextSibling(); 2499 2500 while ((next != null) 2501 && (next.getType() == TTCN3ParserTokenTypes.SemiColon)) { 2502 next = next.getNextSibling(); 2503 } 2504 2505 if (next == parentNode) { 2506 LocationAST resultNode = (LocationAST) ASTUtil.findChild(visitor.getFunctionStatementOrDefNodes() 2507 .get(i), 2508 TTCN3ParserTokenTypes.LogStatement); 2509 if (resultNode == null) { 2510 problemOccured = true; 2511 } 2512 } else { 2513 problemOccured = true; 2514 } 2515 } else { 2516 problemOccured = true; 2517 } 2518 } 2519 2520 if (problemOccured) { 2521 this.getLoggingInterface() 2522 .logWarning(node.getLine(), 2523 node.getEndLine(), 2524 MessageClass.LOGGING, 2525 "No log statement precedes a wait statement!", 2526 "RT.X.X, " + MiscTools.getMethodName()); 2527 } 2528 } 2529 2460 2530 // ------------------------------------------------------------------------------------------- 2461 2531
Note: See TracChangeset
for help on using the changeset viewer.