Ejemplo n.º 1
0
        public void Parse(ref string[] program)
        {
            string openbrace = ParseUtils.GetToken(ref program);

            if (!openbrace.Equals("{"))
            {
                throw new ParseException("Found \"" + openbrace + "\", but expected \"{\".");
            }

            string nexttoken = ParseUtils.PeekToken(program);

            while (nexttoken != "}")
            {
                ShaderStatement shaderStatement = new ShaderStatement();
                shaderStatement.Parse(ref program);
                _Statements.Add(shaderStatement);

                nexttoken = ParseUtils.PeekToken(program);
            }

            string closebrace = ParseUtils.GetToken(ref program);
        }
Ejemplo n.º 2
0
        public void Parse(ref string[] program)
        {
            string openbrace = ParseUtils.GetToken(ref program);
            if (!openbrace.Equals("{"))
                throw new ParseException("Found \""+openbrace+"\", but expected \"{\".");

            string nexttoken = ParseUtils.PeekToken(program);

            while (nexttoken != "}")
            {
                ShaderStatement shaderStatement = new ShaderStatement();
                shaderStatement.Parse(ref program);
                _Statements.Add(shaderStatement);

                nexttoken = ParseUtils.PeekToken(program);
            }

            string closebrace = ParseUtils.GetToken(ref program);
        }