コード例 #1
0
ファイル: LoadAsm.cs プロジェクト: Deathme2/PopCube
        public override void Assemble(iAst src, ref ByteCodeWriter bcw)
        {
            var x = src as PushStmt;

            if (string.IsNullOrEmpty(x.Type))
            {
                bool isString = false;
                foreach (var i in x.RawValue)
                {
                    if (!char.IsDigit(i))
                    {
                        isString = true;
                        break;
                    }
                }


                if (isString)
                {
                    bcw.LoadString(x.RawValue);
                }
                else
                {
                    bcw.LoadI32(Convert.ToInt32(x.RawValue));
                }
            }
            else
            {
                switch (x.Type)
                {
                case "i8":
                    bcw.LoadI8(Convert.ToSByte(x.RawValue));
                    break;
                }
            }
        }
コード例 #2
0
ファイル: LoadAsm.cs プロジェクト: Deathme2/PopCube
 public override bool IsMe(iAst src) => src is PushStmt;
コード例 #3
0
 public override bool IsMe(iAst src) => src is AddStmt;
コード例 #4
0
 public override void Assemble(iAst src, ref ByteCodeWriter bcw)
 {
     bcw.Add();
 }