Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ParseNode.cc

    r99cad3aa re82aa9df  
    1010// Created On       : Sat May 16 13:26:29 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 17 23:14:16 2016
    13 // Update Count     : 126
     12// Last Modified On : Mon Aug 15 14:49:06 2016
     13// Update Count     : 99
    1414//
    1515
     
    1717using namespace std;
    1818
     19// Builder
    1920int ParseNode::indent_by = 4;
     21
     22ParseNode::ParseNode() : next( 0 ) {};
     23ParseNode::ParseNode( const string *name ) : name( *name ), next( 0 ) { delete name; }
     24ParseNode::ParseNode( const string &name ) : name( name ), next( 0 ) { }
     25
     26ParseNode::~ParseNode() {
     27        delete next;
     28};
     29
     30ParseNode *ParseNode::get_last() {
     31        ParseNode *current = this;
     32
     33        while ( current->get_next() != 0 )
     34        current = current->get_next();
     35        return current;
     36}
     37
     38ParseNode *ParseNode::set_last( ParseNode *next_ ) {
     39        if ( next_ != 0 ) get_last()->next = next_;
     40        return this;
     41}
     42
     43void ParseNode::print( std::ostream &os, int indent ) const {}
     44
     45
     46void ParseNode::printList( std::ostream &os, int indent ) const {
     47        print( os, indent );
     48
     49        if ( next ) {
     50                next->printList( os, indent );
     51        } // if
     52}
    2053
    2154// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.