// Boost Statechart Viewer is free software: you can redistribute it and/or modify
// This file is part of Boost Statechart Viewer.
//
// Boost Statechart Viewer is free software: you can redistribute it and/or modify
@@ -86,8+86,8 @@ class MyDiagnosticClient : public TextDiagnosticPrinter
case 0 : nignored+=1; break;
case 1 : nnotes+=1; break;
case 2 : nwarnings+=1; break;
case 0 : nignored+=1; break;
case 1 : nnotes+=1; break;
case 2 : nwarnings+=1; break;
- default : nerrors+=1;
- print_stats();
+ default : nerrors+=1;
+ print_stats();
exit(1);
}
}
exit(1);
}
}
@@ -102,20+102,20 @@ class MyDiagnosticClient : public TextDiagnosticPrinter
cout<<"Number of warnings: "<<nwarnings<<"\n";
cout<<"Number of errors and fatal errors: "<<nerrors<<"\n";
}
cout<<"Number of warnings: "<<nwarnings<<"\n";
cout<<"Number of errors and fatal errors: "<<nerrors<<"\n";
}
-
+
int getNbrOfWarnings() /** Return number of warnings */
{
int getNbrOfWarnings() /** Return number of warnings */
{
- return nwarnings;
+ return nwarnings;
}
}
-
+
int getNbrOfNotes() /** Return number of notes */
{
int getNbrOfNotes() /** Return number of notes */
{
- return nnotes;
+ return nnotes;
}
int getNbrOfIgnored() /** Return number of ignored */
{
}
int getNbrOfIgnored() /** Return number of ignored */
{
- return nignored;
+ return nignored;
}
};
}
};
@@ -124,7+124,7 @@ class MyDiagnosticClient : public TextDiagnosticPrinter
*/
class FindStates : public ASTConsumer
{
*/
class FindStates : public ASTConsumer
{
- list<string> transitions;
+ list<string> transitions;
list<string> cReactions; /** list of custom reactions. After all files are traversed this list should be empty. */
list<string> events;
list<string> states;
list<string> cReactions; /** list of custom reactions. After all files are traversed this list should be empty. */
list<string> events;
list<string> states;
@@ -140,12+140,12 @@ class FindStates : public ASTConsumer
{
return states;
}
{
return states;
}
-
+
list<string> getTransitions() /** Return list of transitions. */
{
return transitions;
}
list<string> getTransitions() /** Return list of transitions. */
{
return transitions;
}
-
+
list<string> getEvents() /** Return list of events. */
{
return events;
list<string> getEvents() /** Return list of events. */
{
return events;
@@ -160,9+160,9 @@ class FindStates : public ASTConsumer
{
return name_of_start;
}
{
return name_of_start;
}
-
+
virtual void Initialize(ASTContext &ctx)/** Run after the AST is constructed before the consumer starts to work. So this function works like constructor. */
virtual void Initialize(ASTContext &ctx)/** Run after the AST is constructed before the consumer starts to work. So this function works like constructor. */
- {
+ {
fsloc = new FullSourceLoc(* new SourceLocation(), ctx.getSourceManager());
name_of_start = "";
name_of_machine = "";
fsloc = new FullSourceLoc(* new SourceLocation(), ctx.getSourceManager());
name_of_start = "";
name_of_machine = "";
@@ -177,29+177,29 @@ class FindStates : public ASTConsumer
SourceLocation loc;
string line, output, event;
llvm::raw_string_ostream x(output);
SourceLocation loc;
string line, output, event;
llvm::raw_string_ostream x(output);
- for (DeclGroupRef::iterator i = DGR.begin(), e = DGR.end(); i != e; ++i)
+ for (DeclGroupRef::iterator i = DGR.begin(), e = DGR.end(); i != e; ++i)
{
const Decl *decl = *i;
loc = decl->getLocation();
if(loc.isValid())
{
if(decl->getKind()==35)
{
const Decl *decl = *i;
loc = decl->getLocation();
if(loc.isValid())
{
if(decl->getKind()==35)
- {
+ {
method_decl(decl);
}
if (const TagDecl *tagDecl = dyn_cast<TagDecl>(decl))
{
method_decl(decl);
}
if (const TagDecl *tagDecl = dyn_cast<TagDecl>(decl))
{
- if(tagDecl->isStruct() || tagDecl->isClass()) //is it a struct or class
+ if(tagDecl->isStruct() || tagDecl->isClass()) //is it a struct or class