Changeset 47498bd for src/SynTree


Ignore:
Timestamp:
Jun 19, 2018, 2:11:38 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
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, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
9a7a3b6
Parents:
704d11e
Message:

Add nodes for global scope type

Location:
src/SynTree
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Mutator.h

    r704d11e r47498bd  
    114114        virtual Type * mutate( ZeroType * zeroType ) = 0;
    115115        virtual Type * mutate( OneType * oneType ) = 0;
     116        virtual Type * mutate( GlobalScopeType * globalType ) = 0;
    116117
    117118        virtual Designation * mutate( Designation * designation ) = 0 ;
  • src/SynTree/SynTree.h

    r704d11e r47498bd  
    124124class ZeroType;
    125125class OneType;
     126class GlobalScopeType;
    126127
    127128class Designation;
  • src/SynTree/Type.cc

    r704d11e r47498bd  
    118118
    119119void QualifiedType::print( std::ostream & os, Indenter indent ) const {
    120         os << "Qualified Type: ";
     120        os << "Qualified Type: " << endl;
    121121        printAll( types, os, indent+1 );
    122122        Type::print( os, indent+1 );
     123}
     124
     125GlobalScopeType::GlobalScopeType() : Type( Type::Qualifiers(), {} ) {}
     126
     127void GlobalScopeType::print( std::ostream & os, Indenter indent ) const {
     128        os << "Global Scope Type" << endl;
    123129}
    124130
  • src/SynTree/Type.h

    r704d11e r47498bd  
    679679};
    680680
     681class GlobalScopeType : public Type {
     682  public:
     683        GlobalScopeType();
     684
     685        virtual GlobalScopeType *clone() const override { return new GlobalScopeType( *this ); }
     686        virtual void accept( Visitor & v ) override { v.visit( this ); }
     687        virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
     688        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     689};
     690
    681691// Local Variables: //
    682692// tab-width: 4 //
  • src/SynTree/Visitor.h

    r704d11e r47498bd  
    116116        virtual void visit( ZeroType * zeroType ) = 0;
    117117        virtual void visit( OneType * oneType ) = 0;
     118        virtual void visit( GlobalScopeType * globalType ) = 0;
    118119
    119120        virtual void visit( Designation * designation ) = 0;
Note: See TracChangeset for help on using the changeset viewer.