4 using System.Collections.Generic;
7 using SiliconStudio.Shaders.Ast;
8 using SiliconStudio.Shaders.Utility;
10 namespace SiliconStudio.Shaders.
Grammar.Hlsl
12 public partial class HlslGrammar
14 #region Public Methods
22 var list =
new List<T>();
23 FillListFromNodes(node.ChildNodes, list);
29 foreach (var childNode
in nodes)
31 items.Add((TItem)childNode.AstNode);
37 if (node.ChildNodes.Count != 1)
39 return (T)Enum.ToObject(typeof(T), 0);
42 return (T)Enum.Parse(typeof(T), node.ChildNodes[0].Token.Text,
true);
51 var value = Ast<T>(node);
52 value.Name = new Identifier(scalarType.Name) { Span = SpanConverter.Convert(node.Span) };
53 value.Type = scalarType.Type;
54 }) { Rule =
Keyword(scalarType.Name) };