Mercurial > projects > dil
comparison trunk/src/dil/Expressions.d @ 505:3bb94ba21490
Refactored a great amount of code.
Changed many declaration types from Token* to Identifier*.
Fix in parseStructInitializer(): append null to idents in else body.
Fixed class Parameter and parseParameterList().
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Wed, 12 Dec 2007 02:25:42 +0100 |
parents | 4e14cd1b24da |
children | aa73f669c298 |
comparison
equal
deleted
inserted
replaced
504:9076c4cea2a4 | 505:3bb94ba21490 |
---|---|
581 } | 581 } |
582 */ | 582 */ |
583 | 583 |
584 class IdentifierExpression : Expression | 584 class IdentifierExpression : Expression |
585 { | 585 { |
586 Token* identifier; | 586 Identifier* identifier; |
587 this(Token* identifier) | 587 this(Identifier* identifier) |
588 { | 588 { |
589 mixin(set_kind); | 589 mixin(set_kind); |
590 this.identifier = identifier; | 590 this.identifier = identifier; |
591 } | 591 } |
592 } | 592 } |
631 } | 631 } |
632 } | 632 } |
633 | 633 |
634 class TemplateInstanceExpression : Expression | 634 class TemplateInstanceExpression : Expression |
635 { | 635 { |
636 Token* ident; | 636 Identifier* ident; |
637 TemplateArguments targs; | 637 TemplateArguments targs; |
638 this(Token* ident, TemplateArguments targs) | 638 this(Identifier* ident, TemplateArguments targs) |
639 { | 639 { |
640 mixin(set_kind); | 640 mixin(set_kind); |
641 addOptChild(targs); | 641 addOptChild(targs); |
642 this.ident = ident; | 642 this.ident = ident; |
643 this.targs = targs; | 643 this.targs = targs; |
826 } | 826 } |
827 | 827 |
828 class TypeDotIdExpression : Expression | 828 class TypeDotIdExpression : Expression |
829 { | 829 { |
830 Type type; | 830 Type type; |
831 Token* ident; | 831 Identifier* ident; |
832 this(Type type, Token* ident) | 832 this(Type type, Identifier* ident) |
833 { | 833 { |
834 mixin(set_kind); | 834 mixin(set_kind); |
835 addChild(type); | 835 addChild(type); |
836 this.type = type; | 836 this.type = type; |
837 this.ident = ident; | 837 this.ident = ident; |
850 } | 850 } |
851 | 851 |
852 class IsExpression : Expression | 852 class IsExpression : Expression |
853 { | 853 { |
854 Type type; | 854 Type type; |
855 Token* ident; | 855 Identifier* ident; |
856 Token* opTok, specTok; | 856 Token* opTok, specTok; |
857 Type specType; | 857 Type specType; |
858 TemplateParameters tparams; // D 2.0 | 858 TemplateParameters tparams; // D 2.0 |
859 this(Type type, Token* ident, Token* opTok, Token* specTok, Type specType, typeof(tparams) tparams) | 859 this(Type type, Identifier* ident, Token* opTok, Token* specTok, |
860 Type specType, typeof(tparams) tparams) | |
860 { | 861 { |
861 mixin(set_kind); | 862 mixin(set_kind); |
862 addChild(type); | 863 addChild(type); |
863 addOptChild(specType); | 864 addOptChild(specType); |
864 version(D2) | 865 version(D2) |
903 | 904 |
904 version(D2) | 905 version(D2) |
905 { | 906 { |
906 class TraitsExpression : Expression | 907 class TraitsExpression : Expression |
907 { | 908 { |
908 Token* ident; | 909 Identifier* ident; |
909 TemplateArguments targs; | 910 TemplateArguments targs; |
910 this(typeof(ident) ident, typeof(targs) targs) | 911 this(typeof(ident) ident, typeof(targs) targs) |
911 { | 912 { |
912 mixin(set_kind); | 913 mixin(set_kind); |
913 addOptChild(targs); | 914 addOptChild(targs); |
943 } | 944 } |
944 } | 945 } |
945 | 946 |
946 class StructInitializer : Expression | 947 class StructInitializer : Expression |
947 { | 948 { |
948 Token*[] idents; | 949 Identifier*[] idents; |
949 Expression[] values; | 950 Expression[] values; |
950 this(Token*[] idents, Expression[] values) | 951 this(Identifier*[] idents, Expression[] values) |
951 { | 952 { |
952 mixin(set_kind); | 953 mixin(set_kind); |
953 addOptChildren(values); | 954 addOptChildren(values); |
954 this.idents = idents; | 955 this.idents = idents; |
955 this.values = values; | 956 this.values = values; |