Changes in src/Parser/DeclarationNode.h [af60383:4eb3a7c5]
- File:
-
- 1 edited
-
src/Parser/DeclarationNode.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.h
raf60383 r4eb3a7c5 19 19 20 20 struct TypeData; 21 structInitializerNode;22 23 struct DeclarationNode final : public ParseList<DeclarationNode>{21 class InitializerNode; 22 23 struct DeclarationNode : public ParseNode { 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 110 114 virtual void print( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override; 111 115 virtual void printList( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override; … … 125 129 DeclarationNode * set_inLine( bool inL ) { inLine = inL; return this; } 126 130 127 const std::string * name = nullptr;131 DeclarationNode * get_last() { return (DeclarationNode *)ParseNode::get_last(); } 128 132 129 133 struct Variable_t { … … 140 144 }; 141 145 StaticAssert_t assert; 146 147 BuiltinType builtin = NoBuiltinType; 142 148 143 149 TypeData * type = nullptr; … … 171 177 } 172 178 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 173 187 // This generic buildList is here along side its overloads. 174 188 template<typename AstType, typename NodeType, … … 179 193 std::back_insert_iterator<Container<ast::ptr<AstType>, Args...>> out( output ); 180 194 181 for ( NodeType * cur = firstNode ; cur ; cur = cur->next) {195 for ( NodeType * cur = firstNode ; cur ; cur = strict_next( cur ) ) { 182 196 try { 183 197 AstType * node = dynamic_cast<AstType *>( maybeBuild( cur ) );
Note:
See TracChangeset
for help on using the changeset viewer.