Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    rd0d9610 rbaf7fee  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Sep 02 12:07:10 2015
    13 // Update Count     : 33
     12// Last Modified On : Wed Dec 09 14:10:29 2015
     13// Update Count     : 34
    1414//
    1515
     
    122122void SizeofExpr::print( std::ostream &os, int indent) const {
    123123        os << std::string( indent, ' ' ) << "Sizeof Expression on: ";
     124
     125        if (isType)
     126                type->print(os, indent + 2);
     127        else
     128                expr->print(os, indent + 2);
     129
     130        os << std::endl;
     131        Expression::print( os, indent );
     132}
     133
     134AlignofExpr::AlignofExpr( Expression *expr_, Expression *_aname ) :
     135                Expression( _aname ), expr(expr_), type(0), isType(false) {
     136        add_result( new BasicType( Type::Qualifiers(), BasicType::UnsignedInt ) );
     137}
     138
     139AlignofExpr::AlignofExpr( Type *type_, Expression *_aname ) :
     140                Expression( _aname ), expr(0), type(type_), isType(true) {
     141        add_result( new BasicType( Type::Qualifiers(), BasicType::UnsignedInt ) );
     142}
     143
     144AlignofExpr::AlignofExpr( const AlignofExpr &other ) :
     145        Expression( other ), expr( maybeClone( other.expr ) ), type( maybeClone( other.type ) ), isType( other.isType ) {
     146}
     147
     148AlignofExpr::~AlignofExpr() {
     149        delete expr;
     150        delete type;
     151}
     152
     153void AlignofExpr::print( std::ostream &os, int indent) const {
     154        os << std::string( indent, ' ' ) << "Alignof Expression on: ";
    124155
    125156        if (isType)
     
    345376}
    346377
     378std::ostream & operator<<( std::ostream & out, Expression * expr ) {
     379        expr->print( out );
     380        return out;
     381}
     382
    347383// Local Variables: //
    348384// tab-width: 4 //
Note: See TracChangeset for help on using the changeset viewer.