Exemplo n.º 1
0
 internal override void WriteTo(MethodCodeDataWriterArgs a, bool need0x1DAnd0x37)
 {
     if (need0x1DAnd0x37)
     {
         a.VariableReference.Write(a.Offest);
         a.ExpressionData.Write((byte)0x1D);
         a.ExpressionData.Write((byte)0x38);
     }
     if (Target is In0x38Expression)
     {
         ((In0x38Expression)Target).WriteTo(a, false);
     }
     else
     {
         a.ExpressionData.Write(EplSystemId.Id_NaV);
         a.ExpressionData.Write((byte)0x3A);
         Target.WriteTo(a);
     }
     a.ExpressionData.Write((byte)0x39);
     if (LibraryId == -2)
     {
         a.ExpressionData.Write(MemberId);
         a.ExpressionData.Write(StructId);
     }
     else
     {
         a.ExpressionData.Write(MemberId + 1);
         a.ExpressionData.Write((StructId + 1) & 0xFFFF | (LibraryId + 1) << 16);
     }
     if (need0x1DAnd0x37)
     {
         a.ExpressionData.Write((byte)0x37);
     }
 }
Exemplo n.º 2
0
 internal override void WriteTo(MethodCodeDataWriterArgs a)
 {
     a.ExpressionData.Write((byte)0x23);
     a.ExpressionData.Write((short)(StructId + 1));
     a.ExpressionData.Write((short)(LibraryId + 1));
     a.ExpressionData.Write(MemberId + 1);
 }
Exemplo n.º 3
0
 internal override void WriteTo(MethodCodeDataWriterArgs a)
 {
     using (a.NewBlock(4))
     {
         a.ExpressionData.Write((byte)0x6D);
         foreach (var curCase in Case)
         {
             if (curCase.UnexaminedCode != null)
             {
                 new UnexaminedStatement(curCase.UnexaminedCode, curCase.Mask).WriteTo(a, 0x6E);
             }
             else
             {
                 new ExpressionStatement(new CallExpression(0, 2, new ParamListExpression()
                 {
                     curCase.Condition
                 }), curCase.Mask, curCase.Comment).WriteTo(a, 0x6E);
             }
             curCase.Block.WriteTo(a);
             a.ExpressionData.Write((byte)0x53);
         }
         a.ExpressionData.Write((byte)0x6F);
         DefaultBlock.WriteTo(a);
         a.ExpressionData.Write((byte)0x54);
     }
     a.ExpressionData.Write((byte)0x74);
 }
Exemplo n.º 4
0
 internal void WriteTo(MethodCodeDataWriterArgs a, byte type)
 {
     a.LineOffest.Write(a.Offest);
     if (Expression != null)
     {
         Expression.WriteTo(a, type, Mask, Comment);
     }
     else
     {
         new CallExpression(-1, 0).WriteTo(a, type, Mask, Comment);
     }
 }
Exemplo n.º 5
0
 internal override void WriteTo(MethodCodeDataWriterArgs a, bool need0x1DAnd0x37)
 {
     if (need0x1DAnd0x37)
     {
         a.VariableReference.Write(a.Offest);
         a.ExpressionData.Write((byte)0x1D);
         a.ExpressionData.Write((byte)0x38);
     }
     a.ExpressionData.Write(Id);
     if (need0x1DAnd0x37)
     {
         a.ExpressionData.Write((byte)0x37);
     }
 }
Exemplo n.º 6
0
 internal override void WriteTo(MethodCodeDataWriterArgs a)
 {
     if (LibraryId == -2)
     {
         a.ConstantReference.Write(a.Offest);
         a.ExpressionData.Write((byte)0x1B);
         a.ExpressionData.Write(ConstantId);
     }
     else
     {
         a.ExpressionData.Write((byte)0x1C);
         a.ExpressionData.Write((short)(LibraryId + 1));
         a.ExpressionData.Write((short)(ConstantId + 1));
     }
 }
Exemplo n.º 7
0
 internal void WriteTo(MethodCodeDataWriterArgs a, byte type, bool mask, string comment)
 {
     if (Target != null)
     {
         a.VariableReference.Write(a.Offest);
     }
     if (LibraryId == -2 || LibraryId == -3)
     {
         a.MethodReference.Write(a.Offest);
     }
     a.ExpressionData.Write(type);
     a.ExpressionData.Write(MethodId);
     a.ExpressionData.Write(LibraryId);
     a.ExpressionData.Write((short)(mask ? 0x20 : 0));
     a.ExpressionData.WriteBStr(a.Encoding, null);
     a.ExpressionData.WriteBStr(a.Encoding, "".Equals(comment) ? null : comment);
     if (Target == null)
     {
         a.ExpressionData.Write((byte)0x36);
     }
     else
     {
         if (Target is In0x38Expression)
         {
             a.ExpressionData.Write((byte)0x38);
             ((In0x38Expression)Target).WriteTo(a, false);
             a.ExpressionData.Write((byte)0x37);
         }
         else
         {
             a.ExpressionData.Write((byte)0x38);
             a.ExpressionData.Write(EplSystemId.Id_NaV);
             a.ExpressionData.Write((byte)0x3A);
             Target.WriteTo(a);
             a.ExpressionData.Write((byte)0x37);
         }
     }
     if (ParamList != null)
     {
         ParamList.WriteTo(a);
     }
     else
     {
         ParamListEnd.Instance.WriteTo(a);
     }
 }
Exemplo n.º 8
0
 internal override void WriteTo(MethodCodeDataWriterArgs a)
 {
     using (a.NewBlock(2))
     {
         if (UnexaminedCode != null)
         {
             new UnexaminedStatement(UnexaminedCode, Mask).WriteTo(a, 0x6C);
         }
         else
         {
             new ExpressionStatement(new CallExpression(0, 1, new ParamListExpression()
             {
                 Condition
             }), Mask, Comment).WriteTo(a, 0x6C);
         }
         Block.WriteTo(a);
         a.ExpressionData.Write((byte)0x52);
     }
     a.ExpressionData.Write((byte)0x73);
 }
Exemplo n.º 9
0
 internal override void WriteTo(MethodCodeDataWriterArgs a)
 {
     using (a.NewBlock(3))
     {
         if (UnexaminedCode != null)
         {
             new UnexaminedStatement(UnexaminedCode, MaskOnStart).WriteTo(a, 0x70);
         }
         else
         {
             new ExpressionStatement(new CallExpression(0, 3, new ParamListExpression()
             {
                 Condition
             }), MaskOnStart, CommentOnStart).WriteTo(a, 0x70);
         }
         Block.WriteTo(a);
         a.ExpressionData.Write((byte)0x55);
     }
     new ExpressionStatement(new CallExpression(0, 4, new ParamListExpression()
     {
     }), MaskOnEnd, CommentOnEnd).WriteTo(a, 0x71);
 }
Exemplo n.º 10
0
 internal override void WriteTo(MethodCodeDataWriterArgs a, bool need0x1DAnd0x37)
 {
     if (need0x1DAnd0x37)
     {
         a.VariableReference.Write(a.Offest);
         a.ExpressionData.Write((byte)0x1D);
         a.ExpressionData.Write((byte)0x38);
     }
     if (Target is In0x38Expression)
     {
         ((In0x38Expression)Target).WriteTo(a, false);
     }
     else
     {
         a.ExpressionData.Write(EplSystemId.Id_NaV);
         a.ExpressionData.Write((byte)0x3A);
         Target.WriteTo(a);
     }
     a.ExpressionData.Write((byte)0x3A);
     if (Index is NumberLiteral)
     {
         a.ExpressionData.Write((byte)0x3B);
         a.ExpressionData.Write((int)((NumberLiteral)Index).Value);
     }
     else if (Index is In0x38Expression)
     {
         a.ExpressionData.Write((byte)0x38);
         ((In0x38Expression)Index).WriteTo(a, false);
         a.ExpressionData.Write((byte)0x37);
     }
     else
     {
         Index.WriteTo(a);
     }
     if (need0x1DAnd0x37)
     {
         a.ExpressionData.Write((byte)0x37);
     }
 }
Exemplo n.º 11
0
 internal override void WriteTo(MethodCodeDataWriterArgs a)
 {
     a.MethodReference.Write(a.Offest);
     a.ExpressionData.Write((byte)0x1E);
     a.ExpressionData.Write(MethodId);
 }
Exemplo n.º 12
0
 internal override void WriteTo(MethodCodeDataWriterArgs a) => a.ExpressionData.Write((byte)0x01);
Exemplo n.º 13
0
 internal override void WriteTo(MethodCodeDataWriterArgs a)
 {
     a.ExpressionData.Write((byte)0x19);
     a.ExpressionData.Write(Value.ToOADate());
 }
Exemplo n.º 14
0
 internal override void WriteTo(MethodCodeDataWriterArgs a)
 {
     a.ExpressionData.Write((byte)0x18);
     a.ExpressionData.Write((short)(Value ? -1 : 0));
 }
Exemplo n.º 15
0
 internal override void WriteTo(MethodCodeDataWriterArgs a)
 {
     WriteTo(a, true);
 }
Exemplo n.º 16
0
 internal abstract void WriteTo(MethodCodeDataWriterArgs a, bool need0x1DAnd0x37);
Exemplo n.º 17
0
 internal abstract void WriteTo(MethodCodeDataWriterArgs a);
Exemplo n.º 18
0
 internal override void WriteTo(MethodCodeDataWriterArgs a)
 {
     a.ExpressionData.Write((byte)0x1A);
     a.ExpressionData.WriteBStr(a.Encoding, Value ?? "");
 }
Exemplo n.º 19
0
 internal override void WriteTo(MethodCodeDataWriterArgs a) => WriteTo(a, 0x21, false, string.Empty);