Ignore:
Timestamp:
Mar 6, 2024, 6:06:43 AM (23 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
647d633
Parents:
bbf2cb1 (diff), af60383 (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' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.h

    rbbf2cb1 rf6e8c67  
    1919
    2020struct TypeData;
    21 class InitializerNode;
    22 
    23 struct DeclarationNode : public ParseNode {
     21struct InitializerNode;
     22
     23struct DeclarationNode final : public ParseList<DeclarationNode> {
    2424        // These enumerations must harmonize with their names in DeclarationNode.cc.
    2525        enum BasicType {
     
    108108        DeclarationNode * cloneBaseType( DeclarationNode * newdecl, bool = true );
    109109
    110         DeclarationNode * appendList( DeclarationNode * node ) {
    111                 return (DeclarationNode *)set_last( node );
    112         }
    113 
    114110        virtual void print( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override;
    115111        virtual void printList( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override;
     
    129125        DeclarationNode * set_inLine( bool inL ) { inLine = inL; return this; }
    130126
    131         DeclarationNode * get_last() { return (DeclarationNode *)ParseNode::get_last(); }
     127        const std::string * name = nullptr;
    132128
    133129        struct Variable_t {
     
    144140        };
    145141        StaticAssert_t assert;
    146 
    147         BuiltinType builtin = NoBuiltinType;
    148142
    149143        TypeData * type = nullptr;
     
    177171}
    178172
    179 template<typename NodeType>
    180 NodeType * strict_next( NodeType * node ) {
    181         ParseNode * next = node->get_next();
    182         if ( nullptr == next ) return nullptr;
    183         if ( NodeType * ret = dynamic_cast<NodeType *>( next ) ) return ret;
    184         SemanticError( next->location, "internal error, non-homogeneous nodes founds in buildList processing." );
    185 }
    186 
    187173// This generic buildList is here along side its overloads.
    188174template<typename AstType, typename NodeType,
     
    193179        std::back_insert_iterator<Container<ast::ptr<AstType>, Args...>> out( output );
    194180
    195         for ( NodeType * cur = firstNode ; cur ; cur = strict_next( cur ) ) {
     181        for ( NodeType * cur = firstNode ; cur ; cur = cur->next ) {
    196182                try {
    197183                        AstType * node = dynamic_cast<AstType *>( maybeBuild( cur ) );
Note: See TracChangeset for help on using the changeset viewer.