Ignore:
Timestamp:
May 19, 2015, 4:58:14 PM (11 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
843054c2
Parents:
01aeade
Message:

licencing: sixth groups of files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/SymTab/StackTable.cc

    r01aeade ra08ba92  
    1010// Created On       : Sun May 17 21:45:15 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun May 17 21:46:59 2015
    13 // Update Count     : 2
     12// Last Modified On : Tue May 19 16:51:53 2015
     13// Update Count     : 3
    1414//
    1515
     
    1919
    2020namespace SymTab {
    21     template< typename Element, typename ConflictFunction >
    22     StackTable< Element, ConflictFunction >::StackTable() : scopeLevel( 0 ) {
     21        template< typename Element, typename ConflictFunction >
     22        StackTable< Element, ConflictFunction >::StackTable() : scopeLevel( 0 ) {
    2323        }
    2424
    25     template< typename Element, typename ConflictFunction >
    26     void StackTable< Element, ConflictFunction >::enterScope() {
     25        template< typename Element, typename ConflictFunction >
     26        void StackTable< Element, ConflictFunction >::enterScope() {
    2727                scopeLevel++;
    28     }
     28        }
    2929
    30     template< typename Element, typename ConflictFunction >
    31     void StackTable< Element, ConflictFunction >::leaveScope() {
     30        template< typename Element, typename ConflictFunction >
     31        void StackTable< Element, ConflictFunction >::leaveScope() {
    3232                for ( typename TableType::iterator it = table.begin(); it != table.end(); ++it ) {
    3333                        std::stack< Entry >& entry = it->second;
     
    3838                scopeLevel--;
    3939                assert( scopeLevel >= 0 );
    40     }
     40        }
    4141
    42     template< typename Element, typename ConflictFunction >
    43     void StackTable< Element, ConflictFunction >::add( Element *type ) {
     42        template< typename Element, typename ConflictFunction >
     43        void StackTable< Element, ConflictFunction >::add( Element *type ) {
    4444                std::stack< Entry >& entry = table[ type->get_name() ];
    4545                if ( ! entry.empty() && entry.top().second == scopeLevel ) {
     
    4848                        entry.push( Entry( type, scopeLevel ) );
    4949                } // if
    50     }
     50        }
    5151
    52     template< typename Element, typename ConflictFunction >
    53     void StackTable< Element, ConflictFunction >::add( std::string fwdDeclName ) {
     52        template< typename Element, typename ConflictFunction >
     53        void StackTable< Element, ConflictFunction >::add( std::string fwdDeclName ) {
    5454                add( new Element( fwdDeclName ) );
    55     }
     55        }
    5656
    57     template< typename Element, typename ConflictFunction >
    58     Element *StackTable< Element, ConflictFunction >::lookup( std::string id ) const {
     57        template< typename Element, typename ConflictFunction >
     58        Element *StackTable< Element, ConflictFunction >::lookup( std::string id ) const {
    5959                typename TableType::const_iterator it = table.find( id );
    6060                if ( it == table.end() ) {
     
    6565                        return 0;
    6666                } // if
    67     }
     67        }
    6868
    69     template< typename Element, typename ConflictFunction >
    70     void StackTable< Element, ConflictFunction >::dump( std::ostream &os ) const {
     69        template< typename Element, typename ConflictFunction >
     70        void StackTable< Element, ConflictFunction >::dump( std::ostream &os ) const {
    7171                for ( typename TableType::const_iterator it = table.begin(); it != table.end(); ++it ) {
    7272                        const std::stack< Entry >& entry = it->second;
     
    7575                        } // if
    7676                } // for
    77     }
     77        }
    7878} // namespace SymTab
    7979
Note: See TracChangeset for help on using the changeset viewer.