Ejemplo n.º 1
0
        Node Sequence()
        {
            var node = new Node(Operation.Sequence, cs.Accept("+"));

            node.Add(Exclusion());
            while (cs.Accept(".."))
            {
                node.Add(Exclusion());
            }

            return(node);
        }
Ejemplo n.º 2
0
        /*-----------------------------------------------------------------------------------------------
        *
        *	Recursive Descent Parser Stuff :
        *
        *  -----------------------------------------------------------------------------------------------*/

        /// <summary>
        ///
        /// </summary>
        Node Expression(out Target target)
        {
            target = Target.None;
            if (cs.Accept("$pixel"))
            {
                target = Target.PixelShader;
            }
            if (cs.Accept("$vertex"))
            {
                target = Target.VertexShader;
            }
            if (cs.Accept("$geometry"))
            {
                target = Target.GeometryShader;
            }
            if (cs.Accept("$domain"))
            {
                target = Target.DomainShader;
            }
            if (cs.Accept("$hull"))
            {
                target = Target.HullShader;
            }
            if (cs.Accept("$compute"))
            {
                target = Target.ComputeShader;
            }

            if (target != Target.None)
            {
                if (cs.AcceptSpace())
                {
                    return(Combination());
                }
                else
                {
                    return(new Node(""));
                }
            }
            else
            {
                throw new BuildException("Bad shader type");
            }
        }