Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ParadoxTypeAnalysis.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 SiliconStudio.Paradox.Shaders.Parser.Ast;
4 using SiliconStudio.Shaders.Analysis.Hlsl;
5 using SiliconStudio.Shaders.Ast;
6 using SiliconStudio.Shaders.Parser;
7 
8 namespace SiliconStudio.Paradox.Shaders.Parser.Analysis
9 {
10  internal class ParadoxTypeAnalysis : HlslSemanticAnalysis
11  {
12  #region Contructor
13 
14  public ParadoxTypeAnalysis(ParsingResult result)
15  : base(result)
16  {
17  SetupHlslAnalyzer();
18  }
19 
20  #endregion
21 
22  public void Run(ShaderClassType shaderClassType)
23  {
24  Visit(shaderClassType);
25  }
26 
27  /// <summary>
28  /// Store if it is a structure type, check if it is a ParadoxType
29  /// </summary>
30  /// <param name="typeName">the TypeName to visit</param>
31  /// <returns>the TypeBase object</returns>
32  [Visit]
33  protected override TypeBase Visit(TypeName typeName)
34  {
35  if (typeName.Name.Text == "Streams")
36  return ParadoxType.Streams;
37  if (typeName.Name.Text == "Constants")
38  return ParadoxType.Constants;
39  if (typeName.Name.Text == "Input")
40  return ParadoxType.Input;
41  if (typeName.Name.Text == "Input2")
42  return ParadoxType.Input2;
43  if (typeName.Name.Text == "Output")
44  return ParadoxType.Output;
45 
46  return base.Visit(typeName);
47  }
48  }
49 }
A Type reference analysis is building type references.
A typeless reference.
Definition: TypeName.cs:10
string Text
Gets or sets the name.
Definition: Identifier.cs:77
global::MonoTouch.Constants Constants
Definition: TouchRunner.cs:42
Base type for all types.
Definition: TypeBase.cs:11
Identifier Name
Gets or sets the type name.
Definition: TypeBase.cs:77