/// <summary>
 /// Allocates a source location that spans entire derived source document, but that delays computing this.Length until needed so that the document can be streamed.
 /// </summary>
 /// <param name="derivedSourceDocument"></param>
 public SourceLocationSpanningEntireDerivedSourceDocument(IDerivedSourceDocument derivedSourceDocument)
   : base(derivedSourceDocument, 0, 0) {
 }
 /// <summary>
 /// Allocates a range of source text that corresponds to an identifiable entity.
 /// </summary>
 /// <param name="derivedSourceDocument">The document containing the source text of which this location is a subrange.</param>
 /// <param name="startIndex">The character index of the first character of this location, when treating the source document as a single string.</param>
 /// <param name="length">The number of characters in this source location.</param>
 public DerivedSourceLocation(IDerivedSourceDocument derivedSourceDocument, int startIndex, int length)
   : base(startIndex, length)
   //^ requires startIndex >= 0 && startIndex <= derivedSourceDocument.Length;
   //^ requires length >= 0 && length <= derivedSourceDocument.Length;
   //^ requires (startIndex + length) <= derivedSourceDocument.Length;
 {
   this.derivedSourceDocument = derivedSourceDocument;
 }
Ejemplo n.º 3
0
    /// <summary>
    /// Allocates a range of source text that corresponds to an identifiable entity.
    /// </summary>
    /// <param name="derivedSourceDocument">The document containing the source text of which this location is a subrange.</param>
    /// <param name="startIndex">The character index of the first character of this location, when treating the source document as a single string.</param>
    /// <param name="length">The number of characters in this source location.</param>
    public DerivedSourceLocation(IDerivedSourceDocument derivedSourceDocument, int startIndex, int length)
      : base(startIndex, length) {
      Contract.Requires(derivedSourceDocument != null);
      //Contract.Requires(startIndex >= 0 && startIndex <= derivedSourceDocument.Length);
      //Contract.Requires(length >= 0 && length <= derivedSourceDocument.Length);
      //Contract.Requires((startIndex + length) <= derivedSourceDocument.Length);

      this.derivedSourceDocument = derivedSourceDocument;
    }
Ejemplo n.º 4
0
 /// <summary>
 /// Allocates a source location that spans entire derived source document, but that delays computing this.Length until needed so that the document can be streamed.
 /// </summary>
 /// <param name="derivedSourceDocument"></param>
 public SourceLocationSpanningEntireDerivedSourceDocument(IDerivedSourceDocument derivedSourceDocument)
   : base(derivedSourceDocument, 0, 0) {
   Contract.Requires(derivedSourceDocument != null);
 }
Ejemplo n.º 5
0
 //^ requires startIndex >= 0 && startIndex <= derivedSourceDocument.Length;
 //^ requires length >= 0 && length <= derivedSourceDocument.Length;
 //^ requires (startIndex + length) <= derivedSourceDocument.Length;
 /// <summary>
 /// Allocates a range of source text that corresponds to an identifiable entity.
 /// </summary>
 /// <param name="derivedSourceDocument">The document containing the source text of which this location is a subrange.</param>
 /// <param name="startIndex">The character index of the first character of this location, when treating the source document as a single string.</param>
 /// <param name="length">The number of characters in this source location.</param>
 public DerivedSourceLocation(IDerivedSourceDocument derivedSourceDocument, int startIndex, int length)
     : base(startIndex, length)
 {
     this.derivedSourceDocument = derivedSourceDocument;
 }