Ignore:
Timestamp:
Nov 15, 2014, 10:46:42 PM (9 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:
1ead581
Parents:
8c17ab0
Message:

reformat files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/Parser/TypedefTable.h

    r8c17ab0 rc8ffe20b  
    1 /*
    2  * This file is part of the Cforall project
    3  *
    4  * $Id: TypedefTable.h,v 1.5 2003/05/11 15:24:05 rcbilson Exp $
    5  *
    6  */
    7 
    81#ifndef TYPEDEFTABLE_H
    92#define TYPEDEFTABLE_H
     
    147#include <stack>
    158
    16 class TypedefTable
    17 {
     9class TypedefTable {
    1810  public:
    1911    enum kind_t { ID, TD, TG };
    2012  private:
    21     struct Entry
    22     {
     13    struct Entry {
    2314        int scope;
    2415        kind_t kind;
    2516    };
    2617   
    27     struct DeferredEntry
    28     {
    29       std::string identifier;
    30       kind_t kind;
     18    struct DeferredEntry {
     19        std::string identifier;
     20        kind_t kind;
    3121    };
    3222
     
    4434    std::stack< std::string > nextIdentifiers;
    4535
    46     bool isKind(std::string identifier, kind_t kind) const;
    47     void addToScope(const std::string &identifier, kind_t kind, int scope);
     36    bool isKind( std::string identifier, kind_t kind ) const;
     37    void addToScope( const std::string &identifier, kind_t kind, int scope );
    4838  public:
    4939    TypedefTable();
    5040
    51     bool isIdentifier(std::string identifier) const;
    52     bool isTypedef(std::string identifier) const;
    53     bool isTypegen(std::string identifier) const;
     41    bool isIdentifier( std::string identifier ) const;
     42    bool isTypedef( std::string identifier ) const;
     43    bool isTypegen( std::string identifier ) const;
    5444   
    55     // "addToCurrentScope" adds the identifier/type pair to the current scope This does less
    56     // than you think it does, since each declaration is within its own scope.  Mostly useful for
    57     // type parameters.
    58     void addToCurrentScope(const std::string &identifier, kind_t kind);
    59     void addToCurrentScope(kind_t kind);   // use nextIdentifiers.top()
     45    // "addToCurrentScope" adds the identifier/type pair to the current scope This does less than you think it does,
     46    // since each declaration is within its own scope.  Mostly useful for type parameters.
     47    void addToCurrentScope( const std::string &identifier, kind_t kind );
     48    void addToCurrentScope( kind_t kind );              // use nextIdentifiers.top()
    6049
    61     // "addToEnclosingScope" adds the identifier/type pair to the scope that encloses the current
    62     // one.  This is the right way to handle type and typedef names
    63     void addToEnclosingScope(const std::string &identifier, kind_t kind);
    64     void addToEnclosingScope(kind_t kind); // use nextIdentifiers.top()
     50    // "addToEnclosingScope" adds the identifier/type pair to the scope that encloses the current one.  This is the
     51    // right way to handle type and typedef names
     52    void addToEnclosingScope( const std::string &identifier, kind_t kind );
     53    void addToEnclosingScope( kind_t kind );            // use nextIdentifiers.top()
    6554   
    66     // "addToEnclosingScope2" adds the identifier/type pair to the scope that encloses the scope
    67     // enclosing the the current one.  This is the right way to handle assertion names
    68     void addToEnclosingScope2(const std::string &identifier, kind_t kind);
    69     void addToEnclosingScope2(kind_t kind); // use nextIdentifiers.top()
     55    // "addToEnclosingScope2" adds the identifier/type pair to the scope that encloses the scope enclosing the the
     56    // current one.  This is the right way to handle assertion names
     57    void addToEnclosingScope2( const std::string &identifier, kind_t kind );
     58    void addToEnclosingScope2( kind_t kind );           // use nextIdentifiers.top()
    7059   
    71     // set the next identifier to be used by an "add" operation without an identifier parameter
    72     // within the current scope
     60    // set the next identifier to be used by an "add" operation without an identifier parameter within the current scope
    7361    void setNextIdentifier( const std::string &identifier );
    7462   
     
    7664    void openContext( std::string contextName );
    7765   
    78     void enterScope(void);
    79     void leaveScope(void);
     66    void enterScope( void );
     67    void leaveScope( void );
    8068    void enterContext( std::string contextName );
    81     void leaveContext(void);
     69    void leaveContext( void );
    8270
    83     void print(void) const;
     71    void print( void ) const;
    8472};
    8573
    86 #endif /* ifndef TYPEDEFTABLE_H */
     74#endif // TYPEDEFTABLE_H
Note: See TracChangeset for help on using the changeset viewer.