2012-12-17 22:59:16 +00:00
|
|
|
/*
|
|
|
|
* ASTInspector.h
|
|
|
|
*
|
|
|
|
* Created on: Dec 17, 2012
|
|
|
|
* Author: att
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ASTINSPECTOR_H_
|
|
|
|
#define ASTINSPECTOR_H_
|
|
|
|
|
2012-12-17 23:08:50 +00:00
|
|
|
#include <map>
|
2012-12-17 22:59:16 +00:00
|
|
|
#include "Visitor.h"
|
2012-12-17 23:08:50 +00:00
|
|
|
#include "AST/AllTypesOfASTNodes.h"
|
2012-12-17 22:59:16 +00:00
|
|
|
|
|
|
|
class ASTInspector: public Visitor {
|
|
|
|
public:
|
|
|
|
ASTInspector();
|
2012-12-17 23:08:50 +00:00
|
|
|
typedef unsigned int NumberOfNodes;
|
|
|
|
|
|
|
|
std::map<std::string, NumberOfNodes> occurences;
|
|
|
|
|
|
|
|
virtual void visit(ASTNode * node);
|
|
|
|
virtual void visit(ConstantExpression * node);
|
|
|
|
virtual void visit(BasicExpression * node);
|
|
|
|
void visit(PostfixExpression * node);
|
|
|
|
void visit(WhileNode * node);
|
|
|
|
|
2012-12-17 22:59:16 +00:00
|
|
|
virtual ~ASTInspector();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* ASTINSPECTOR_H_ */
|