Changeset 724c2b6 for src/SynTree


Ignore:
Timestamp:
Jul 15, 2015, 4:47:48 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
1db21619
Parents:
9163b9c (diff), 1ab4ce2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'resolver'

Location:
src/SynTree
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Mutator.cc

    r9163b9c r724c2b6  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 10:10:46 2015
    13 // Update Count     : 1
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Tue Jul 14 12:31:39 2015
     13// Update Count     : 2
    1414//
    1515
     
    109109
    110110Statement *Mutator::mutate( ForStmt *forStmt ) {
    111         forStmt->set_initialization( maybeMutate( forStmt->get_initialization(), *this ) );
     111        mutateAll( forStmt->get_initialization(), *this );
    112112        forStmt->set_condition( maybeMutate( forStmt->get_condition(), *this ) );
    113113        forStmt->set_increment( maybeMutate( forStmt->get_increment(), *this ) );
  • src/SynTree/Statement.cc

    r9163b9c r724c2b6  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jun 29 17:37:10 2015
    13 // Update Count     : 22
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Wed Jul 15 14:57:40 2015
     13// Update Count     : 27
    1414//
    1515
     
    192192}
    193193
    194 ForStmt::ForStmt( std::list<Label> labels, Statement *initialization_, Expression *condition_, Expression *increment_, Statement *body_ ):
     194ForStmt::ForStmt( std::list<Label> labels, std::list<Statement *> initialization_, Expression *condition_, Expression *increment_, Statement *body_ ):
    195195        Statement( labels ), initialization( initialization_ ), condition( condition_ ), increment( increment_ ), body( body_ ) {
    196196}
    197197
    198198ForStmt::~ForStmt() {
    199         delete initialization;
     199        deleteAll( initialization );
    200200        delete condition;
    201201        delete increment;
     
    213213
    214214        os << string( indent + 2, ' ' ) << "initialization: \n";
    215         if ( initialization != 0 )
    216                 initialization->print( os, indent + 4 );
     215        for ( std::list<Statement *>::const_iterator it = initialization.begin(); it != initialization.end(); ++it ) {
     216                (*it)->print( os, indent + 4 );
     217        }
    217218
    218219        os << "\n" << string( indent + 2, ' ' ) << "condition: \n";
  • src/SynTree/Statement.h

    r9163b9c r724c2b6  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jun 23 11:44:27 2015
    13 // Update Count     : 20
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Tue Jul 14 12:14:54 2015
     13// Update Count     : 24
    1414//
    1515
     
    199199class ForStmt : public Statement {
    200200  public:
    201         ForStmt( std::list<Label> labels, Statement *initialization = 0,
     201        ForStmt( std::list<Label> labels, std::list<Statement *> initialization,
    202202             Expression *condition = 0, Expression *increment = 0, Statement *body = 0 );
    203203        virtual ~ForStmt();
    204204
    205         Statement *get_initialization() { return initialization; }
    206         void set_initialization( Statement *newValue ) { initialization = newValue; }
     205        std::list<Statement *> &get_initialization() { return initialization; }
     206        void set_initialization( std::list<Statement *> newValue ) { initialization = newValue; }
    207207        Expression *get_condition() { return condition; }
    208208        void set_condition( Expression *newValue ) { condition = newValue; }
     
    217217        virtual void print( std::ostream &os, int indent = 0 ) const;
    218218  private:
    219         Statement *initialization;
     219        std::list<Statement *> initialization;
    220220        Expression *condition;
    221221        Expression *increment;
  • src/SynTree/Visitor.cc

    r9163b9c r724c2b6  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 11:14:51 2015
    13 // Update Count     : 2
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Tue Jul 14 12:31:03 2015
     13// Update Count     : 3
    1414//
    1515
     
    9494
    9595void Visitor::visit( ForStmt *forStmt ) {
    96         // ForStmt still needs to be fixed
    97         maybeAccept( forStmt->get_initialization(), *this );
     96        acceptAll( forStmt->get_initialization(), *this );
    9897        maybeAccept( forStmt->get_condition(), *this );
    9998        maybeAccept( forStmt->get_increment(), *this );
Note: See TracChangeset for help on using the changeset viewer.