Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ParadoxTypeCleaner.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.Shaders.Ast;
4 using SiliconStudio.Shaders.Visitor;
5 
6 namespace SiliconStudio.Paradox.Shaders.Parser.Mixins
7 {
8  internal class ParadoxTypeCleaner : ShaderVisitor
9  {
10  public ParadoxTypeCleaner()
11  : base(false, false)
12  {
13  }
14 
15  public void Run(Shader shader)
16  {
17  Visit(shader);
18  }
19 
20  [Visit]
21  protected void Visit(Expression expression)
22  {
23  expression.TypeInference.Declaration = null;
24  expression.TypeInference.TargetType = null;
25  expression.TypeInference.ExpectedType = null;
26  Visit((Node)expression);
27  }
28 
29  [Visit]
30  protected void Visit(TypeBase typeBase)
31  {
32  typeBase.TypeInference.Declaration = null;
33  typeBase.TypeInference.TargetType = null;
34  typeBase.TypeInference.ExpectedType = null;
35  Visit((Node)typeBase);
36  }
37  }
38 }
Abstract node.
Definition: Node.cs:15
Base type for all types.
Definition: TypeBase.cs:11
Toplevel container of a shader parsing result.
Definition: Shader.cs:12
document false