sencha-lang/Sencha-lang/ASTInspector.h

39 lines
727 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(Visitable * 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_ */