Changes in src/Parser/ParseNode.h [ca35c51:7305915]
- File:
-
- 1 edited
-
src/Parser/ParseNode.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ParseNode.h
rca35c51 r7305915 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 30 11:48:28201613 // Update Count : 2 5212 // Last Modified On : Mon Jun 27 23:28:10 2016 13 // Update Count : 242 14 14 // 15 15 … … 28 28 //#include "SynTree/Declaration.h" 29 29 #include "Common/UniqueName.h" 30 #include "SynTree/Label.h"31 30 32 31 class ExpressionNode; … … 126 125 enum Type { Integer, Float, Character, String }; 127 126 128 ConstantNode( ConstantExpr* );129 ConstantNode( const ConstantNode &other ) : expr( other.expr->clone() ) {};130 ~ConstantNode() { delete expr; }127 ConstantNode( Type, std::string * ); 128 ConstantNode( const ConstantNode &other ) : type( other.type ), btype( other.btype), value( *new std::string( other.value ) ) {}; 129 ~ConstantNode() { delete &value; } 131 130 132 131 virtual ConstantNode *clone() const { return new ConstantNode( *this ); } 132 Type get_type( void ) const { return type; } 133 133 virtual void print( std::ostream &, int indent = 0) const; 134 134 virtual void printOneLine( std::ostream &, int indent = 0) const; 135 135 136 const std::string &get_value() const { return value; } 136 137 ConstantNode *appendstr( const std::string *newValue ); 137 138 138 139 Expression *build() const; 139 140 private: 140 ConstantExpr *expr; 141 }; 142 143 ConstantNode *makeConstant( ConstantNode::Type, std::string * ); 144 ConstantNode *makeConstantStr( ConstantNode::Type type, std::string *str ); 141 Type type; 142 BasicType::Kind btype; 143 std::string &value; 144 }; 145 145 146 146 class VarRefNode : public ExpressionNode { … … 284 284 virtual void printOneLine( std::ostream &, int indent = 0) const; 285 285 286 const std::list< Label> &get_labels() const { return labels; };286 const std::list< std::string > &get_labels() const { return labels; }; 287 287 void append_label( std::string *label ) { labels.push_back( *label ); delete label; } 288 288 private: 289 std::list< Label> labels;289 std::list< std::string > labels; 290 290 }; 291 291 … … 532 532 ExpressionNode *output, *input; 533 533 ConstantNode *clobber; 534 std::list< Label> gotolabels;534 std::list<std::string> gotolabels; 535 535 }; 536 536
Note:
See TracChangeset
for help on using the changeset viewer.