Changeset a08ba92 for translator/Designators/Processor.h
- Timestamp:
- May 19, 2015, 4:58:14 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 843054c2
- Parents:
- 01aeade
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/Designators/Processor.h
r01aeade ra08ba92 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // XXX.cc--7 // Processor.h -- 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : 12 // Last Modified On : 13 // Update Count : 011 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue May 19 16:24:34 2015 13 // Update Count : 3 14 14 // 15 15 16 #include "SynTree/Declaration.h" 16 17 #include "SynTree/Expression.h" … … 24 25 25 26 namespace Designators { 26 27 27 class Matcher; 28 class GenSym; 28 29 29 30 31 32 33 34 30 template < class OutputIterator > bool extractNames( std::list< DeclarationWithType * > &, OutputIterator ); 31 template < class OutputIterator > bool extractNames( Expression *, OutputIterator, Matcher ); 32 void check_alternative( FunctionType *, ResolvExpr::AltList & ); 33 ObjectDecl *extractTupleV( Matcher, TupleExpr *names ); 34 bool fixDesignations( ResolvExpr::AlternativeFinder &finder, Expression *designation ); 35 DeclarationWithType *gensym( GenSym &, DeclarationWithType * ); 35 36 36 37 public:38 39 37 class GenSym { 38 public: 39 GenSym( std::string prefix = "" ) : gensym_count(0) {} 40 GenSym( GenSym &other ) { gensym_count = other.gensym_count; } 40 41 41 42 // std::string get_symbol() { } 42 private:43 44 45 43 private: 44 std::string prefix; 45 int gensym_count; 46 }; 46 47 47 48 49 public:50 48 // template< typename Key > 49 class Matcher { 50 public: 51 typedef std::vector< std::string >::iterator iterator; 51 52 52 53 53 Matcher( const std::list< DeclarationWithType * > & ); 54 ~Matcher() {} 54 55 55 56 57 58 56 template< class OutputIterator > bool get_reorderedCall( OutputIterator ); 57 template< class InputIterator > bool add(InputIterator, InputIterator, ResolvExpr::Alternative &); 58 template< class InputIterator, class OutputIterator > bool slice(InputIterator begin, InputIterator end, OutputIterator ); 59 //std::vector<std::string> &get_order() const { return order; } 59 60 60 61 61 iterator begin() { return order.begin(); } 62 iterator end() { return order.end(); } 62 63 63 //Expression *operator[]( int idx ) { return table( order[ idx ] ); } 64 private: 65 std::map< std::string, int > table; 66 std::vector<std::string> order; 67 std::vector<DeclarationWithType *> declarations; 68 std::vector<ResolvExpr::Alternative *> alternatives; 69 }; 70 // void pruneAlternatives( Expression *expr, ResolvExpr::AlternativeFinder & ); 71 64 //Expression *operator[]( int idx ) { return table( order[ idx ] ); } 65 private: 66 std::map< std::string, int > table; 67 std::vector<std::string> order; 68 std::vector<DeclarationWithType *> declarations; 69 std::vector<ResolvExpr::Alternative *> alternatives; 70 }; 71 // void pruneAlternatives( Expression *expr, ResolvExpr::AlternativeFinder & ); 72 72 } // namespace Designators 73 73 74 /*75 Local Variables:76 mode: c++77 End:78 */79 74 // Local Variables: // 80 75 // tab-width: 4 //
Note: See TracChangeset
for help on using the changeset viewer.