Example #1
0
 private Expression GetLexicalPad(LexicalInfo info)
 {
     return Expression.MakeIndex(
         Pad, Pad.Type.GetProperty("Item"),
         new Expression[] { Expression.Constant(info.Index) });
 }
Example #2
0
 private Expression GetLexicalPadValue(LexicalInfo info)
 {
     return Expression.Convert(
         Expression.Call(
             Pad,
             typeof(P5ScratchPad).GetMethod(MethodForSlot(info.Slot)),
             Runtime,
             Expression.Constant(info.Index)),
         TypeForSlot(info.Slot));
 }
Example #3
0
        public static LexicalInfo ReadLexical(BinaryReader reader)
        {
            var info = new LexicalInfo();

            info.Level = reader.ReadInt32();
            info.Index = reader.ReadInt32();
            info.OuterIndex = reader.ReadInt32();
            info.Name = ReadString(reader);
            info.Slot = (Opcode.Sigil)reader.ReadByte();
            info.InPad = reader.ReadByte() != 0;
            info.FromMain = reader.ReadByte() != 0;

            return info;
        }