Changeset 20a5977 for src/AST/Expr.hpp


Ignore:
Timestamp:
May 23, 2019, 4:22:55 PM (3 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
arm-eh, cleanup-dtors, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
af1e8f56
Parents:
68c9165
Message:

Added kind to ConstantExpr? and some Expr prints

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.hpp

    r68c9165 r20a5977  
    337337public:
    338338        std::string rep;
     339        enum Kind { Integer, FloatingPoint, String } kind;
    339340
    340341        ConstantExpr(
    341                 const CodeLocation & loc, const Type * ty, const std::string & r, unsigned long long v )
    342         : Expr( loc, ty ), val( v ), rep( r ) {}
     342                const CodeLocation & loc, const Type * ty, const std::string & r, unsigned long long v,
     343                Kind k = Integer )
     344        : Expr( loc, ty ), val( v ), rep( r ), kind( k ) {}
    343345        ConstantExpr( const CodeLocation & loc, const Type * ty, const std::string & r, double v )
    344         : Expr( loc, ty ), val( v ), rep( r ) {}
     346        : Expr( loc, ty ), val( v ), rep( r ), kind( FloatingPoint ) {}
    345347
    346348        /// Gets the value of this constant as an integer
Note: See TracChangeset for help on using the changeset viewer.