Esempio n. 1
0
    public static void Main(string[] args)
    {
        if (args.Length < 1)
        {
            BfUtil.DIE("argv < 1");
        }

        string bfCode = BfUtil.LoadProgram(args[0]);
        //Console.WriteLine(bfCode);

        var gen     = new BfGen();
        var program = gen.Gen(bfCode);

        byte[] memory = new byte[30000];
        program.Invoke(memory);
    }
Esempio n. 2
0
    public static void Main(string[] args)
    {
        if (args.Length < 1)
        {
            BfUtil.DIE("argv < 1");
        }

        string      bfCode    = BfUtil.LoadProgram(args[0]);
        List <BfOp> optimized = translate_program(bfCode);
        //foreach (BfOp op in optimized) {
        //  Console.WriteLine($"op={op.kind}, argument={op.argument}");
        //}

        var gen     = new BfGen();
        var program = gen.Gen(optimized);

        byte[] memory = new byte[30000];
        program.Invoke(memory);
    }