]> rtime.felk.cvut.cz Git - boost-statechart-viewer.git/blobdiff - src/visualizer.cpp
Event typedef missing
[boost-statechart-viewer.git] / src / visualizer.cpp
index 22db6669590d4a9225eba2dc9c9d0625831c3309..8a39b55442b21eb4623ec761942c4f4d84e28768 100644 (file)
@@ -407,6 +407,7 @@ public:
 
     void handleSimpleState(CXXRecordDecl *RecordDecl, const CXXBaseSpecifier *Base)
     {
+       int typedef_num = 0;
        string name(RecordDecl->getName()); //getQualifiedNameAsString());
        Diag(RecordDecl->getLocStart(), diag_found_state) << name;
 
@@ -446,7 +447,14 @@ public:
        // TODO: Find when state has no reactions
        for (DeclContext::lookup_result Reactions = RecordDecl->lookup(DeclarationName(&II));
             Reactions.first != Reactions.second; ++Reactions.first)
-           HandleReaction(*Reactions.first, RecordDecl);
+       {           
+               HandleReaction(*Reactions.first, RecordDecl);
+               typedef_num++;
+       }
+       if(typedef_num == 0) {
+               Diag(RecordDecl->getLocStart(), diag_warning)
+                   << " missing typedef for reactions in state : " << RecordDecl->getName();
+       }
     }
 
     void handleStateMachine(CXXRecordDecl *RecordDecl, const CXXBaseSpecifier *Base)