Changeset ca35c51 for src/Parser/ParseNode.h
- Timestamp:
- Jun 30, 2016, 1:47:52 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 1bc1bb2
- Parents:
- 84d4d6f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ParseNode.h
r84d4d6f rca35c51 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jun 27 23:28:10201613 // Update Count : 2 4212 // Last Modified On : Thu Jun 30 11:48:28 2016 13 // Update Count : 252 14 14 // 15 15 … … 126 126 enum Type { Integer, Float, Character, String }; 127 127 128 ConstantNode( Type, std::string* );129 ConstantNode( const ConstantNode &other ) : type( other.type ), btype( other.btype), value( *new std::string( other.value) ) {};130 ~ConstantNode() { delete &value; }128 ConstantNode( ConstantExpr * ); 129 ConstantNode( const ConstantNode &other ) : expr( other.expr->clone() ) {}; 130 ~ConstantNode() { delete expr; } 131 131 132 132 virtual ConstantNode *clone() const { return new ConstantNode( *this ); } 133 Type get_type( void ) const { return type; }134 133 virtual void print( std::ostream &, int indent = 0) const; 135 134 virtual void printOneLine( std::ostream &, int indent = 0) const; 136 135 137 const std::string &get_value() const { return value; }138 136 ConstantNode *appendstr( const std::string *newValue ); 139 137 140 138 Expression *build() const; 141 139 private: 142 Type type; 143 BasicType::Kind btype; 144 std::string &value; 145 }; 140 ConstantExpr *expr; 141 }; 142 143 ConstantNode *makeConstant( ConstantNode::Type, std::string * ); 144 ConstantNode *makeConstantStr( ConstantNode::Type type, std::string *str ); 146 145 147 146 class VarRefNode : public ExpressionNode {
Note: See TracChangeset
for help on using the changeset viewer.