Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
IndexerExpression.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  /// Indexer expression.
11  /// </summary>
13  {
14  #region Constructors and Destructors
15 
16  /// <summary>
17  /// Initializes a new instance of the <see cref = "IndexerExpression" /> class.
18  /// </summary>
20  {
21  }
22 
23  /// <summary>
24  /// Initializes a new instance of the <see cref="IndexerExpression"/> class.
25  /// </summary>
26  /// <param name="target">
27  /// The target.
28  /// </param>
29  /// <param name="index">
30  /// The index.
31  /// </param>
32  public IndexerExpression(Expression target, Expression index)
33  {
34  this.Target = target;
35  this.Index = index;
36  }
37 
38  #endregion
39 
40  #region Public Properties
41 
42  /// <summary>
43  /// Gets or sets the index.
44  /// </summary>
45  /// <value>
46  /// The index.
47  /// </value>
48  public Expression Index { get; set; }
49 
50  /// <summary>
51  /// Gets or sets the target.
52  /// </summary>
53  /// <value>
54  /// The target.
55  /// </value>
56  public Expression Target { get; set; }
57 
58  #endregion
59 
60  #region Public Methods
61 
62  /// <inheritdoc />
63  public override IEnumerable<Node> Childrens()
64  {
65  ChildrenList.Clear();
66  ChildrenList.Add(Target);
67  ChildrenList.Add(Index);
68  return ChildrenList;
69  }
70 
71  /// <inheritdoc />
72  public override string ToString()
73  {
74  return string.Format("{0}[{1}]", Target, Index);
75  }
76 
77  #endregion
78  }
79 }
IndexerExpression(Expression target, Expression index)
Initializes a new instance of the IndexerExpression class.
override IEnumerable< Node > Childrens()
Gets the child nodes. An enumeration of child nodes
IndexerExpression()
Initializes a new instance of the IndexerExpression class.