Changeset bb7422a for src/Parser/ParseNode.h
- Timestamp:
- Apr 4, 2023, 2:25:52 PM (13 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- beeff61e, e02e13f
- Parents:
- 4541b09
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ParseNode.h
r4541b09 rbb7422a 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 13:28:16 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Wed Mar 29 08:40:27202313 // Update Count : 94 811 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Apr 3 17:55:00 2023 13 // Update Count : 942 14 14 // 15 15 … … 24 24 #include <string> // for string 25 25 26 #include "AST/Expr.hpp" // for Expr, NameExpr LogicalFlag 27 #include "AST/Fwd.hpp" // for ptr, Decl, DeclWithType, 28 #include "AST/Stmt.hpp" // for Stmt 26 29 #include "Common/CodeLocation.h" // for CodeLocation 27 30 #include "Common/SemanticError.h" // for SemanticError 28 31 #include "Common/UniqueName.h" // for UniqueName 29 32 #include "Common/utility.h" // for maybeClone 30 #include "Parser/parserutility.h" // for maybeBuild 31 #include "SynTree/LinkageSpec.h" // for Spec 32 #include "SynTree/Declaration.h" // for Aggregate 33 #include "SynTree/Expression.h" // for Expression, ConstantExpr (ptr only) 34 #include "SynTree/Label.h" // for Label 35 #include "SynTree/Statement.h" // for Statement, BranchStmt, BranchStmt:... 36 #include "SynTree/Type.h" // for Type, Type::FuncSpecifiers, Type::... 33 #include "Parser/parserutility.h" // for maybeBuild, maybeCopy 37 34 38 35 class Attribute; … … 108 105 void printOneLine( std::ostream & ) const; 109 106 110 virtual Initializer* build() const;107 virtual ast::Init * build() const; 111 108 private: 112 109 ExpressionNode * expr; … … 122 119 class ExpressionNode final : public ParseNode { 123 120 public: 124 ExpressionNode( Expression* expr = nullptr ) : expr( expr ) {}121 ExpressionNode( ast::Expr * expr = nullptr ) : expr( expr ) {} 125 122 virtual ~ExpressionNode() {} 126 virtual ExpressionNode * clone() const override { return expr ? static_cast<ExpressionNode*>((new ExpressionNode( expr->clone() ))->set_next( maybeClone( get_next() ) )) : nullptr; } 123 virtual ExpressionNode * clone() const override { 124 if ( nullptr == expr ) return nullptr; 125 return static_cast<ExpressionNode*>( 126 (new ExpressionNode( ast::shallowCopy( expr.get() ) ))->set_next( maybeCopy( get_next() ) )); 127 } 127 128 128 129 bool get_extension() const { return extension; } … … 137 138 bool isExpressionType() const { return nullptr != dynamic_cast<T>(expr.get()); } 138 139 139 Expression* build() const {140 Expression* node = const_cast<ExpressionNode *>(this)->expr.release();140 ast::Expr * build() const { 141 ast::Expr * node = const_cast<ExpressionNode *>(this)->expr.release(); 141 142 node->set_extension( this->get_extension() ); 142 143 node->location = this->location; … … 144 145 } 145 146 146 std::unique_ptr<Expression> expr; // public because of lifetime implications 147 // Public because of lifetime implications (what lifetime implications?) 148 std::unique_ptr<ast::Expr> expr; 147 149 private: 148 150 bool extension = false; … … 164 166 165 167 struct LabelNode { 166 std:: list< Label> labels;168 std::vector<ast::Label> labels; 167 169 }; 168 170 169 Expression * build_constantInteger( std::string & str ); // these 4 routines modify the string 170 Expression * build_constantFloat( std::string & str ); 171 Expression * build_constantChar( std::string & str ); 172 Expression * build_constantStr( std::string & str ); 173 Expression * build_field_name_FLOATING_FRACTIONconstant( const std::string & str ); 174 Expression * build_field_name_FLOATING_DECIMALconstant( const std::string & str ); 175 Expression * build_field_name_FLOATINGconstant( const std::string & str ); 176 Expression * build_field_name_fraction_constants( Expression * fieldName, ExpressionNode * fracts ); 177 178 NameExpr * build_varref( const std::string * name ); 179 QualifiedNameExpr * build_qualified_expr( const DeclarationNode * decl_node, const NameExpr * name ); 180 QualifiedNameExpr * build_qualified_expr( const EnumDecl * decl, const NameExpr * name ); 181 DimensionExpr * build_dimensionref( const std::string * name ); 182 183 Expression * build_cast( DeclarationNode * decl_node, ExpressionNode * expr_node ); 184 Expression * build_keyword_cast( AggregateDecl::Aggregate target, ExpressionNode * expr_node ); 185 Expression * build_virtual_cast( DeclarationNode * decl_node, ExpressionNode * expr_node ); 186 Expression * build_fieldSel( ExpressionNode * expr_node, Expression * member ); 187 Expression * build_pfieldSel( ExpressionNode * expr_node, Expression * member ); 188 Expression * build_offsetOf( DeclarationNode * decl_node, NameExpr * member ); 189 Expression * build_and( ExpressionNode * expr_node1, ExpressionNode * expr_node2 ); 190 Expression * build_and_or( ExpressionNode * expr_node1, ExpressionNode * expr_node2, bool kind ); 191 Expression * build_unary_val( OperKinds op, ExpressionNode * expr_node ); 192 Expression * build_binary_val( OperKinds op, ExpressionNode * expr_node1, ExpressionNode * expr_node2 ); 193 Expression * build_binary_ptr( OperKinds op, ExpressionNode * expr_node1, ExpressionNode * expr_node2 ); 194 Expression * build_cond( ExpressionNode * expr_node1, ExpressionNode * expr_node2, ExpressionNode * expr_node3 ); 195 Expression * build_tuple( ExpressionNode * expr_node = nullptr ); 196 Expression * build_func( ExpressionNode * function, ExpressionNode * expr_node ); 197 Expression * build_compoundLiteral( DeclarationNode * decl_node, InitializerNode * kids ); 171 // These 4 routines modify the string: 172 ast::Expr * build_constantInteger( const CodeLocation &, std::string & ); 173 ast::Expr * build_constantFloat( const CodeLocation &, std::string & ); 174 ast::Expr * build_constantChar( const CodeLocation &, std::string & ); 175 ast::Expr * build_constantStr( const CodeLocation &, std::string & ); 176 ast::Expr * build_field_name_FLOATING_FRACTIONconstant( const CodeLocation &, const std::string & str ); 177 ast::Expr * build_field_name_FLOATING_DECIMALconstant( const CodeLocation &, const std::string & str ); 178 ast::Expr * build_field_name_FLOATINGconstant( const CodeLocation &, const std::string & str ); 179 ast::Expr * build_field_name_fraction_constants( const CodeLocation &, ast::Expr * fieldName, ExpressionNode * fracts ); 180 181 ast::NameExpr * build_varref( const CodeLocation &, const std::string * name ); 182 ast::QualifiedNameExpr * build_qualified_expr( const CodeLocation &, const DeclarationNode * decl_node, const ast::NameExpr * name ); 183 ast::QualifiedNameExpr * build_qualified_expr( const CodeLocation &, const ast::EnumDecl * decl, const ast::NameExpr * name ); 184 ast::DimensionExpr * build_dimensionref( const CodeLocation &, const std::string * name ); 185 186 ast::Expr * build_cast( const CodeLocation &, DeclarationNode * decl_node, ExpressionNode * expr_node ); 187 ast::Expr * build_keyword_cast( const CodeLocation &, ast::AggregateDecl::Aggregate target, ExpressionNode * expr_node ); 188 ast::Expr * build_virtual_cast( const CodeLocation &, DeclarationNode * decl_node, ExpressionNode * expr_node ); 189 ast::Expr * build_fieldSel( const CodeLocation &, ExpressionNode * expr_node, ast::Expr * member ); 190 ast::Expr * build_pfieldSel( const CodeLocation &, ExpressionNode * expr_node, ast::Expr * member ); 191 ast::Expr * build_offsetOf( const CodeLocation &, DeclarationNode * decl_node, ast::NameExpr * member ); 192 ast::Expr * build_and( const CodeLocation &, ExpressionNode * expr_node1, ExpressionNode * expr_node2 ); 193 ast::Expr * build_and_or( const CodeLocation &, ExpressionNode * expr_node1, ExpressionNode * expr_node2, ast::LogicalFlag flag ); 194 ast::Expr * build_unary_val( const CodeLocation &, OperKinds op, ExpressionNode * expr_node ); 195 ast::Expr * build_binary_val( const CodeLocation &, OperKinds op, ExpressionNode * expr_node1, ExpressionNode * expr_node2 ); 196 ast::Expr * build_binary_ptr( const CodeLocation &, OperKinds op, ExpressionNode * expr_node1, ExpressionNode * expr_node2 ); 197 ast::Expr * build_cond( const CodeLocation &, ExpressionNode * expr_node1, ExpressionNode * expr_node2, ExpressionNode * expr_node3 ); 198 ast::Expr * build_tuple( const CodeLocation &, ExpressionNode * expr_node = nullptr ); 199 ast::Expr * build_func( const CodeLocation &, ExpressionNode * function, ExpressionNode * expr_node ); 200 ast::Expr * build_compoundLiteral( const CodeLocation &, DeclarationNode * decl_node, InitializerNode * kids ); 198 201 199 202 //############################################################################## … … 219 222 static const char * builtinTypeNames[]; 220 223 221 static DeclarationNode * newStorageClass( Type::StorageClasses );222 static DeclarationNode * newFuncSpecifier( Type::FuncSpecifiers );223 static DeclarationNode * newTypeQualifier( Type::Qualifiers );224 static DeclarationNode * newStorageClass( ast::Storage::Classes ); 225 static DeclarationNode * newFuncSpecifier( ast::Function::Specs ); 226 static DeclarationNode * newTypeQualifier( ast::CV::Qualifiers ); 224 227 static DeclarationNode * newBasicType( BasicType ); 225 228 static DeclarationNode * newComplexType( ComplexType ); … … 232 235 static DeclarationNode * newQualifiedType( DeclarationNode *, DeclarationNode * ); 233 236 static DeclarationNode * newFunction( const std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body ); 234 static DeclarationNode * newAggregate( AggregateDecl::Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body );237 static DeclarationNode * newAggregate( ast::AggregateDecl::Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ); 235 238 static DeclarationNode * newEnum( const std::string * name, DeclarationNode * constants, bool body, bool typed, DeclarationNode * base = nullptr, EnumHiding hiding = EnumHiding::Visible ); 236 239 static DeclarationNode * newEnumConstant( const std::string * name, ExpressionNode * constant ); … … 239 242 static DeclarationNode * newName( const std::string * ); 240 243 static DeclarationNode * newFromTypeGen( const std::string *, ExpressionNode * params ); 241 static DeclarationNode * newTypeParam( TypeDecl::Kind, const std::string * );244 static DeclarationNode * newTypeParam( ast::TypeDecl::Kind, const std::string * ); 242 245 static DeclarationNode * newTrait( const std::string * name, DeclarationNode * params, DeclarationNode * asserts ); 243 246 static DeclarationNode * newTraitUse( const std::string * name, ExpressionNode * params ); … … 253 256 static DeclarationNode * newDirectiveStmt( StatementNode * stmt ); // gcc external directive statement 254 257 static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement 255 static DeclarationNode * newStaticAssert( ExpressionNode * condition, Expression* message );258 static DeclarationNode * newStaticAssert( ExpressionNode * condition, ast::Expr * message ); 256 259 257 260 DeclarationNode(); … … 294 297 virtual void printList( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override; 295 298 296 Declaration* build() const;297 Type * buildType() const;298 299 LinkageSpec::Spec get_linkage() const { return linkage; }299 ast::Decl * build() const; 300 ast::Type * buildType() const; 301 302 ast::Linkage::Spec get_linkage() const { return linkage; } 300 303 DeclarationNode * extractAggregate() const; 301 304 bool has_enumeratorValue() const { return (bool)enumeratorValue; } … … 312 315 struct Variable_t { 313 316 // const std::string * name; 314 TypeDecl::Kind tyClass;317 ast::TypeDecl::Kind tyClass; 315 318 DeclarationNode * assertions; 316 319 DeclarationNode * initializer; … … 320 323 struct StaticAssert_t { 321 324 ExpressionNode * condition; 322 Expression* message;325 ast::Expr * message; 323 326 }; 324 327 StaticAssert_t assert; … … 330 333 bool inLine = false; 331 334 bool enumInLine = false; 332 Type::FuncSpecifiers funcSpecs;333 Type::StorageClasses storageClasses;335 ast::Function::Specs funcSpecs; 336 ast::Storage::Classes storageClasses; 334 337 335 338 ExpressionNode * bitfieldWidth = nullptr; 336 339 std::unique_ptr<ExpressionNode> enumeratorValue; 337 340 bool hasEllipsis = false; 338 LinkageSpec::Spec linkage;339 Expression* asmName = nullptr;340 std:: list< Attribute *> attributes;341 ast::Linkage::Spec linkage; 342 ast::Expr * asmName = nullptr; 343 std::vector<ast::ptr<ast::Attribute>> attributes; 341 344 InitializerNode * initializer = nullptr; 342 345 bool extension = false; … … 348 351 }; // DeclarationNode 349 352 350 Type * buildType( TypeData * type );351 352 static inline Type * maybeMoveBuildType( const DeclarationNode * orig ) {353 Type * ret = orig ? orig->buildType() : nullptr;353 ast::Type * buildType( TypeData * type ); 354 355 static inline ast::Type * maybeMoveBuildType( const DeclarationNode * orig ) { 356 ast::Type * ret = orig ? orig->buildType() : nullptr; 354 357 delete orig; 355 358 return ret; … … 359 362 360 363 struct StatementNode final : public ParseNode { 361 StatementNode() { stmt = nullptr; } 362 StatementNode( Statement * stmt ) : stmt( stmt ) {} 364 StatementNode() : 365 stmt( nullptr ), clause( nullptr ) {} 366 StatementNode( ast::Stmt * stmt ) : 367 stmt( stmt ), clause( nullptr ) {} 368 StatementNode( ast::StmtClause * clause ) : 369 stmt( nullptr ), clause( clause ) {} 363 370 StatementNode( DeclarationNode * decl ); 364 371 virtual ~StatementNode() {} 365 372 366 373 virtual StatementNode * clone() const final { assert( false ); return nullptr; } 367 Statement * build() const { return const_cast<StatementNode *>(this)->stmt.release(); } 368 369 virtual StatementNode * add_label( const std::string * name, DeclarationNode * attr = nullptr ) { 370 stmt->get_labels().emplace_back( * name, nullptr, attr ? std::move( attr->attributes ) : std::list< Attribute * > {} ); 374 ast::Stmt * build() const { return const_cast<StatementNode *>(this)->stmt.release(); } 375 376 virtual StatementNode * add_label( 377 const CodeLocation & location, 378 const std::string * name, 379 DeclarationNode * attr = nullptr ) { 380 stmt->labels.emplace_back( location, 381 *name, 382 attr ? std::move( attr->attributes ) 383 : std::vector<ast::ptr<ast::Attribute>>{} ); 371 384 delete attr; 372 385 delete name; … … 380 393 } 381 394 382 std::unique_ptr<Statement> stmt; 395 std::unique_ptr<ast::Stmt> stmt; 396 std::unique_ptr<ast::StmtClause> clause; 383 397 }; // StatementNode 384 398 385 Statement * build_expr(ExpressionNode * ctl );399 ast::Stmt * build_expr( CodeLocation const &, ExpressionNode * ctl ); 386 400 387 401 struct CondCtl { … … 402 416 }; 403 417 404 Expression * build_if_control( CondCtl * ctl, std::list< Statement * > & init ); 405 Statement * build_if( CondCtl * ctl, StatementNode * then, StatementNode * else_ ); 406 Statement * build_switch( bool isSwitch, ExpressionNode * ctl, StatementNode * stmt ); 407 Statement * build_case( ExpressionNode * ctl ); 408 Statement * build_default(); 409 Statement * build_while( CondCtl * ctl, StatementNode * stmt, StatementNode * else_ = nullptr ); 410 Statement * build_do_while( ExpressionNode * ctl, StatementNode * stmt, StatementNode * else_ = nullptr ); 411 Statement * build_for( ForCtrl * forctl, StatementNode * stmt, StatementNode * else_ = nullptr ); 412 Statement * build_branch( BranchStmt::Type kind ); 413 Statement * build_branch( std::string * identifier, BranchStmt::Type kind ); 414 Statement * build_computedgoto( ExpressionNode * ctl ); 415 Statement * build_return( ExpressionNode * ctl ); 416 Statement * build_throw( ExpressionNode * ctl ); 417 Statement * build_resume( ExpressionNode * ctl ); 418 Statement * build_resume_at( ExpressionNode * ctl , ExpressionNode * target ); 419 Statement * build_try( StatementNode * try_, StatementNode * catch_, StatementNode * finally_ ); 420 Statement * build_catch( CatchStmt::Kind kind, DeclarationNode * decl, ExpressionNode * cond, StatementNode * body ); 421 Statement * build_finally( StatementNode * stmt ); 422 Statement * build_compound( StatementNode * first ); 423 StatementNode * maybe_build_compound( StatementNode * first ); 424 Statement * build_asm( bool voltile, Expression * instruction, ExpressionNode * output = nullptr, ExpressionNode * input = nullptr, ExpressionNode * clobber = nullptr, LabelNode * gotolabels = nullptr ); 425 Statement * build_directive( std::string * directive ); 426 SuspendStmt * build_suspend( StatementNode *, SuspendStmt::Type = SuspendStmt::None); 427 WaitForStmt * build_waitfor( WaitForStmt * existing, ExpressionNode * when, ExpressionNode * targetExpr, StatementNode * stmt ); 428 WaitForStmt * build_waitfor_else( WaitForStmt * existing, ExpressionNode * when, StatementNode * stmt ); 429 WaitForStmt * build_waitfor_timeout( WaitForStmt * existing, ExpressionNode * when, ExpressionNode * timeout, StatementNode * stmt ); 430 Statement * build_with( ExpressionNode * exprs, StatementNode * stmt ); 431 Statement * build_mutex( ExpressionNode * exprs, StatementNode * stmt ); 432 433 //############################################################################## 434 435 template< typename SynTreeType, typename NodeType, template< typename, typename...> class Container, typename... Args > 436 void buildList( const NodeType * firstNode, Container< SynTreeType *, Args... > & outputList ) { 418 ast::Stmt * build_if( const CodeLocation &, CondCtl * ctl, StatementNode * then, StatementNode * else_ ); 419 ast::Stmt * build_switch( const CodeLocation &, bool isSwitch, ExpressionNode * ctl, StatementNode * stmt ); 420 ast::CaseClause * build_case( ExpressionNode * ctl ); 421 ast::CaseClause * build_default( const CodeLocation & ); 422 ast::Stmt * build_while( const CodeLocation &, CondCtl * ctl, StatementNode * stmt, StatementNode * else_ = nullptr ); 423 ast::Stmt * build_do_while( const CodeLocation &, ExpressionNode * ctl, StatementNode * stmt, StatementNode * else_ = nullptr ); 424 ast::Stmt * build_for( const CodeLocation &, ForCtrl * forctl, StatementNode * stmt, StatementNode * else_ = nullptr ); 425 ast::Stmt * build_branch( const CodeLocation &, ast::BranchStmt::Kind kind ); 426 ast::Stmt * build_branch( const CodeLocation &, std::string * identifier, ast::BranchStmt::Kind kind ); 427 ast::Stmt * build_computedgoto( ExpressionNode * ctl ); 428 ast::Stmt * build_return( const CodeLocation &, ExpressionNode * ctl ); 429 ast::Stmt * build_throw( const CodeLocation &, ExpressionNode * ctl ); 430 ast::Stmt * build_resume( const CodeLocation &, ExpressionNode * ctl ); 431 ast::Stmt * build_resume_at( ExpressionNode * ctl , ExpressionNode * target ); 432 ast::Stmt * build_try( const CodeLocation &, StatementNode * try_, StatementNode * catch_, StatementNode * finally_ ); 433 ast::CatchClause * build_catch( const CodeLocation &, ast::ExceptionKind kind, DeclarationNode * decl, ExpressionNode * cond, StatementNode * body ); 434 ast::FinallyClause * build_finally( const CodeLocation &, StatementNode * stmt ); 435 ast::Stmt * build_compound( const CodeLocation &, StatementNode * first ); 436 StatementNode * maybe_build_compound( const CodeLocation &, StatementNode * first ); 437 ast::Stmt * build_asm( const CodeLocation &, bool voltile, ast::Expr * instruction, ExpressionNode * output = nullptr, ExpressionNode * input = nullptr, ExpressionNode * clobber = nullptr, LabelNode * gotolabels = nullptr ); 438 ast::Stmt * build_directive( const CodeLocation &, std::string * directive ); 439 ast::SuspendStmt * build_suspend( const CodeLocation &, StatementNode *, ast::SuspendStmt::Type ); 440 ast::WaitForStmt * build_waitfor( const CodeLocation &, ast::WaitForStmt * existing, ExpressionNode * when, ExpressionNode * targetExpr, StatementNode * stmt ); 441 ast::WaitForStmt * build_waitfor_else( const CodeLocation &, ast::WaitForStmt * existing, ExpressionNode * when, StatementNode * stmt ); 442 ast::WaitForStmt * build_waitfor_timeout( const CodeLocation &, ast::WaitForStmt * existing, ExpressionNode * when, ExpressionNode * timeout, StatementNode * stmt ); 443 ast::Stmt * build_with( const CodeLocation &, ExpressionNode * exprs, StatementNode * stmt ); 444 ast::Stmt * build_mutex( const CodeLocation &, ExpressionNode * exprs, StatementNode * stmt ); 445 446 //############################################################################## 447 448 template<typename AstType, typename NodeType, 449 template<typename, typename...> class Container, typename... Args> 450 void buildList( const NodeType * firstNode, 451 Container<ast::ptr<AstType>, Args...> & output ) { 437 452 SemanticErrorException errors; 438 std::back_insert_iterator< Container< SynTreeType *, Args... > > out( outputList );453 std::back_insert_iterator<Container<ast::ptr<AstType>, Args...>> out( output ); 439 454 const NodeType * cur = firstNode; 440 455 441 456 while ( cur ) { 442 457 try { 443 SynTreeType * result = dynamic_cast< SynTreeType * >( maybeBuild( cur ) ); 444 if ( result ) { 445 result->location = cur->location; 446 * out++ = result; 458 if ( auto result = dynamic_cast<AstType *>( maybeBuild( cur ) ) ) { 459 *out++ = result; 447 460 } else { 461 assertf(false, __PRETTY_FUNCTION__ ); 448 462 SemanticError( cur->location, "type specifier declaration in forall clause is currently unimplemented." ); 449 463 } // if … … 451 465 errors.append( e ); 452 466 } // try 453 const ParseNode * temp = (cur->get_next()); 454 cur = dynamic_cast< const NodeType * >( temp ); // should not return nullptr 455 if ( ! cur && temp ) { // non-homogeneous nodes ? 467 const ParseNode * temp = cur->get_next(); 468 // Should not return nullptr, then it is non-homogeneous: 469 cur = dynamic_cast<const NodeType *>( temp ); 470 if ( !cur && temp ) { 456 471 SemanticError( temp->location, "internal error, non-homogeneous nodes founds in buildList processing." ); 457 472 } // if … … 463 478 464 479 // in DeclarationNode.cc 465 void buildList( const DeclarationNode * firstNode, std::list< Declaration * > & outputList ); 466 void buildList( const DeclarationNode * firstNode, std::list< DeclarationWithType * > & outputList ); 467 void buildTypeList( const DeclarationNode * firstNode, std::list< Type * > & outputList ); 468 469 template< typename SynTreeType, typename NodeType > 470 void buildMoveList( const NodeType * firstNode, std::list< SynTreeType * > & outputList ) { 471 buildList( firstNode, outputList ); 480 void buildList( const DeclarationNode * firstNode, std::vector<ast::ptr<ast::Decl>> & outputList ); 481 void buildList( const DeclarationNode * firstNode, std::vector<ast::ptr<ast::DeclWithType>> & outputList ); 482 void buildTypeList( const DeclarationNode * firstNode, std::vector<ast::ptr<ast::Type>> & outputList ); 483 484 template<typename AstType, typename NodeType, 485 template<typename, typename...> class Container, typename... Args> 486 void buildMoveList( const NodeType * firstNode, 487 Container<ast::ptr<AstType>, Args...> & output ) { 488 buildList<AstType, NodeType, Container, Args...>( firstNode, output ); 472 489 delete firstNode; 473 490 }
Note: See TracChangeset
for help on using the changeset viewer.