comparison trunk/src/dil/ast/Declarations.d @ 704:ff4643a4a97c

Wrote code for SemanticPass2.visit(MixinDeclaration).
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Mon, 28 Jan 2008 18:48:02 +0100
parents b0732f766ba0
children efa5fcb9aa14
comparison
equal deleted inserted replaced
703:bf10602159c1 704:ff4643a4a97c
614 } 614 }
615 } 615 }
616 616
617 class MixinDeclaration : Declaration 617 class MixinDeclaration : Declaration
618 { 618 {
619 /// IdExpression := IdentifierExpression | TemplateInstanceExpression
620 /// MixinTemplate := IdExpression ("." IdExpression)*
619 Expression templateExpr; 621 Expression templateExpr;
620 Identifier* mixinIdent; 622 Identifier* mixinIdent; /// Optional mixin identifier.
621 Expression argument; // mixin ( AssignExpression ) 623 Expression argument; /// "mixin" "(" AssignExpression ")"
624 Declaration decls; /// Initialized in the semantic phase.
622 625
623 this(Expression templateExpr, Identifier* mixinIdent) 626 this(Expression templateExpr, Identifier* mixinIdent)
624 { 627 {
625 mixin(set_kind); 628 mixin(set_kind);
626 addChild(templateExpr); 629 addChild(templateExpr);
634 mixin(set_kind); 637 mixin(set_kind);
635 addChild(argument); 638 addChild(argument);
636 639
637 this.argument = argument; 640 this.argument = argument;
638 } 641 }
639 } 642
643 bool isMixinExpression()
644 {
645 return argument !is null;
646 }
647 }