Changes in src/Parser/ParseNode.cc [843054c2:59db689]
- File:
-
- 1 edited
-
src/Parser/ParseNode.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ParseNode.cc
r843054c2 r59db689 10 10 // Created On : Sat May 16 13:26:29 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue May 19 16:48:30201513 // Update Count : 312 // Last Modified On : Sat Jun 6 20:17:58 2015 13 // Update Count : 23 14 14 // 15 15 … … 20 20 int ParseNode::indent_by = 4; 21 21 22 ParseNode::ParseNode( void ) :next( 0 ) {};23 ParseNode::ParseNode( string _name ) : name( _name), next( 0 ) {}22 ParseNode::ParseNode() : name( 0 ), next( 0 ) {}; 23 ParseNode::ParseNode( const string *name_ ) : name( name_ ), next( 0 ) {} 24 24 25 ParseNode *ParseNode::set_name( string _name ) { 26 name = _name; 27 return this; 28 } 29 30 ParseNode *ParseNode::set_name( string *_name ) { 31 name = *_name; // deep copy 32 delete _name; 33 34 return this; 35 } 36 37 ParseNode::~ParseNode( void ) { 25 ParseNode::~ParseNode() { 38 26 delete next; 39 27 }; 40 28 41 string ParseNode::get_name( void ) { 42 return name; 43 } 44 45 ParseNode *ParseNode::get_link( void ) const { 29 ParseNode *ParseNode::get_link() const { 46 30 return next; 47 31 } 48 32 49 ParseNode *ParseNode::get_last( void) {33 ParseNode *ParseNode::get_last() { 50 34 ParseNode *current = this; 51 35 … … 56 40 } 57 41 58 ParseNode *ParseNode::set_link( ParseNode *_next) {42 ParseNode *ParseNode::set_link( ParseNode *next_ ) { 59 43 ParseNode *follow; 60 44 61 if ( _next== 0 ) return this;45 if ( next_ == 0 ) return this; 62 46 63 47 for ( follow = this; follow->next != 0; follow = follow->next ); 64 follow->next = _next;48 follow->next = next_; 65 49 66 50 return this; 67 51 } 68 52 69 const string ParseNode::get_name(void) const { 70 return name; 71 } 72 73 void ParseNode::print(std::ostream &os, int indent) const {} 53 void ParseNode::print( std::ostream &os, int indent ) const {} 74 54 75 55 … … 78 58 79 59 if ( next ) { 80 next->printList( os, indent );81 } 60 next->printList( os, indent ); 61 } // if 82 62 } 83 63
Note:
See TracChangeset
for help on using the changeset viewer.