Ignore:
Timestamp:
Dec 16, 2014, 9:41:50 PM (10 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:
17cd4eb
Parents:
3848e0e
Message:

remove Parser.old, add -XCFA to driver, copy ptrdiff_t from stddef.h in preclude, remove casts from initialization constants, adjust formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/SynTree/Initializer.h

    r3848e0e rd9a0e76  
    1 /*
    2  * This file is part of the Cforall project
    3  *
    4  * $Id: Initializer.h,v 1.14 2005/08/29 20:59:25 rcbilson Exp $
    5  *
    6  */
    7 
    81#ifndef INITIALIZER_H
    92#define INITIALIZER_H
     
    1710
    1811// Initializer: base class for object initializers (provide default values)
    19 class Initializer
    20 {
    21 public:
     12class Initializer {
     13  public:
    2214    //  Initializer( std::string _name = std::string(""), int _pos = 0 );
    2315    Initializer( );
     
    4133    virtual Initializer *acceptMutator( Mutator &m ) = 0;
    4234    virtual void print( std::ostream &os, int indent = 0 );
    43    
    44 private:
     35  private:
    4536    //  std::string name;
    4637    //  int pos;
     
    4839
    4940// SingleInit represents an initializer for a common object (e.g., int x = 4)
    50 class SingleInit : public Initializer
    51 {
    52 public:
     41class SingleInit : public Initializer {
     42  public:
    5343    SingleInit( Expression *value, std::list< Expression *> &designators );
    5444    SingleInit( const SingleInit &other );
     
    6555    virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    6656    virtual void print( std::ostream &os, int indent = 0 );
    67    
    68 private:
     57  private:
    6958    //Constant *value;
    7059    Expression *value;  // has to be a compile-time constant
     
    7261};
    7362
    74 // MemberInit represents an initializer for a member of an aggregate object
    75 // (e.g., struct q { int a } x = { a: 4 } )
    76 class MemberInit : public Initializer
    77 {
    78 public:
     63// MemberInit represents an initializer for a member of an aggregate object (e.g., struct q { int a; } x = { a : 4 } )
     64class MemberInit : public Initializer {
     65  public:
    7966    MemberInit( Expression *value, std::string member = std::string("") );
    8067    virtual ~MemberInit();
     
    8976    virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    9077    virtual void print( std::ostream &os, int indent = 0 );
    91    
    92 private:
     78  private:
    9379    std::string member;
    9480    Expression *value;
    9581};
    9682
    97 // ElementInit represents an initializer of an element of an array
    98 // (e.g., [10] int x = { [7]: 4 }
    99 class ElementInit : public Initializer
    100 {
    101 public:
     83// ElementInit represents an initializer of an element of an array (e.g., [10] int x = { [7] : 4 }
     84class ElementInit : public Initializer {
     85  public:
    10286    ElementInit( Expression *value );
    10387    virtual ~ElementInit();
     
    11296    virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    11397    virtual void print( std::ostream &os, int indent = 0 );
    114    
    115 private:
     98  private:
    11699    int index;
    117100    Expression *value;
    118101};
    119102
    120 // ListInit represents an initializer that is composed recursively of a list of initializers; this
    121 // is used to initialize an array or aggregate
    122 class ListInit : public Initializer
    123 {
    124 public:
     103// ListInit represents an initializer that is composed recursively of a list of initializers; this is used to initialize
     104// an array or aggregate
     105class ListInit : public Initializer {
     106  public:
    125107    ListInit( std::list<Initializer*> &,
    126             std::list<Expression *> &designators = *(new std::list<Expression *>()) );
     108              std::list<Expression *> &designators = *(new std::list<Expression *>()) );
    127109    virtual ~ListInit();
    128110
     
    139121    virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    140122    virtual void print( std::ostream &os, int indent = 0 );
    141    
    142 private:
     123  private:
    143124    std::list<Initializer*> initializers;  // order *is* important
    144125    std::list<Expression *> designators;
    145126};
    146127
    147 
    148 #endif /* #ifndef INITIALIZER_H */
    149 
    150 /*
    151     Local Variables:
    152     mode: c++
    153     End:
    154 */
     128#endif // INITIALIZER_H
Note: See TracChangeset for help on using the changeset viewer.