Changeset a08ba92 for translator/SynTree


Ignore:
Timestamp:
May 19, 2015, 4:58:14 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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
Message:

licencing: sixth groups of files

Location:
translator/SynTree
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • translator/SynTree/AddressExpr.cc

    r01aeade ra08ba92  
    1010// Created On       : Sun May 17 23:54:44 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 07:48:14 2015
    13 // Update Count     : 5
     12// Last Modified On : Tue May 19 16:52:51 2015
     13// Update Count     : 6
    1414//
    1515
     
    1919
    2020AddressExpr::AddressExpr( Expression *arg, Expression *_aname ) : Expression( _aname ), arg( arg ) {
    21     for ( std::list< Type* >::const_iterator i = arg->get_results().begin(); i != arg->get_results().end(); ++i ) {
     21        for ( std::list< Type* >::const_iterator i = arg->get_results().begin(); i != arg->get_results().end(); ++i ) {
    2222                get_results().push_back( new PointerType( Type::Qualifiers(), (*i)->clone() ) );
    23     } // for
     23        } // for
    2424}
    2525
     
    2828
    2929AddressExpr::~AddressExpr() {
    30     delete arg;
     30        delete arg;
    3131}
    3232
    3333void AddressExpr::print( std::ostream &os, int indent ) const {
    34     os << std::string( indent, ' ' ) << "Address of:" << std::endl;
    35     if ( arg ) {
     34        os << std::string( indent, ' ' ) << "Address of:" << std::endl;
     35        if ( arg ) {
    3636                arg->print( os, indent+2 );
    37     } // if
     37        } // if
    3838}
    3939
  • translator/SynTree/AggregateDecl.cc

    r01aeade ra08ba92  
    1010// Created On       : Sun May 17 23:56:39 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 07:48:23 2015
    13 // Update Count     : 4
     12// Last Modified On : Tue May 19 16:52:08 2015
     13// Update Count     : 5
    1414//
    1515
     
    2323
    2424AggregateDecl::AggregateDecl( const AggregateDecl &other ) : Parent( other ) {
    25     cloneAll( other.members, members );
    26     cloneAll( other.parameters, parameters );
     25        cloneAll( other.members, members );
     26        cloneAll( other.parameters, parameters );
    2727}
    2828
    2929AggregateDecl::~AggregateDecl() {
    30     deleteAll( members );
    31     deleteAll( parameters );
     30        deleteAll( members );
     31        deleteAll( parameters );
    3232}
    3333
    3434void AggregateDecl::print( std::ostream &os, int indent ) const {
    35     using std::string;
    36     using std::endl;
     35        using std::string;
     36        using std::endl;
    3737
    38     os << typeString() << " " << get_name();
    39     if ( ! parameters.empty() ) {
     38        os << typeString() << " " << get_name();
     39        if ( ! parameters.empty() ) {
    4040                os << endl << string( indent+2, ' ' ) << "with parameters" << endl;
    4141                printAll( parameters, os, indent+4 );
    42     } // if
    43     if ( ! members.empty() ) {
     42        } // if
     43        if ( ! members.empty() ) {
    4444                os << endl << string( indent+2, ' ' ) << "with members" << endl;
    4545                printAll( members, os, indent+4 );
    46     } // if
     46        } // if
    4747}
    4848
    4949void AggregateDecl::printShort( std::ostream &os, int indent ) const {
    50     using std::string;
    51     using std::endl;
     50        using std::string;
     51        using std::endl;
    5252
    53     os << typeString() << " " << get_name();
    54     if ( ! parameters.empty() ) {
     53        os << typeString() << " " << get_name();
     54        if ( ! parameters.empty() ) {
    5555                os << endl << string( indent+2, ' ' ) << "with parameters" << endl;
    5656                printAll( parameters, os, indent+4 );
    57     } // if
     57        } // if
    5858}
    5959
  • translator/SynTree/AttrType.cc

    r01aeade ra08ba92  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // XXX.cc --
     7// AttrType.cc.cc --
    88//
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 07:53:48 2015
    13 // Update Count     : 1
     12// Last Modified On : Tue May 19 16:41:51 2015
     13// Update Count     : 2
    1414//
    1515
  • translator/SynTree/CodeGenVisitor.cc

    r01aeade ra08ba92  
    2222using namespace std;
    2323
    24 void CodeGenVisitor::visit( Type *type ){ }
     24void CodeGenVisitor::visit( Type *type ) { }
    2525void CodeGenVisitor::visit( BasicType *basicType ) { }
    2626
     
    2929}
    3030
    31 void CodeGenVisitor::visit( Expression *expr ){ }
     31void CodeGenVisitor::visit( Expression *expr ) { }
    3232
    3333void CodeGenVisitor::visit( ConstantExpr *cnst ) {
  • translator/SynTree/Expression.cc

    r01aeade ra08ba92  
    295295}
    296296
    297 LogicalExpr::~LogicalExpr(){
     297LogicalExpr::~LogicalExpr() {
    298298        delete arg1;
    299299        delete arg2;
  • translator/SynTree/ReferenceToType.cc

    r01aeade ra08ba92  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 10:49:00 2015
    13 // Update Count     : 2
     12// Last Modified On : Tue May 19 16:52:40 2015
     13// Update Count     : 3
    1414//
    1515
     
    2727
    2828ReferenceToType::ReferenceToType( const ReferenceToType &other ) : Type( other ), name( other.name ) {
    29     cloneAll( other.parameters, parameters );
     29        cloneAll( other.parameters, parameters );
    3030}
    3131
    3232ReferenceToType::~ReferenceToType() {
    33     deleteAll( parameters );
     33        deleteAll( parameters );
    3434}
    3535
    3636void ReferenceToType::print( std::ostream &os, int indent ) const {
    37     using std::endl;
    38    
    39     Type::print( os, indent );
    40     os << "instance of " << typeString() << " " << name << " ";
    41     if ( ! parameters.empty() ) {
     37        using std::endl;
     38       
     39        Type::print( os, indent );
     40        os << "instance of " << typeString() << " " << name << " ";
     41        if ( ! parameters.empty() ) {
    4242                os << endl << std::string( indent, ' ' ) << "with parameters" << endl;
    4343                printAll( parameters, os, indent+2 );
    44     } // if
     44        } // if
    4545}
    4646
     
    6060
    6161void StructInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
    62     assert( baseStruct );
    63     doLookup( baseStruct->get_members(), baseStruct->get_parameters(), parameters, name, foundDecls );
     62        assert( baseStruct );
     63        doLookup( baseStruct->get_members(), baseStruct->get_parameters(), parameters, name, foundDecls );
    6464}
    6565
     
    6767
    6868void UnionInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
    69     assert( baseUnion );
    70     doLookup( baseUnion->get_members(), baseUnion->get_parameters(), parameters, name, foundDecls );
     69        assert( baseUnion );
     70        doLookup( baseUnion->get_members(), baseUnion->get_parameters(), parameters, name, foundDecls );
    7171}
    7272
     
    7676
    7777ContextInstType::ContextInstType( const ContextInstType &other ) : Parent( other ) {
    78     cloneAll( other.members, members );
     78        cloneAll( other.members, members );
    7979}
    8080
    8181ContextInstType::~ContextInstType() {
    82     deleteAll( members );
     82        deleteAll( members );
    8383}
    8484
    8585TypeInstType::TypeInstType( const Type::Qualifiers &tq, const std::string &name, TypeDecl *baseType ) : Parent( tq, name ) {
    86     set_baseType( baseType );
     86        set_baseType( baseType );
    8787}
    8888
     
    9191
    9292void TypeInstType::set_baseType( TypeDecl *newValue ) {
    93     baseType = newValue;
    94     isFtype = newValue->get_kind() == TypeDecl::Ftype;
     93        baseType = newValue;
     94        isFtype = newValue->get_kind() == TypeDecl::Ftype;
    9595}
    9696
     
    9898
    9999void TypeInstType::print( std::ostream &os, int indent ) const {
    100     using std::endl;
    101    
    102     Type::print( os, indent );
    103     os << "instance of " << typeString() << " " << get_name() << " (" << ( isFtype ? "" : "not" ) << " a function type) ";
    104     if ( ! parameters.empty() ) {
     100        using std::endl;
     101       
     102        Type::print( os, indent );
     103        os << "instance of " << typeString() << " " << get_name() << " (" << ( isFtype ? "" : "not" ) << " a function type) ";
     104        if ( ! parameters.empty() ) {
    105105                os << endl << std::string( indent, ' ' ) << "with parameters" << endl;
    106106                printAll( parameters, os, indent+2 );
    107     } // if
     107        } // if
    108108}
    109109
  • translator/SynTree/Statement.cc

    r01aeade ra08ba92  
    5858}
    5959
    60 void BranchStmt::print( std::ostream &os, int indent ){
     60void BranchStmt::print( std::ostream &os, int indent ) {
    6161        os << "\r" << string( indent, ' ') << "Branch (" << brType[type] << ")" << endl ;
    6262}
     
    7979IfStmt::~IfStmt() {}
    8080
    81 void IfStmt::print( std::ostream &os, int indent ){
     81void IfStmt::print( std::ostream &os, int indent ) {
    8282        os << "\r" << string( indent, ' ') << "If on condition: " << endl ;
    8383        condition->print( os, indent + 4 );
     
    175175}
    176176
    177 WhileStmt::~WhileStmt(){
     177WhileStmt::~WhileStmt() {
    178178        delete body;
    179179}
    180180
    181 void WhileStmt::print( std::ostream &os, int indent ){
     181void WhileStmt::print( std::ostream &os, int indent ) {
    182182        os << "\r" << string( indent, ' ') << "While on condition: " << endl ;
    183183        condition->print( os, indent + 4 );
     
    199199}
    200200
    201 void ForStmt::print( std::ostream &os, int indent ){
     201void ForStmt::print( std::ostream &os, int indent ) {
    202202        os << "\r" << string( indent, ' ') << "For Statement" << endl ;
    203203
     
    231231}
    232232
    233 TryStmt::~TryStmt(){
     233TryStmt::~TryStmt() {
    234234        delete block;
    235235}
     
    257257}
    258258
    259 CatchStmt::~CatchStmt(){
     259CatchStmt::~CatchStmt() {
    260260        delete decl;
    261261        delete body;
  • translator/SynTree/Type.cc

    r01aeade ra08ba92  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 11:00:29 2015
    13 // Update Count     : 1
     12// Last Modified On : Tue May 19 16:52:27 2015
     13// Update Count     : 2
    1414//
    1515
     
    2121
    2222const char *BasicType::typeNames[BasicType::NUMBER_OF_BASIC_TYPES] = {
    23     "_Bool",
    24     "char",
    25     "char",
    26     "unsigned char",
    27     "short",
    28     "short unsigned",
    29     "int",
    30     "unsigned int",
    31     "long int",
    32     "long unsigned int",
    33     "long long int",
    34     "long long unsigned int",
    35     "float",
    36     "double",
    37     "long double",
    38     "float _Complex",
    39     "double _Complex",
    40     "long double _Complex",
    41     "float _Imaginary",
    42     "double _Imaginary",
    43     "long double _Imaginary",
     23        "_Bool",
     24        "char",
     25        "char",
     26        "unsigned char",
     27        "short",
     28        "short unsigned",
     29        "int",
     30        "unsigned int",
     31        "long int",
     32        "long unsigned int",
     33        "long long int",
     34        "long long unsigned int",
     35        "float",
     36        "double",
     37        "long double",
     38        "float _Complex",
     39        "double _Complex",
     40        "long double _Complex",
     41        "float _Imaginary",
     42        "double _Imaginary",
     43        "long double _Imaginary",
    4444};
    4545
     
    4747
    4848Type::Type( const Type &other ) : tq( other.tq ) {
    49     cloneAll( other.forall, forall );
     49        cloneAll( other.forall, forall );
    5050}
    5151
    5252Type::~Type() {
    53     deleteAll( forall );
     53        deleteAll( forall );
    5454}
    5555
    5656void Type::print( std::ostream &os, int indent ) const {
    57     if ( ! forall.empty() ) {
     57        if ( ! forall.empty() ) {
    5858                os << "forall" << std::endl;
    5959                printAll( forall, os, indent + 4 );
    6060                os << std::string( indent+2, ' ' );
    61     } // if
    62     if ( tq.isConst ) {
     61        } // if
     62        if ( tq.isConst ) {
    6363                os << "const ";
    64     } // if
    65     if ( tq.isVolatile ) {
     64        } // if
     65        if ( tq.isVolatile ) {
    6666                os << "volatile ";
    67     } // if
    68     if ( tq.isRestrict ) {
     67        } // if
     68        if ( tq.isRestrict ) {
    6969                os << "restrict ";
    70     } // if
    71     if ( tq.isLvalue ) {
     70        } // if
     71        if ( tq.isLvalue ) {
    7272                os << "lvalue ";
    73     } // if
    74     if ( tq.isAtomic ) {
     73        } // if
     74        if ( tq.isAtomic ) {
    7575                os << "_Atomic ";
    76     } // if
     76        } // if
    7777}
    7878
  • translator/SynTree/Visitor.cc

    r01aeade ra08ba92  
    111111}
    112112
    113 void Visitor::visit( FallthruStmt *fallthruStmt ){}
     113void Visitor::visit( FallthruStmt *fallthruStmt ) {}
    114114
    115115void Visitor::visit( CaseStmt *caseStmt ) {
Note: See TracChangeset for help on using the changeset viewer.