summaryrefslogtreecommitdiffstats
path: root/Sencha-lang/ASTInspector.h
diff options
context:
space:
mode:
authorJustyna Ilczuk <justyna.ilczuk@gmail.com>2012-12-21 16:16:39 +0100
committerJustyna Ilczuk <justyna.ilczuk@gmail.com>2012-12-21 16:16:39 +0100
commit7ac6ae1c224f8ba04e6769f8dbf6fba6881bcaf7 (patch)
tree6d3ee26bae7dc308d807233f8c5cf8443855833b /Sencha-lang/ASTInspector.h
parent736458f1fd5508b48602feae215749d2db73ebc5 (diff)
downloadsencha-lang-7ac6ae1c224f8ba04e6769f8dbf6fba6881bcaf7.tar.gz
sencha-lang-7ac6ae1c224f8ba04e6769f8dbf6fba6881bcaf7.tar.bz2
sencha-lang-7ac6ae1c224f8ba04e6769f8dbf6fba6881bcaf7.tar.xz
sencha-lang-7ac6ae1c224f8ba04e6769f8dbf6fba6881bcaf7.zip
Inspector can inspect ASTElements, as for now, only basic expressions
and constant expressions :).
Diffstat (limited to 'Sencha-lang/ASTInspector.h')
-rw-r--r--Sencha-lang/ASTInspector.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/Sencha-lang/ASTInspector.h b/Sencha-lang/ASTInspector.h
index c11db14..92052fd 100644
--- a/Sencha-lang/ASTInspector.h
+++ b/Sencha-lang/ASTInspector.h
@@ -15,24 +15,26 @@
class ASTInspector: public Visitor {
public:
ASTInspector();
- typedef unsigned int NumberOfNodes;
+ unsigned int how_many_visits() { return number_of_visits; }
+ unsigned int how_many_occurences_of(std::string type);
+ std::string get_report() { return this->inspection_report; }
+ void visit(Visitable * node);
+ virtual ~ASTInspector();
+ void forget_everything();
+private:
+ unsigned int number_of_visits;
+ typedef unsigned int NumberOfNodes;
std::map<std::string, NumberOfNodes> occurences;
-
std::string inspection_report;
-
unsigned int depth_level;
-
- void visit(Visitable * node);
+ std::string compute_indent();
+ void write_report(std::string visit_notes);
void visit(ConstantExpression * node);
void visit(BasicExpression * node);
void visit(PostfixExpression * node);
void visit(WhileNode * node);
- std::string compute_indent();
- void write_report(std::string visit_notes);
-
- virtual ~ASTInspector();
};
#endif /* ASTINSPECTOR_H_ */