Changes in / [416cc86:b3f252a]
- 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
r416cc86 rb3f252a 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 } 279 298 280 299 template< typename T > -
src/SynTree/Declaration.h
r416cc86 rb3f252a 155 155 virtual ~FunctionDecl(); 156 156 157 Type * get_type() const ;158 virtual void set_type(Type * );157 Type * get_type() const { return type; } 158 virtual void set_type(Type * t) { type = safe_dynamic_cast< FunctionType* >( t ); } 159 159 160 160 FunctionType * get_functionType() const { return type; } -
src/SynTree/Expression.h
r416cc86 rb3f252a 86 86 public: 87 87 Expression * function; 88 std::list<Expression *> args; 89 InferredParams inferParams; 88 90 89 91 ApplicationExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() ); … … 100 102 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 101 103 virtual void print( std::ostream & os, int indent = 0 ) const; 102 103 private:104 std::list<Expression *> args;105 InferredParams inferParams;106 104 }; 107 105 -
src/SynTree/FunctionDecl.cc
r416cc86 rb3f252a 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 );55 46 } 56 47 -
src/SynTree/Statement.h
r416cc86 rb3f252a 155 155 public: 156 156 Expression * condition; 157 std::list<Statement *> statements; 157 158 158 159 SwitchStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements ); … … 170 171 virtual SwitchStmt *clone() const { return new SwitchStmt( *this ); } 171 172 virtual void print( std::ostream &os, int indent = 0 ) const; 172 private: 173 std::list<Statement *> statements; 173 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.