コード例 #1
0
 /** Copy Constructor for a known source location. */
 public SourceLocation(ISourceLocation location) {
   this(
       location.getSourcePath(),
       location.getStart(),
       location.getEnd(),
       location.getLine(),
       location.getColumn());
 }
コード例 #2
0
 /**
  * Span the location range from {@code start} to {@code end}.
  *
  * @param start Start location.
  * @param end End location.
  */
 public final void span(ISourceLocation start, ISourceLocation end) {
   setSourcePath(start.getSourcePath());
   setStart(start.getStart());
   setEnd(end.getEnd());
   setLine(start.getLine());
   setColumn(start.getColumn());
   setEndLine(end.getEndLine());
   setEndColumn(end.getEndColumn());
 }
コード例 #3
0
  /** Copies source location information from another instance into this instance. */
  public final void setSourceLocation(ISourceLocation src) {
    assert src != null : "source location can't be null";

    this.start = src.getStart();
    this.end = src.getEnd();
    this.line = src.getLine();
    this.column = src.getColumn();
    this.endLine = src.getEndLine();
    this.endColumn = src.getEndColumn();
    this.sourcePath = src.getSourcePath();
  }