Changeset f6e8c67 for src/Parser/DeclarationNode.h
- Timestamp:
- Mar 6, 2024, 6:06:43 AM (23 months ago)
- 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. - File:
-
- 1 edited
-
src/Parser/DeclarationNode.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.h
rbbf2cb1 rf6e8c67 19 19 20 20 struct TypeData; 21 classInitializerNode;22 23 struct DeclarationNode : public ParseNode{21 struct InitializerNode; 22 23 struct DeclarationNode final : public ParseList<DeclarationNode> { 24 24 // These enumerations must harmonize with their names in DeclarationNode.cc. 25 25 enum BasicType { … … 108 108 DeclarationNode * cloneBaseType( DeclarationNode * newdecl, bool = true ); 109 109 110 DeclarationNode * appendList( DeclarationNode * node ) {111 return (DeclarationNode *)set_last( node );112 }113 114 110 virtual void print( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override; 115 111 virtual void printList( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override; … … 129 125 DeclarationNode * set_inLine( bool inL ) { inLine = inL; return this; } 130 126 131 DeclarationNode * get_last() { return (DeclarationNode *)ParseNode::get_last(); }127 const std::string * name = nullptr; 132 128 133 129 struct Variable_t { … … 144 140 }; 145 141 StaticAssert_t assert; 146 147 BuiltinType builtin = NoBuiltinType;148 142 149 143 TypeData * type = nullptr; … … 177 171 } 178 172 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 187 173 // This generic buildList is here along side its overloads. 188 174 template<typename AstType, typename NodeType, … … 193 179 std::back_insert_iterator<Container<ast::ptr<AstType>, Args...>> out( output ); 194 180 195 for ( NodeType * cur = firstNode ; cur ; cur = strict_next( cur )) {181 for ( NodeType * cur = firstNode ; cur ; cur = cur->next ) { 196 182 try { 197 183 AstType * node = dynamic_cast<AstType *>( maybeBuild( cur ) );
Note:
See TracChangeset
for help on using the changeset viewer.