Exemplo n.º 1
0
        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;
                }
            }
        }
Exemplo n.º 2
0
 public override bool IsMe(iAst src) => src is PushStmt;
Exemplo n.º 3
0
 public override bool IsMe(iAst src) => src is AddStmt;
Exemplo n.º 4
0
 public override void Assemble(iAst src, ref ByteCodeWriter bcw)
 {
     bcw.Add();
 }