Changes in / [b3f252a:416cc86]
- Location:
- src
- Files:
-
- 5 edited
-
Common/utility.h (modified) (1 diff)
-
SynTree/Declaration.h (modified) (1 diff)
-
SynTree/Expression.h (modified) (2 diffs)
-
SynTree/FunctionDecl.cc (modified) (1 diff)
-
SynTree/Statement.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Common/utility.h
rb3f252a r416cc86 277 277 ~ValueGuardPtr() { if( ref ) *ref = old; } 278 278 }; 279 280 template< typename aT >281 struct FuncGuard {282 aT m_after;283 284 template< typename bT >285 FuncGuard( bT before, aT after ) : m_after( after ) {286 before();287 }288 289 ~FuncGuard() {290 m_after();291 }292 };293 294 template< typename bT, typename aT >295 FuncGuard<aT> makeFuncGuard( bT && before, aT && after ) {296 return FuncGuard<aT>( std::forward<bT>(before), std::forward<aT>(after) );297 }298 279 299 280 template< typename T > -
src/SynTree/Declaration.h
rb3f252a r416cc86 155 155 virtual ~FunctionDecl(); 156 156 157 Type * get_type() const { return type; }158 virtual void set_type(Type * t) { type = safe_dynamic_cast< FunctionType* >( t ); }157 Type * get_type() const; 158 virtual void set_type(Type *); 159 159 160 160 FunctionType * get_functionType() const { return type; } -
src/SynTree/Expression.h
rb3f252a r416cc86 86 86 public: 87 87 Expression * function; 88 std::list<Expression *> args;89 InferredParams inferParams;90 88 91 89 ApplicationExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() ); … … 102 100 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 103 101 virtual void print( std::ostream & os, int indent = 0 ) const; 102 103 private: 104 std::list<Expression *> args; 105 InferredParams inferParams; 104 106 }; 105 107 -
src/SynTree/FunctionDecl.cc
rb3f252a r416cc86 44 44 delete type; 45 45 delete statements; 46 } 47 48 Type * FunctionDecl::get_type() const { 49 return type; 50 } 51 52 void FunctionDecl::set_type( Type *t ) { 53 type = dynamic_cast< FunctionType* >( t ); 54 assert( type ); 46 55 } 47 56 -
src/SynTree/Statement.h
rb3f252a r416cc86 155 155 public: 156 156 Expression * condition; 157 std::list<Statement *> statements;158 157 159 158 SwitchStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements ); … … 171 170 virtual SwitchStmt *clone() const { return new SwitchStmt( *this ); } 172 171 virtual void print( std::ostream &os, int indent = 0 ) const; 173 172 private: 173 std::list<Statement *> statements; 174 174 }; 175 175 … … 327 327 class TryStmt : public Statement { 328 328 public: 329 CompoundStmt * block;329 CompoundStmt *block; 330 330 std::list<CatchStmt *> handlers; 331 FinallyStmt * finallyBlock;331 FinallyStmt *finallyBlock; 332 332 333 333 TryStmt( std::list<Label> labels, CompoundStmt *tryBlock, std::list<CatchStmt *> &handlers, FinallyStmt *finallyBlock = 0 );
Note:
See TracChangeset
for help on using the changeset viewer.