Inferno
0.2
|
00001 #ifndef VALIDATE_HPP 00002 #define VALIDATE_HPP 00003 00004 #include "helpers/walk.hpp" 00005 #include "helpers/transformation.hpp" 00006 00007 class Validate : public InPlaceTransformation 00008 { 00009 public: 00010 Validate( bool p=false ) : 00011 is_pattern(p) 00012 { 00013 } 00014 00015 virtual void operator()( TreePtr<Node> context, 00016 TreePtr<Node> *proot ); 00017 private: 00018 void OnLink( TreePtr<Node> p, TreePtr<Node> c ); 00019 00020 bool is_pattern; 00021 Map< TreePtr<Node>, unsigned > decl_refs; 00022 Map< TreePtr<Node>, unsigned > total_refs; 00023 }; 00024 00025 // TODO 00026 // - All expressions to be TypeOf()-able 00027 00028 #endif