- Timestamp:
- May 1, 2026, 11:59:42 AM (16 hours ago)
- Branches:
- master
- Children:
- efa8439a
- Parents:
- f69dafc
- Location:
- src/Parser
- Files:
-
- 2 edited
-
ExpressionNode.cpp (modified) (17 diffs)
-
parser.yy (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ExpressionNode.cpp
rf69dafc r2737b37 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Apr 1 08:13:17 202513 // Update Count : 112 212 // Last Modified On : Fri May 1 11:07:48 2026 13 // Update Count : 1128 14 14 // 15 15 … … 125 125 } // scanbin 126 126 127 ast::Expr * build_constantInteger( 128 const CodeLocation & location, string & str ) { 127 ast::Expr * build_constantInteger( const CodeLocation & location, string & str ) { 129 128 static const ast::BasicKind kind[2][6] = { 130 129 // short (h) must be before char (hh) because shorter type has the longer suffix … … 303 302 304 303 // Constant type is correct for overload resolving. 305 ret = new ast::ConstantExpr( location, 306 new ast::BasicType( kind[Unsigned][type] ), str, v ); 304 ret = new ast::ConstantExpr( location, new ast::BasicType( kind[Unsigned][type] ), str, v ); 307 305 if ( Unsigned && type < 2 ) { // hh or h, less than int ? 308 306 // int i = -1uh => 65535 not -1, so cast is necessary for unsigned, which unfortunately eliminates warnings for large values. 309 ret = new ast::CastExpr( location, 310 ret, 311 new ast::BasicType( kind[Unsigned][type] ), 312 ast::ExplicitCast ); 307 ret = new ast::CastExpr( location, ret, new ast::BasicType( kind[Unsigned][type] ), ast::ExplicitCast ); 313 308 } else if ( ltype != -1 ) { // explicit length ? 314 309 if ( ltype == 6 ) { // int128, (int128)constant 315 ret2 = new ast::ConstantExpr( location, 316 new ast::BasicType( ast::BasicKind::LongLongSignedInt ), 317 str2, 318 v2 ); 310 ret2 = new ast::ConstantExpr( location, new ast::BasicType( ast::BasicKind::LongLongSignedInt ), str2, v2 ); 319 311 ret = build_compoundLiteral( location, 320 DeclarationNode::newFromTypeData( 321 addType( 322 build_basic_type( TypeData::Int128 ), 323 build_signedness( TypeData::Unsigned ) ) ), 324 new InitializerNode( 325 (new InitializerNode( new ExpressionNode( v2 == 0 ? ret2 : ret ) ))->set_last( new InitializerNode( new ExpressionNode( v2 == 0 ? ret : ret2 ) ) ), true ) 312 DeclarationNode::newFromTypeData( addType( build_basic_type( TypeData::Int128 ), build_signedness( TypeData::Unsigned ) ) ), 313 new InitializerNode( (new InitializerNode( new ExpressionNode( v2 == 0 ? ret2 : ret ) ))->set_last( new InitializerNode( new ExpressionNode( v2 == 0 ? ret : ret2 ) ) ), true ) 326 314 ); 327 315 } else { // explicit length, (length_type)constant 328 ret = new ast::CastExpr( location, 329 ret, 330 new ast::TypeInstType( lnthsInt[Unsigned][ltype], ast::TypeDecl::Dtype ), 331 ast::ExplicitCast ); 316 ret = new ast::CastExpr( location, ret, new ast::TypeInstType( lnthsInt[Unsigned][ltype], ast::TypeDecl::Dtype ), ast::ExplicitCast ); 332 317 if ( ltype == 5 ) { // pointer, intptr( (uintptr_t)constant ) 333 ret = build_func( location, 334 new ExpressionNode( 335 build_varref( location, new string( "intptr" ) ) ), 336 new ExpressionNode( ret ) ); 318 ret = build_func( location, new ExpressionNode( build_varref( location, new string( "intptr" ) ) ), new ExpressionNode( ret ) ); 337 319 } // if 338 320 } // if … … 378 360 379 361 380 ast::Expr * build_constantFloat( 381 const CodeLocation & location, string & str ) { 362 ast::Expr * build_constantFloat( const CodeLocation & location, string & str ) { 382 363 static const ast::BasicKind kind[2][12] = { 383 364 { ast::BasicKind::Float, ast::BasicKind::Double, ast::BasicKind::LongDouble, ast::BasicKind::Float80, ast::BasicKind::uuFloat128, ast::BasicKind::Float16, ast::BasicKind::Float32, ast::BasicKind::Float32x, ast::BasicKind::Float64, ast::BasicKind::Float64x, ast::BasicKind::Float128, ast::BasicKind::Float128x }, … … 419 400 420 401 assert( 0 <= type && type < 12 ); 421 ast::Expr * ret = new ast::ConstantExpr( location, 422 new ast::BasicType( kind[complx][type] ), 423 str, 424 v ); 402 ast::Expr * ret = new ast::ConstantExpr( location, new ast::BasicType( kind[complx][type] ), str, v ); 425 403 // explicit length ? 426 404 if ( explnth ) { 427 ret = new ast::CastExpr( location, 428 ret, 429 new ast::BasicType( kind[complx][type] ), 430 ast::ExplicitCast ); 405 ret = new ast::CastExpr( location, ret, new ast::BasicType( kind[complx][type] ), ast::ExplicitCast ); 431 406 } // if 432 407 … … 446 421 ast::Type * kind; 447 422 switch ( str[0] ) { // str has >= 2 characters, i.e, null string "" => safe to look at subscripts 0/1 448 case 'u':423 case 'u': 449 424 if ( str[1] == '8' ) goto Default; // utf-8 characters => array of char (save check for char as no 8 allowed) 450 425 // lookup type of associated typedef 451 426 kind = new ast::TypeInstType( "char16_t", ast::TypeDecl::Dtype ); 452 427 break; 453 case 'U':428 case 'U': 454 429 kind = new ast::TypeInstType( "char32_t", ast::TypeDecl::Dtype ); 455 430 break; 456 case 'L':431 case 'L': 457 432 kind = new ast::TypeInstType( "wchar_t", ast::TypeDecl::Dtype ); 458 433 break; 459 Default: // char default string type460 default:434 Default: // char default string type 435 default: 461 436 kind = new ast::BasicType( ast::BasicKind::Char ); 462 437 } // switch … … 544 519 } // build_constantStr 545 520 546 ast::Expr * build_field_name_FLOATING_FRACTIONconstant( 547 const CodeLocation & location, const string & str ) { 521 ast::Expr * build_field_name_FLOATING_FRACTIONconstant( const CodeLocation & location, const string & str ) { 548 522 if ( str.find_first_not_of( "0123456789", 1 ) != string::npos ) SemanticError( yylloc, "invalid tuple index \"%s\".", str.c_str() ); 549 ast::Expr * ret = build_constantInteger( location, 550 *new string( str.substr(1) ) ); 523 ast::Expr * ret = build_constantInteger( location, *new string( str.substr(1) ) ); 551 524 delete &str; 552 525 return ret; 553 526 } // build_field_name_FLOATING_FRACTIONconstant 554 527 555 ast::Expr * build_field_name_FLOATING_DECIMALconstant( 556 const CodeLocation & location, const string & str ) { 528 ast::Expr * build_field_name_FLOATING_DECIMALconstant( const CodeLocation & location, const string & str ) { 557 529 if ( str[str.size() - 1] != '.' ) SemanticError( yylloc, "invalid tuple index \"%s\".", str.c_str() ); 558 ast::Expr * ret = build_constantInteger( 559 location, *new string( str.substr( 0, str.size()-1 ) ) ); 530 ast::Expr * ret = build_constantInteger( location, *new string( str.substr( 0, str.size()-1 ) ) ); 560 531 delete &str; 561 532 return ret; 562 533 } // build_field_name_FLOATING_DECIMALconstant 563 534 564 ast::Expr * build_field_name_FLOATINGconstant( const CodeLocation & location, 565 const string & str ) { 535 ast::Expr * build_field_name_FLOATINGconstant( const CodeLocation & location, const string & str ) { 566 536 // str is of the form A.B -> separate at the . and return member expression 567 537 int a, b; … … 569 539 stringstream ss( str ); 570 540 ss >> a >> dot >> b; 571 auto ret = new ast::UntypedMemberExpr( location, 572 ast::ConstantExpr::from_int( location, b ), 573 ast::ConstantExpr::from_int( location, a ) 541 auto ret = new ast::UntypedMemberExpr( location, ast::ConstantExpr::from_int( location, b ), ast::ConstantExpr::from_int( location, a ) 574 542 ); 575 543 delete &str; … … 577 545 } // build_field_name_FLOATINGconstant 578 546 579 ast::Expr * make_field_name_fraction_constants( const CodeLocation & location, 580 ast::Expr * fieldName, 581 ast::Expr * fracts ) { 547 ast::Expr * make_field_name_fraction_constants( const CodeLocation & location, ast::Expr * fieldName, ast::Expr * fracts ) { 582 548 if ( nullptr == fracts ) { 583 549 return fieldName; 584 550 } else if ( auto memberExpr = dynamic_cast<ast::UntypedMemberExpr *>( fracts ) ) { 585 memberExpr->member = make_field_name_fraction_constants( location, 586 fieldName, 587 ast::mutate( memberExpr->aggregate.get() ) ); 551 memberExpr->member = make_field_name_fraction_constants( location, fieldName, ast::mutate( memberExpr->aggregate.get() ) ); 588 552 return memberExpr; 589 553 } else { … … 592 556 } // make_field_name_fraction_constants 593 557 594 ast::Expr * build_field_name_fraction_constants( const CodeLocation & location, 595 ast::Expr * fieldName, 596 ExpressionNode * fracts ) { 558 ast::Expr * build_field_name_fraction_constants( const CodeLocation & location, ast::Expr * fieldName, ExpressionNode * fracts ) { 597 559 return make_field_name_fraction_constants( location, fieldName, maybeMoveBuild( fracts ) ); 598 560 } // build_field_name_fraction_constants 599 561 600 ast::NameExpr * build_varref( const CodeLocation & location, 601 const string * name ) { 562 ast::NameExpr * build_varref( const CodeLocation & location, const string * name ) { 602 563 ast::NameExpr * expr = new ast::NameExpr( location, *name ); 603 564 delete name; … … 605 566 } // build_varref 606 567 607 ast::QualifiedNameExpr * build_qualified_expr( const CodeLocation & location, 608 const DeclarationNode * decl_node, 609 const ast::NameExpr * name ) { 568 ast::QualifiedNameExpr * build_qualified_expr( const CodeLocation & location, const DeclarationNode * decl_node, const ast::NameExpr * name ) { 610 569 ast::Decl * newDecl = maybeBuild( decl_node ); 611 570 if ( ast::DeclWithType * newDeclWithType = dynamic_cast<ast::DeclWithType *>( newDecl ) ) { … … 619 578 } 620 579 621 ast::QualifiedNameExpr * build_qualified_expr( const CodeLocation & location, 622 const ast::EnumDecl * decl, 623 const ast::NameExpr * name ) { 580 ast::QualifiedNameExpr * build_qualified_expr( const CodeLocation & location, const ast::EnumDecl * decl, const ast::NameExpr * name ) { 624 581 return new ast::QualifiedNameExpr( location, decl, name->name ); 625 582 } 626 583 627 ast::DimensionExpr * build_dimensionref( const CodeLocation & location, 628 const string * name ) { 584 ast::DimensionExpr * build_dimensionref( const CodeLocation & location, const string * name ) { 629 585 ast::DimensionExpr * expr = new ast::DimensionExpr( location, *name ); 630 586 delete name; … … 643 599 }; // OperName 644 600 645 ast::Expr * build_cast( const CodeLocation & location, 646 DeclarationNode * decl_node, 647 ExpressionNode * expr_node, 648 ast::CastKind kind ) { 601 ast::Expr * build_cast( const CodeLocation & location, DeclarationNode * decl_node, ExpressionNode * expr_node, ast::CastKind kind ) { 649 602 ast::Type * targetType = maybeMoveBuildType( decl_node ); 650 603 if ( dynamic_cast<ast::VoidType *>( targetType ) ) { 651 604 delete targetType; 652 return new ast::CastExpr( location, 653 maybeMoveBuild( expr_node ), 654 ast::ExplicitCast, kind ); 605 return new ast::CastExpr( location, maybeMoveBuild( expr_node ), ast::ExplicitCast, kind ); 655 606 } else { 656 return new ast::CastExpr( location, 657 maybeMoveBuild( expr_node ), 658 targetType, 659 ast::ExplicitCast, kind ); 607 return new ast::CastExpr( location, maybeMoveBuild( expr_node ), targetType, ast::ExplicitCast, kind ); 660 608 } // if 661 609 } // build_cast 662 610 663 ast::Expr * build_keyword_cast( const CodeLocation & location, 664 ast::AggregateDecl::Aggregate target, 665 ExpressionNode * expr_node ) { 666 return new ast::KeywordCastExpr( location, 667 maybeMoveBuild( expr_node ), 668 target 669 ); 611 ast::Expr * build_keyword_cast( const CodeLocation & location, ast::AggregateDecl::Aggregate target, ExpressionNode * expr_node ) { 612 return new ast::KeywordCastExpr( location, maybeMoveBuild( expr_node ), target ); 670 613 } 671 614 672 ast::Expr * build_virtual_cast( const CodeLocation & location, 673 DeclarationNode * decl_node, 674 ExpressionNode * expr_node ) { 675 return new ast::VirtualCastExpr( location, 676 maybeMoveBuild( expr_node ), 677 maybeMoveBuildType( decl_node ) 678 ); 615 ast::Expr * build_virtual_cast( const CodeLocation & location, DeclarationNode * decl_node, ExpressionNode * expr_node ) { 616 return new ast::VirtualCastExpr( location, maybeMoveBuild( expr_node ), maybeMoveBuildType( decl_node ) ); 679 617 } // build_virtual_cast 680 618 681 ast::Expr * build_fieldSel( const CodeLocation & location, 682 ExpressionNode * expr_node, 683 ast::Expr * member ) { 684 return new ast::UntypedMemberExpr( location, 685 member, 686 maybeMoveBuild( expr_node ) 687 ); 619 ast::Expr * build_fieldSel( const CodeLocation & location, ExpressionNode * expr_node, ast::Expr * member ) { 620 return new ast::UntypedMemberExpr( location, member, maybeMoveBuild( expr_node ) ); 688 621 } // build_fieldSel 689 622 690 ast::Expr * build_pfieldSel( const CodeLocation & location, 691 ExpressionNode * expr_node, 692 ast::Expr * member ) { 693 auto deref = new ast::UntypedExpr( location, 694 new ast::NameExpr( location, "*?" ) 695 ); 623 ast::Expr * build_pfieldSel( const CodeLocation & location, ExpressionNode * expr_node, ast::Expr * member ) { 624 auto deref = new ast::UntypedExpr( location, new ast::NameExpr( location, "*?" ) ); 696 625 deref->location = expr_node->location; 697 626 deref->args.push_back( maybeMoveBuild( expr_node ) ); … … 700 629 } // build_pfieldSel 701 630 702 ast::Expr * build_offsetOf( const CodeLocation & location, 703 DeclarationNode * decl_node, 704 ast::NameExpr * member ) { 705 ast::Expr * ret = new ast::UntypedOffsetofExpr( location, 706 maybeMoveBuildType( decl_node ), 707 member->name 708 ); 631 ast::Expr * build_offsetOf( const CodeLocation & location, DeclarationNode * decl_node, ast::NameExpr * member ) { 632 ast::Expr * ret = new ast::UntypedOffsetofExpr( location, maybeMoveBuildType( decl_node ), member->name ); 709 633 ret->result = new ast::BasicType( ast::BasicKind::LongUnsignedInt ); 710 634 delete member; … … 712 636 } // build_offsetOf 713 637 714 ast::Expr * build_and_or( const CodeLocation & location, 715 ExpressionNode * expr_node1, 716 ExpressionNode * expr_node2, 717 ast::LogicalFlag flag ) { 718 return new ast::LogicalExpr( location, 719 maybeMoveBuild( expr_node1 ), 720 maybeMoveBuild( expr_node2 ), 721 flag 722 ); 638 ast::Expr * build_and_or( const CodeLocation & location, ExpressionNode * expr_node1, ExpressionNode * expr_node2, ast::LogicalFlag flag ) { 639 return new ast::LogicalExpr( location, maybeMoveBuild( expr_node1 ), maybeMoveBuild( expr_node2 ), flag ); 723 640 } // build_and_or 724 641 725 ast::Expr * build_unary_val( const CodeLocation & location, 726 OperKinds op, 727 ExpressionNode * expr_node ) { 642 ast::Expr * build_unary_val( const CodeLocation & location, OperKinds op, ExpressionNode * expr_node ) { 728 643 std::vector<ast::ptr<ast::Expr>> args; 729 644 args.push_back( maybeMoveBuild( expr_node ) ); 730 return new ast::UntypedExpr( location, 731 new ast::NameExpr( location, OperName[ (int)op ] ), 732 std::move( args ) 733 ); 645 return new ast::UntypedExpr( location, new ast::NameExpr( location, OperName[ (int)op ] ), std::move( args ) ); 734 646 } // build_unary_val 735 647 736 ast::Expr * build_binary_val( const CodeLocation & location, 737 OperKinds op, 738 ExpressionNode * expr_node1, 739 ExpressionNode * expr_node2 ) { 648 ast::Expr * build_binary_val( const CodeLocation & location, OperKinds op, ExpressionNode * expr_node1, ExpressionNode * expr_node2 ) { 740 649 std::vector<ast::ptr<ast::Expr>> args; 741 650 args.push_back( maybeMoveBuild( expr_node1 ) ); 742 651 args.push_back( maybeMoveBuild( expr_node2 ) ); 743 return new ast::UntypedExpr( location, 744 new ast::NameExpr( location, OperName[ (int)op ] ), 745 std::move( args ) 746 ); 652 return new ast::UntypedExpr( location, new ast::NameExpr( location, OperName[ (int)op ] ), std::move( args ) ); 747 653 } // build_binary_val 748 654 749 ast::Expr * build_cond( const CodeLocation & location, 750 ExpressionNode * expr_node1, 751 ExpressionNode * expr_node2, 752 ExpressionNode * expr_node3 ) { 753 return new ast::ConditionalExpr( location, 754 maybeMoveBuild( expr_node1 ), 755 maybeMoveBuild( expr_node2 ), 756 maybeMoveBuild( expr_node3 ) 757 ); 655 ast::Expr * build_cond( const CodeLocation & location, ExpressionNode * expr_node1, ExpressionNode * expr_node2, ExpressionNode * expr_node3 ) { 656 return new ast::ConditionalExpr( location, maybeMoveBuild( expr_node1 ), maybeMoveBuild( expr_node2 ), maybeMoveBuild( expr_node3 ) ); 758 657 } // build_cond 759 658 760 ast::Expr * build_tuple( const CodeLocation & location, 761 ExpressionNode * expr_node ) { 659 ast::Expr * build_tuple( const CodeLocation & location, ExpressionNode * expr_node ) { 762 660 std::vector<ast::ptr<ast::Expr>> exprs; 763 661 buildMoveList( expr_node, exprs ); … … 765 663 } // build_tuple 766 664 767 ast::Expr * build_func( const CodeLocation & location, 768 ExpressionNode * function, 769 ExpressionNode * expr_node ) { 665 ast::Expr * build_func( const CodeLocation & location, ExpressionNode * function, ExpressionNode * expr_node ) { 770 666 std::vector<ast::ptr<ast::Expr>> args; 771 667 buildMoveList( expr_node, args ); 772 return new ast::UntypedExpr( location, 773 maybeMoveBuild( function ), 774 std::move( args ) 775 ); 668 return new ast::UntypedExpr( location, maybeMoveBuild( function ), std::move( args ) ); 776 669 } // build_func 777 670 778 ast::Expr * build_compoundLiteral( const CodeLocation & location, 779 DeclarationNode * decl_node, 780 InitializerNode * kids ) { 671 ast::Expr * build_compoundLiteral( const CodeLocation & location, DeclarationNode * decl_node, InitializerNode * kids ) { 781 672 // compound literal type 782 673 ast::Decl * newDecl = maybeBuild( decl_node ); 783 674 // non-sue compound-literal type 784 675 if ( ast::DeclWithType * newDeclWithType = dynamic_cast<ast::DeclWithType *>( newDecl ) ) { 785 return new ast::CompoundLiteralExpr( location, 786 newDeclWithType->get_type(), 787 maybeMoveBuild( kids ) ); 676 return new ast::CompoundLiteralExpr( location, newDeclWithType->get_type(), maybeMoveBuild( kids ) ); 788 677 // these types do not have associated type information 789 678 } else if ( auto newDeclStructDecl = dynamic_cast<ast::StructDecl *>( newDecl ) ) { 790 679 if ( newDeclStructDecl->body ) { 791 return new ast::CompoundLiteralExpr( location, 792 new ast::StructInstType( newDeclStructDecl ), 793 maybeMoveBuild( kids ) ); 680 return new ast::CompoundLiteralExpr( location, new ast::StructInstType( newDeclStructDecl ), maybeMoveBuild( kids ) ); 794 681 } else { 795 return new ast::CompoundLiteralExpr( location, 796 new ast::StructInstType( newDeclStructDecl->name ), 797 maybeMoveBuild( kids ) ); 682 return new ast::CompoundLiteralExpr( location, new ast::StructInstType( newDeclStructDecl->name ), maybeMoveBuild( kids ) ); 798 683 } // if 799 684 } else if ( auto newDeclUnionDecl = dynamic_cast<ast::UnionDecl *>( newDecl ) ) { 800 685 if ( newDeclUnionDecl->body ) { 801 return new ast::CompoundLiteralExpr( location, 802 new ast::UnionInstType( newDeclUnionDecl ), 803 maybeMoveBuild( kids ) ); 686 return new ast::CompoundLiteralExpr( location, new ast::UnionInstType( newDeclUnionDecl ), maybeMoveBuild( kids ) ); 804 687 } else { 805 return new ast::CompoundLiteralExpr( location, 806 new ast::UnionInstType( newDeclUnionDecl->name ), 807 maybeMoveBuild( kids ) ); 688 return new ast::CompoundLiteralExpr( location, new ast::UnionInstType( newDeclUnionDecl->name ), maybeMoveBuild( kids ) ); 808 689 } // if 809 690 } else if ( auto newDeclEnumDecl = dynamic_cast<ast::EnumDecl *>( newDecl ) ) { 810 691 if ( newDeclEnumDecl->body ) { 811 return new ast::CompoundLiteralExpr( location, 812 new ast::EnumInstType( newDeclEnumDecl ), 813 maybeMoveBuild( kids ) ); 692 return new ast::CompoundLiteralExpr( location, new ast::EnumInstType( newDeclEnumDecl ), maybeMoveBuild( kids ) ); 814 693 } else { 815 return new ast::CompoundLiteralExpr( location, 816 new ast::EnumInstType( newDeclEnumDecl->name ), 817 maybeMoveBuild( kids ) ); 694 return new ast::CompoundLiteralExpr( location, new ast::EnumInstType( newDeclEnumDecl->name ), maybeMoveBuild( kids ) ); 818 695 } // if 819 696 } else { … … 822 699 } // build_compoundLiteral 823 700 824 ast::Expr * build_va_arg( const CodeLocation & location, 825 ExpressionNode * function, DeclarationNode * declaration ) { 826 return build_func( location, 827 new ExpressionNode( 828 build_varref( location, new std::string( "__builtin_va_arg" ) ) ), 829 function->set_last( new ExpressionNode( new ast::TypeExpr( location, 830 maybeMoveBuildType( declaration ) ) ) ) 831 ); 701 ast::Expr * build_va_arg( const CodeLocation & location, ExpressionNode * function, DeclarationNode * declaration ) { 702 return build_func( location, new ExpressionNode( build_varref( location, new std::string( "__builtin_va_arg" ) ) ), 703 function->set_last( new ExpressionNode( new ast::TypeExpr( location, maybeMoveBuildType( declaration ) ) ) ) ); 832 704 } 833 705 -
src/Parser/parser.yy
rf69dafc r2737b37 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 11 11:09:33202613 // Update Count : 73 0012 // Last Modified On : Fri May 1 11:01:45 2026 13 // Update Count : 7320 14 14 // 15 15 … … 54 54 #include "Common/SemanticError.hpp" // error_str 55 55 #include "Common/Utility.hpp" // for maybeMoveBuild, maybeBuild, CodeLo... 56 #include " AST/Attribute.hpp" // for Attribute57 #include "AST/ Print.hpp" // for print58 #include " Common/Iterate.hpp" // for reverseIterate56 #include "Common/Iterate.hpp" // for reverseIterate 57 #include "AST/Attribute.hpp" // for Attribute 58 #include "AST/Print.hpp" // for print 59 59 60 60 // lex uses __null in a boolean context, it's fine. … … 443 443 %type<ifctrl> conditional_declaration 444 444 %type<forctrl> for_control_expression for_control_expression_list 445 %type<oper> upupeq updown updownSupdownEq445 %type<oper> upupeq updown updownS updownEq 446 446 %type<expr> subrange 447 447 %type<decl> asm_name_opt … … 880 880 { $$ = new ExpressionNode( build_field_name_fraction_constants( yylloc, build_field_name_FLOATINGconstant( yylloc, *$1 ), $2 ) ); } 881 881 | identifier_at fraction_constants_opt // CFA, allow anonymous fields 882 { 883 $$ = new ExpressionNode( build_field_name_fraction_constants( yylloc, build_varref( yylloc, $1 ), $2 ) ); 884 } 882 { $$ = new ExpressionNode( build_field_name_fraction_constants( yylloc, build_varref( yylloc, $1 ), $2 ) ); } 885 883 ; 886 884
Note:
See TracChangeset
for help on using the changeset viewer.