~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/nrefactory/ICSharpCode.NRefactory.VB/Ast/TypeMembers/VariableDeclarator.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
Import upstream version 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
 
 
6
namespace ICSharpCode.NRefactory.VB.Ast
 
7
{
 
8
        /// <remarks>
 
9
        /// VariableIdentifiers As ObjectCreationExpression <br />
 
10
        /// VariableIdentifiers ( As TypeName )? ( Equals Expression )?
 
11
        /// </remarks>
 
12
        public abstract class VariableDeclarator : AstNode
 
13
        {
 
14
                public static readonly Role<VariableDeclarator> VariableDeclaratorRole = new Role<VariableDeclarator>("VariableDeclarator");
 
15
                
 
16
                public AstNodeCollection<VariableIdentifier> Identifiers {
 
17
                        get { return GetChildrenByRole(VariableIdentifier.VariableIdentifierRole); }
 
18
                }
 
19
        }
 
20
        
 
21
        public class VariableDeclaratorWithTypeAndInitializer : VariableDeclarator
 
22
        {
 
23
                public AstType Type {
 
24
                        get { return GetChildByRole(Roles.Type); }
 
25
                        set { SetChildByRole(Roles.Type, value); }
 
26
                }
 
27
                
 
28
                public Expression Initializer {
 
29
                        get { return GetChildByRole(Roles.Expression); }
 
30
                        set { SetChildByRole(Roles.Expression, value); }
 
31
                }
 
32
                
 
33
                protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
 
34
                {
 
35
                        throw new NotImplementedException();
 
36
                }
 
37
                
 
38
                public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
 
39
                {
 
40
                        return visitor.VisitVariableDeclaratorWithTypeAndInitializer(this, data);
 
41
                }
 
42
        }
 
43
        
 
44
        public class VariableDeclaratorWithObjectCreation : VariableDeclarator
 
45
        {
 
46
                public static readonly Role<ObjectCreationExpression> InitializerRole = new Role<ObjectCreationExpression>("InitializerRole");
 
47
                
 
48
                public ObjectCreationExpression Initializer {
 
49
                        get { return GetChildByRole(InitializerRole); }
 
50
                        set { SetChildByRole(InitializerRole, value); }
 
51
                }
 
52
                
 
53
                protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
 
54
                {
 
55
                        throw new NotImplementedException();
 
56
                }
 
57
                
 
58
                public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
 
59
                {
 
60
                        return visitor.VisitVariableDeclaratorWithObjectCreation(this, data);
 
61
                }
 
62
        }
 
63
}