Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
MemberReferenceExpression.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 using System.Collections;
5 using System.Collections.Generic;
6 
7 namespace SiliconStudio.Shaders.Ast
8 {
9  /// <summary>
10  /// A member reference in the form {this}.{Name}
11  /// </summary>
13  {
14  #region Constructors and Destructors
15 
16  /// <summary>
17  /// Initializes a new instance of the <see cref = "MemberReferenceExpression" /> class.
18  /// </summary>
20  {
21  }
22 
23  /// <summary>
24  /// Initializes a new instance of the <see cref="MemberReferenceExpression"/> class.
25  /// </summary>
26  /// <param name="this">The @this.</param>
27  /// <param name="member">The member.</param>
29  {
30  Target = @this;
31  Member = member;
32  }
33 
34  /// <summary>
35  /// Initializes a new instance of the <see cref="MemberReferenceExpression"/> class.
36  /// </summary>
37  /// <param name="this">The @this.</param>
38  /// <param name="member">The member.</param>
39  public MemberReferenceExpression(Expression @this, string member)
40  {
41  Target = @this;
42  Member = new Identifier(member);
43  }
44 
45 
46  #endregion
47 
48  #region Public Properties
49 
50  /// <summary>
51  /// Gets or sets the member.
52  /// </summary>
53  /// <value>
54  /// The member.
55  /// </value>
56  public Identifier Member { get; set; }
57 
58  /// <summary>
59  /// Gets or sets the this.
60  /// </summary>
61  /// <value>
62  /// The this.
63  /// </value>
64  public Expression Target { get; set; }
65 
66  #endregion
67 
68  #region Public Methods
69 
70  /// <inheritdoc />
71  public override IEnumerable<Node> Childrens()
72  {
73  ChildrenList.Clear();
74  ChildrenList.Add(Target);
75  ChildrenList.Add(Member);
76  return ChildrenList;
77  }
78 
79  /// <inheritdoc />
80  public override string ToString()
81  {
82  return string.Format("{0}.{1}", Target, Member);
83  }
84 
85  #endregion
86  }
87 }
MemberReferenceExpression(Expression @this, Identifier member)
Initializes a new instance of the MemberReferenceExpression class.
MemberReferenceExpression(Expression @this, string member)
Initializes a new instance of the MemberReferenceExpression class.
override IEnumerable< Node > Childrens()
Gets the child nodes. An enumeration of child nodes
A member reference in the form {this}.{Name}
MemberReferenceExpression()
Initializes a new instance of the MemberReferenceExpression class.