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)
5
using System.Collections.Generic;
7
namespace ICSharpCode.NRefactory.VB.Ast
10
/// [ Key ] .Identifier = Expression
12
public class FieldInitializerExpression : Expression
14
public bool IsKey { get; set; }
16
public VBTokenNode KeyToken {
17
get { return GetChildByRole (Roles.Keyword); }
20
public VBTokenNode DotToken {
21
get { return GetChildByRole (Roles.Dot); }
24
public Identifier Identifier {
25
get { return GetChildByRole(Roles.Identifier); }
26
set { SetChildByRole(Roles.Identifier, value); }
29
public VBTokenNode AssignToken {
30
get { return GetChildByRole (Roles.Assign); }
33
public Expression Expression {
34
get { return GetChildByRole (Roles.Expression); }
35
set { SetChildByRole (Roles.Expression, value); }
38
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
40
return visitor.VisitFieldInitializerExpression(this, data);
43
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
45
FieldInitializerExpression o = other as FieldInitializerExpression;
46
return o != null && this.IsKey == o.IsKey && this.Identifier.DoMatch(o.Identifier, match) && this.Expression.DoMatch(o.Expression, match);