コード例 #1
0
        private void Visit(TaskStatement stmt)
        {
            switch (stmt)
            {
            case ShowTaskStatement show:
                LoadMachine();
                Visit(show.Value);
                IL.Box(typeof(BitsValue));
                IL.Call(typeof(object).GetMethod(nameof(object.ToString)));
                IL.Call(typeof(IMachine).GetMethod(nameof(IMachine.Print)));
                break;

            case PrintTaskStatement print:
                LoadMachine();
                IL.Ldstr(print.Text);
                IL.Call(typeof(IMachine).GetMethod(nameof(IMachine.Print)));
                break;
            }
        }