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