protected void Reset(CharSource source, ILineColumnFile startingPos = null) { _source = source; _lineOffsets = InternalList <int> .Empty; _lineOffsets.Add(0); _startingPos = startingPos; }
public override string ToString() { if (StartIndex <= 0) { return(string.Format("{0}({1}..{2})", Source.FileName, StartIndex, EndIndex)); } ILineColumnFile start = Start, end = End; return(string.Format(Length > 1 ? "{0}({1},{2},{3},{4})" : "{0}({1},{2})", Source.FileName, start.Line, start.Column, end.Line, end.Column)); }
/// <summary>Initializes CharIndexPositionMapper.</summary> /// <param name="source">An immutable list of characters.</param> /// <param name="startingPos">Optional. The first character of <c>source</c> /// will be considered to have the file name and line number specified by /// this object. If this is null, IndexToLine() will return a blank file /// name ("").</param> public IndexPositionMapper(CharSource source, ILineColumnFile startingPos = null) { Reset(source, startingPos); }
public LexerSourceFile(CharSource source, ILineColumnFile startingPos = null) : base(source, startingPos) { }
public SourceFile(CharSource source, ILineColumnFile startingPos = null) : base(source, startingPos) { _source = source; }