Ignore:
Timestamp:
Mar 22, 2016, 9:57:47 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, 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, resolv-new, string, with_gc
Children:
94980502
Parents:
a752883
Message:

only implicitly generate typedef for structures if name not in use and overwrite typedef name if explicit name appears, upate parser symbol table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TypedefTable.h

    ra752883 r984dce6  
    1010// Created On       : Sat May 16 15:24:36 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar  2 17:26:54 2016
    13 // Update Count     : 12
     12// Last Modified On : Mon Mar 21 18:17:36 2016
     13// Update Count     : 24
    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 {
     
    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;
    59 
     58        bool exists( const std::string &identifier );
     59        int isKind( const std::string &identifier ) const;
    6060        void changeKind( const std::string &identifier, kind_t kind );
    6161       
Note: See TracChangeset for help on using the changeset viewer.