Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ParseNode.cc

    r59db689 r843054c2  
    1010// Created On       : Sat May 16 13:26:29 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jun  6 20:17:58 2015
    13 // Update Count     : 23
     12// Last Modified On : Tue May 19 16:48:30 2015
     13// Update Count     : 3
    1414//
    1515
     
    2020int ParseNode::indent_by = 4;
    2121
    22 ParseNode::ParseNode() : name( 0 ), next( 0 ) {};
    23 ParseNode::ParseNode( const string *name_ ) : name( name_ ), next( 0 ) {}
     22ParseNode::ParseNode( void ) : next( 0 ) {};
     23ParseNode::ParseNode( string _name ) : name( _name ), next( 0 ) {}
    2424
    25 ParseNode::~ParseNode() {
     25ParseNode *ParseNode::set_name( string _name ) {
     26        name = _name;
     27        return this;
     28}
     29
     30ParseNode *ParseNode::set_name( string *_name ) {
     31        name = *_name; // deep copy
     32        delete _name;
     33
     34        return this;
     35}
     36
     37ParseNode::~ParseNode( void ) {
    2638        delete next;
    2739};
    2840
    29 ParseNode *ParseNode::get_link() const {
     41string ParseNode::get_name( void ) {
     42        return name;
     43}
     44
     45ParseNode *ParseNode::get_link( void ) const {
    3046        return next;
    3147}
    3248
    33 ParseNode *ParseNode::get_last() {
     49ParseNode *ParseNode::get_last(void) {
    3450        ParseNode *current = this;
    3551
     
    4056}
    4157
    42 ParseNode *ParseNode::set_link( ParseNode *next_ ) {
     58ParseNode *ParseNode::set_link(ParseNode *_next) {
    4359        ParseNode *follow;
    4460
    45         if ( next_ == 0 ) return this;
     61        if ( _next == 0 ) return this;
    4662
    4763        for ( follow = this; follow->next != 0; follow = follow->next );
    48         follow->next = next_;
     64        follow->next = _next;
    4965
    5066        return this;
    5167}
    5268
    53 void ParseNode::print( std::ostream &os, int indent ) const {}
     69const string ParseNode::get_name(void) const {
     70        return name;
     71}
     72
     73void ParseNode::print(std::ostream &os, int indent) const {}
    5474
    5575
     
    5878
    5979        if ( next ) {
    60                 next->printList( os, indent );
    61         } // if
     80        next->printList( os, indent );
     81        }
    6282}
    6383
Note: See TracChangeset for help on using the changeset viewer.