39 lines
725 B
C++
39 lines
725 B
C++
/*
|
|
* ASTInspector.h
|
|
*
|
|
* Created on: Dec 17, 2012
|
|
* Author: att
|
|
*/
|
|
|
|
#ifndef ASTINSPECTOR_H_
|
|
#define ASTINSPECTOR_H_
|
|
|
|
#include <map>
|
|
#include "Visitor.h"
|
|
#include "AST/AllTypesOfASTNodes.h"
|
|
|
|
class ASTInspector: public Visitor {
|
|
public:
|
|
ASTInspector();
|
|
typedef unsigned int NumberOfNodes;
|
|
|
|
std::map<std::string, NumberOfNodes> occurences;
|
|
|
|
std::string inspection_report;
|
|
|
|
unsigned int depth_level;
|
|
|
|
void visit(ASTNode * node);
|
|
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_ */
|