Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
DeclarationStatement.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 declaration inside a statement.
11  /// </summary>
13  {
14  #region Constructors and Destructors
15 
16  /// <summary>
17  /// Initializes a new instance of the <see cref = "DeclarationStatement" /> class.
18  /// </summary>
20  {
21  }
22 
23  /// <summary>
24  /// Initializes a new instance of the <see cref="DeclarationStatement"/> class.
25  /// </summary>
26  /// <param name="content">
27  /// The content.
28  /// </param>
29  public DeclarationStatement(Node content)
30  {
31  Content = content;
32  }
33 
34  #endregion
35 
36  #region Public Properties
37 
38  /// <summary>
39  /// Gets or sets the content.
40  /// </summary>
41  /// <value>
42  /// The content.
43  /// </value>
44  public Node Content { get; set; }
45 
46  #endregion
47 
48  #region Public Methods
49 
50  /// <inheritdoc />
51  public override IEnumerable<Node> Childrens()
52  {
53  ChildrenList.Clear();
54  ChildrenList.Add(Content);
55  return ChildrenList;
56  }
57 
58  /// <inheritdoc />
59  public override string ToString()
60  {
61  return string.Format("{0};", Content == null ? string.Empty : Content.ToString());
62  }
63 
64  #endregion
65  }
66 }
DeclarationStatement(Node content)
Initializes a new instance of the DeclarationStatement class.
override IEnumerable< Node > Childrens()
Gets the child nodes. An enumeration of child nodes
DeclarationStatement()
Initializes a new instance of the DeclarationStatement class.
Abstract node.
Definition: Node.cs:15
Base root class for all statements.
Definition: Statement.cs:11