Esempio n. 1
0
        public void Write(BytecodeWriter writer)
        {
            if (Operands.Count == 0)
            {
                return;
            }

            Operands[0].Write(writer);

            foreach (var operand in Operands.Skip(1))
            {
                writer.Write(operand.FirstValue);
                operand.Write(writer);
            }
        }
Esempio n. 2
0
        private int[] GenerateBytecode(int bytecodeLength)
        {
            var writer = new BytecodeWriter(bytecodeLength);

            foreach (var instruction in AllInstructions())
            {
#if DEBUG
                //instruction.Print();

                if (instruction.Offset != writer.Offset)
                {
                    throw new InvalidOperationException("Writer is not at the correct position for instruction.");
                }
#endif

                instruction.Write(writer);
            }

            return(writer.GetBuffer());
        }
Esempio n. 3
0
 public void Write(BytecodeWriter writer)
 {
     _lazy.Value.Write(writer);
 }
Esempio n. 4
0
 public void Write(BytecodeWriter writer) => throw new NotSupportedException();
Esempio n. 5
0
 public void Write(BytecodeWriter writer)
 {
 }
Esempio n. 6
0
 public void Write(BytecodeWriter writer) => writer.Write(Id);