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