Exemplo n.º 1
0
 /// <summary>
 /// Creates a new CIL instruction encoder.
 /// </summary>
 /// <param name="writer">The output stream to write the encoded instructions to.</param>
 /// <param name="operandBuilder">The object to use for creating raw operands.</param>
 /// <param name="methodBodyName">The name of the method that is being serialized.</param>
 /// <param name="errorListener">The object used for recording error listener.</param>
 public CilAssembler(
     IBinaryStreamWriter writer,
     ICilOperandBuilder operandBuilder,
     string methodBodyName,
     IErrorListener errorListener)
 {
     _writer           = writer ?? throw new ArgumentNullException(nameof(writer));
     _errorListener    = errorListener ?? throw new ArgumentNullException(nameof(errorListener));
     _operandBuilder   = operandBuilder ?? throw new ArgumentNullException(nameof(operandBuilder));
     _diagnosticPrefix = !string.IsNullOrEmpty(methodBodyName)
         ? $"[In {methodBodyName}]: "
         : null;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a new CIL instruction encoder.
 /// </summary>
 /// <param name="writer">The output stream to write the encoded instructions to.</param>
 /// <param name="operandBuilder">The object to use for creating raw operands.</param>
 public CilAssembler(IBinaryStreamWriter writer, ICilOperandBuilder operandBuilder)
     : this(writer, operandBuilder, null, ThrowErrorListener.Instance)
 {
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creates a new CIL instruction encoder.
 /// </summary>
 /// <param name="writer">The output stream to write the encoded instructions to.</param>
 /// <param name="operandBuilder">The object to use for creating raw operands.</param>
 public CilAssembler(IBinaryStreamWriter writer, ICilOperandBuilder operandBuilder)
 {
     _writer         = writer ?? throw new ArgumentNullException(nameof(writer));
     _operandBuilder = operandBuilder ?? throw new ArgumentNullException(nameof(operandBuilder));
 }