public static byte[] GenerateCode(string inputFileName, string inputFileContent)
        {
            // Always output a result into the file
            string result;
            try
            {
                var parsingResult = ParadoxShaderParser.TryPreProcessAndParse(inputFileContent, inputFileName);

                if (parsingResult.HasErrors)
                {
                    result = "// Failed to parse the shader:\n" + parsingResult;
                }
                else
                {
                    // Try to generate a mixin code.
                    var shaderKeyGenerator = new ShaderMixinCodeGen(parsingResult.Shader, parsingResult);

                    shaderKeyGenerator.Run();
                    result = shaderKeyGenerator.Text ?? string.Empty;
                }
            }
            catch (Exception ex)
            {
                result = "// Unexpected exceptions occurred while generating the file\n" + ex;
            }

            // We force the UTF8 to include the BOM to match VS default
            var data = Encoding.UTF8.GetBytes(result);
            return Encoding.UTF8.GetPreamble().Concat(data).ToArray();
        }
        /// <summary>
        /// Generates the csharp code from a pdxfx file.
        /// </summary>
        /// <param name="pdxfxShaderCode">The PDXFX shader code.</param>
        /// <param name="filePath">The file path.</param>
        /// <returns>System.String.</returns>
        /// <exception cref="System.InvalidOperationException"></exception>
        public static string GenerateCsharp(string pdxfxShaderCode, string filePath)
        {
            // Compile
            var shader = ParadoxShaderParser.PreProcessAndParse(pdxfxShaderCode, filePath);

            // Try to generate a mixin code.
            var loggerResult       = new LoggerResult();
            var shaderKeyGenerator = new ShaderMixinCodeGen(shader, loggerResult);

            if (shaderKeyGenerator.Run())
            {
                return(shaderKeyGenerator.Text);
            }
            throw new InvalidOperationException(loggerResult.ToString());
        }
        /// <summary>
        /// Generates the csharp code from a pdxfx file.
        /// </summary>
        /// <param name="pdxfxShaderCode">The PDXFX shader code.</param>
        /// <param name="filePath">The file path.</param>
        /// <returns>System.String.</returns>
        /// <exception cref="System.InvalidOperationException"></exception>
        public static string GenerateCsharp(string pdxfxShaderCode, string filePath)
        {
            // Compile
            var shader = ParadoxShaderParser.PreProcessAndParse(pdxfxShaderCode, filePath);

            // Try to generate a mixin code.
            var loggerResult = new LoggerResult();
            var shaderKeyGenerator = new ShaderMixinCodeGen(shader, loggerResult);

            if (shaderKeyGenerator.Run())
            {
                return shaderKeyGenerator.Text;
            }
            throw new InvalidOperationException(loggerResult.ToString());
        }