Пример #1
0
        public static string PrintAssembledBytecode(List <SourceFile> sources)
        {
            var bytecode = Shovel.Api.GetBytecode(sources);

            Utils.DecorateByteCode(bytecode, sources);
            return(PrintAssembledBytecode(bytecode));
        }
Пример #2
0
        public static string PrintRawBytecode(List <SourceFile> sources, bool optimize = false)
        {
            var bytecode = Utils.GetRawBytecode(sources);

            if (optimize)
            {
                bytecode = Compiler.RawBytecodeOptimizations.Optimize(bytecode);
            }
            Utils.DecorateByteCode(bytecode, sources);
            var sb = new StringBuilder();

            foreach (var instruction in bytecode)
            {
                sb.Append(instruction.ToString());
            }
            return(sb.ToString());
        }