Changeset 3c398b6 for src/SynTree


Ignore:
Timestamp:
Oct 3, 2017, 2:27:21 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
e1ff775
Parents:
617b4b2
Message:

Fixed visit children to properly work with the indexer

Location:
src/SynTree
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Constant.cc

    r617b4b2 r3c398b6  
    7171}
    7272
    73 void Constant::print( std::ostream &os ) const {
     73void Constant::print( std::ostream &os, int indent ) const {
    7474        os << "(" << rep << " " << val.ival;
    7575        if ( type ) {
  • src/SynTree/Constant.h

    r617b4b2 r3c398b6  
    1919#include <string>     // for string
    2020
     21#include "BaseSyntaxNode.h"
    2122#include "Mutator.h"  // for Mutator
    2223#include "Visitor.h"  // for Visitor
     
    2425class Type;
    2526
    26 class Constant {
     27class Constant : public BaseSyntaxNode {
    2728  public:
    2829        Constant( Type * type, std::string rep, unsigned long long val );
     
    3031        Constant( const Constant & other );
    3132        virtual ~Constant();
     33
     34        virtual Constant * clone() const { return new Constant( *this ); }
    3235
    3336        Type * get_type() { return type; }
     
    5457        virtual void accept( Visitor & v ) { v.visit( this ); }
    5558        virtual Constant * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    56         virtual void print( std::ostream & os ) const;
     59        virtual void print( std::ostream & os, int indent = 0 ) const;
    5760  private:
    5861        Type * type;
Note: See TracChangeset for help on using the changeset viewer.