Ignore:
Timestamp:
Apr 15, 2016, 12:03:11 PM (9 years ago)
Author:
Thierry Delisle <tdelisle@…>
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, with_gc
Children:
29ad0ac
Parents:
c5833e8 (diff), 37f0da8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into gc_noraii

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TypedefTable.h

    rc5833e8 r0f9e4403  
    1010// Created On       : Sat May 16 15:24:36 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun 25 22:52:15 2015
    13 // Update Count     : 11
     12// Last Modified On : Wed Apr 13 16:59:56 2016
     13// Update Count     : 27
    1414//
    1515
     
    2222#include <stack>
    2323
     24#include "lex.h"
     25#include "parser.h"
     26
    2427class TypedefTable {
    2528  public:
    26         enum kind_t { ID, TD, TG };
     29        enum kind_t { ID = IDENTIFIER, TD = TYPEDEFname, TG = TYPEGENname };
    2730  private:
    2831        struct Entry {
     
    4043
    4144        int currentScope;
    42         std::string currentContext;
     45        std::string currentTrait;
    4346        int contextScope;
    4447       
     
    4952        std::stack< std::string > nextIdentifiers;
    5053
    51         bool isKind( const std::string &identifier, kind_t kind ) const;
    5254        void addToScope( const std::string &identifier, kind_t kind, int scope );
    5355  public:
    5456        TypedefTable();
    5557
    56         bool isIdentifier( const std::string &identifier ) const;
    57         bool isTypedef( const std::string &identifier ) const;
    58         bool isTypegen( const std::string &identifier ) const;
     58        bool exists( const std::string &identifier );
     59        int isKind( const std::string &identifier ) const;
     60        void changeKind( const std::string &identifier, kind_t kind );
    5961
    60         void changeKind( const std::string &identifier, kind_t kind );
    61        
     62        void makeTypedef( const std::string &name );
     63
    6264        // "addToCurrentScope" adds the identifier/type pair to the current scope. This does less than you think it does,
    6365        // since each declaration is within its own scope.  Mostly useful for type parameters.
     
    7981       
    8082        // dump the definitions from a pre-defined context into the current scope
    81         void openContext( const std::string &contextName );
     83        void openTrait( const std::string &contextName );
    8284       
    8385        void enterScope();
    8486        void leaveScope();
    85         void enterContext( const std::string &contextName );
    86         void leaveContext();
     87        void enterTrait( const std::string &contextName );
     88        void leaveTrait();
    8789
    8890        void print() const;
Note: See TracChangeset for help on using the changeset viewer.