comparison trunk/src/dil/ast/Declarations.d @ 650:eb490ba8dba0

Made AttributeDeclaration abstract.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Tue, 15 Jan 2008 11:22:55 +0100
parents 4ae7b13aaac8
children 2a71e2f50e13
comparison
equal deleted inserted replaced
649:3ebe76ad680e 650:eb490ba8dba0
566 this.parameters = parameters; 566 this.parameters = parameters;
567 this.funcBody = funcBody; 567 this.funcBody = funcBody;
568 } 568 }
569 } 569 }
570 570
571 class AttributeDeclaration : Declaration 571 abstract class AttributeDeclaration : Declaration
572 { 572 {
573 TOK attribute;
574 Declaration decls; 573 Declaration decls;
575 this(TOK attribute, Declaration decls) 574 this(Declaration decls)
576 { 575 {
577 super.hasBody = true; 576 super.hasBody = true;
578 mixin(set_kind);
579 addChild(decls); 577 addChild(decls);
580
581 this.attribute = attribute;
582 this.decls = decls; 578 this.decls = decls;
583 } 579 }
584 } 580 }
585 581
586 class ProtectionDeclaration : AttributeDeclaration 582 class ProtectionDeclaration : AttributeDeclaration
587 { 583 {
588 Protection prot; 584 Protection prot;
589 this(Protection prot, Declaration decls) 585 this(Protection prot, Declaration decls)
590 { 586 {
591 super(cast(TOK)0, decls); 587 super(decls);
592 mixin(set_kind); 588 mixin(set_kind);
593 this.prot = prot; 589 this.prot = prot;
594 } 590 }
595 } 591 }
596 592
597 class StorageClassDeclaration : AttributeDeclaration 593 class StorageClassDeclaration : AttributeDeclaration
598 { 594 {
599 StorageClass storageClass; 595 StorageClass storageClass;
600 this(StorageClass storageClass, TOK tok, Declaration decl) 596 this(StorageClass storageClass, Declaration decl)
601 { 597 {
602 super(tok, decl); 598 super(decl);
603 mixin(set_kind); 599 mixin(set_kind);
604 600
605 this.storageClass = storageClass; 601 this.storageClass = storageClass;
606 } 602 }
607 } 603 }
609 class LinkageDeclaration : AttributeDeclaration 605 class LinkageDeclaration : AttributeDeclaration
610 { 606 {
611 LinkageType linkageType; 607 LinkageType linkageType;
612 this(LinkageType linkageType, Declaration decls) 608 this(LinkageType linkageType, Declaration decls)
613 { 609 {
614 super(TOK.Extern, decls); 610 super(decls);
615 mixin(set_kind); 611 mixin(set_kind);
616 612
617 this.linkageType = linkageType; 613 this.linkageType = linkageType;
618 } 614 }
619 } 615 }
621 class AlignDeclaration : AttributeDeclaration 617 class AlignDeclaration : AttributeDeclaration
622 { 618 {
623 int size; 619 int size;
624 this(int size, Declaration decls) 620 this(int size, Declaration decls)
625 { 621 {
626 super(TOK.Align, decls); 622 super(decls);
627 mixin(set_kind); 623 mixin(set_kind);
628 this.size = size; 624 this.size = size;
629 } 625 }
630 } 626 }
631 627
634 Identifier* ident; 630 Identifier* ident;
635 Expression[] args; 631 Expression[] args;
636 this(Identifier* ident, Expression[] args, Declaration decls) 632 this(Identifier* ident, Expression[] args, Declaration decls)
637 { 633 {
638 addOptChildren(args); // Add args before calling super(). 634 addOptChildren(args); // Add args before calling super().
639 super(TOK.Pragma, decls); 635 super(decls);
640 mixin(set_kind); 636 mixin(set_kind);
641 637
642 this.ident = ident; 638 this.ident = ident;
643 this.args = args; 639 this.args = args;
644 } 640 }