Changeset 396ee0a for src/SynTree


Ignore:
Timestamp:
Feb 22, 2017, 2:42:11 PM (9 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, stuck-waitfor-destruct, with_gc
Children:
131dbb3, 692de479
Parents:
0788b739 (diff), fc39193 (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 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src/SynTree
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    r0788b739 r396ee0a  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  9 14:27:08 2017
    13 // Update Count     : 56
     12// Last Modified On : Thu Feb 16 14:53:35 2017
     13// Update Count     : 57
    1414//
    1515
     
    1717#define DECLARATION_H
    1818
     19#include <string>
     20
     21#include "BaseSyntaxNode.h"
     22#include "Mutator.h"
     23#include "Visitor.h"
    1924#include "SynTree.h"
    20 #include "Visitor.h"
    21 #include "Mutator.h"
    2225#include "Parser/LinkageSpec.h"
    2326#include "Parser/ParseNode.h"
    24 #include <string>
    25 
    26 class Declaration {
     27
     28class Declaration : public BaseSyntaxNode {
    2729  public:
    2830        Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage );
     
    138140        CompoundStmt *get_statements() const { return statements; }
    139141        void set_statements( CompoundStmt *newValue ) { statements = newValue; }
    140         std::list< std::string >& get_oldIdents() { return oldIdents; }
    141         std::list< Declaration* >& get_oldDecls() { return oldDecls; }
    142142
    143143        virtual FunctionDecl *clone() const { return new FunctionDecl( *this ); }
     
    149149        FunctionType *type;
    150150        CompoundStmt *statements;
    151         std::list< std::string > oldIdents;
    152         std::list< Declaration* > oldDecls;
    153151};
    154152
  • src/SynTree/Expression.h

    r0788b739 r396ee0a  
    1919#include <map>
    2020#include <memory>
     21
     22#include "BaseSyntaxNode.h"
     23#include "Constant.h"
     24#include "Mutator.h"
    2125#include "SynTree.h"
    2226#include "Visitor.h"
    23 #include "Mutator.h"
    24 #include "Constant.h"
    2527#include "Common/UniqueName.h"
    2628
    2729/// Expression is the root type for all expressions
    28 class Expression {
     30class Expression : public BaseSyntaxNode{
    2931  public:
    3032        Expression( Expression * _aname = nullptr );
  • src/SynTree/FunctionDecl.cc

    r0788b739 r396ee0a  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Oct  1 23:06:32 2016
    13 // Update Count     : 21
     12// Last Modified On : Thu Feb 16 15:01:52 2017
     13// Update Count     : 23
    1414//
    1515
     
    4444        delete type;
    4545        delete statements;
    46         deleteAll( oldDecls );
    4746}
    4847
     
    8483        } // if
    8584
    86         if ( ! oldIdents.empty() ) {
    87                 os << string( indent + 2, ' ' ) << "with parameter names" << endl;
    88                 for ( std::list< std::string >::const_iterator i = oldIdents.begin(); i != oldIdents.end(); ++i ) {
    89                         os << string( indent + 4, ' ' ) << *i << endl;
    90                 } // for
    91         } // if
    92 
    93         if ( ! oldDecls.empty() ) {
    94                 os << string( indent + 2, ' ' ) << "with parameter declarations" << endl;
    95                 printAll( oldDecls, os, indent + 4 );
    96         } // if
    9785        if ( statements ) {
    9886                os << string( indent + 2, ' ' ) << "with body " << endl;
  • src/SynTree/Initializer.h

    r0788b739 r396ee0a  
    1717#define INITIALIZER_H
    1818
     19#include <cassert>
     20
     21#include "BaseSyntaxNode.h"
     22#include "Mutator.h"
    1923#include "SynTree.h"
     24#include "Type.h"
    2025#include "Visitor.h"
    21 #include "Mutator.h"
    22 #include "Type.h"
    23 
    24 #include <cassert>
    2526
    2627const std::list<Expression*> noDesignators;
    2728
    2829// Initializer: base class for object initializers (provide default values)
    29 class Initializer {
     30class Initializer : public BaseSyntaxNode {
    3031  public:
    3132        //      Initializer( std::string _name = std::string(""), int _pos = 0 );
  • src/SynTree/Mutator.cc

    r0788b739 r396ee0a  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  9 14:22:56 2017
    13 // Update Count     : 20
     12// Last Modified On : Thu Feb 16 15:02:23 2017
     13// Update Count     : 21
    1414//
    1515
     
    3838DeclarationWithType *Mutator::mutate( FunctionDecl *functionDecl ) {
    3939        functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) );
    40         mutateAll( functionDecl->get_oldDecls(), *this );
    4140        functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) );
    4241        return functionDecl;
  • src/SynTree/Mutator.h

    r0788b739 r396ee0a  
    139139                        } // if
    140140                } catch( SemanticError &e ) {
     141                        e.set_location( (*i)->location );
    141142                        errors.append( e );
    142143                } // try
  • src/SynTree/Statement.h

    r0788b739 r396ee0a  
    1717#define STATEMENT_H
    1818
     19#include "BaseSyntaxNode.h"
     20#include "Label.h"
     21#include "Mutator.h"
    1922#include "SynTree.h"
     23#include "Type.h"
    2024#include "Visitor.h"
    21 #include "Mutator.h"
    2225#include "Common/SemanticError.h"
    23 #include "Type.h"
    24 #include "Label.h"
    25 
    26 class Statement {
     26
     27class Statement : public BaseSyntaxNode {
    2728  public:
    2829        Statement( std::list<Label> labels );
  • src/SynTree/Type.h

    r0788b739 r396ee0a  
    1717#define TYPE_H
    1818
     19#include "BaseSyntaxNode.h"
     20#include "Mutator.h"
    1921#include "SynTree.h"
    2022#include "Visitor.h"
    21 #include "Mutator.h"
    2223#include "Common/utility.h"
    2324
    24 class Type {
     25class Type : public BaseSyntaxNode {
    2526  public:
    2627        struct Qualifiers {
  • src/SynTree/Visitor.cc

    r0788b739 r396ee0a  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  9 14:19:22 2017
    13 // Update Count     : 22
     12// Last Modified On : Thu Feb 16 15:01:25 2017
     13// Update Count     : 23
    1414//
    1515
     
    3535void Visitor::visit( FunctionDecl *functionDecl ) {
    3636        maybeAccept( functionDecl->get_functionType(), *this );
    37         acceptAll( functionDecl->get_oldDecls(), *this );
    3837        maybeAccept( functionDecl->get_statements(), *this );
    3938}
  • src/SynTree/Visitor.h

    r0788b739 r396ee0a  
    133133                        }
    134134                } catch( SemanticError &e ) {
     135                        e.set_location( (*i)->location );
    135136                        errors.append( e );
    136137                }
     
    159160                        } // if
    160161                } catch( SemanticError &e ) {
     162                        e.set_location( (*i)->location );                       
    161163                        errors.append( e );
    162164                } // try
Note: See TracChangeset for help on using the changeset viewer.