コード例 #1
0
ファイル: IndexPositionMapper.cs プロジェクト: dadhi/ecsharp
 protected void Reset(CharSource source, ILineColumnFile startingPos = null)
 {
     _source      = source;
     _lineOffsets = InternalList <int> .Empty;
     _lineOffsets.Add(0);
     _startingPos = startingPos;
 }
コード例 #2
0
ファイル: SourceRange.cs プロジェクト: dadhi/ecsharp
        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));
        }
コード例 #3
0
ファイル: IndexPositionMapper.cs プロジェクト: dadhi/ecsharp
 /// <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);
 }
コード例 #4
0
 public LexerSourceFile(CharSource source, ILineColumnFile startingPos = null) : base(source, startingPos)
 {
 }
コード例 #5
0
 public SourceFile(CharSource source, ILineColumnFile startingPos = null) : base(source, startingPos)
 {
     _source = source;
 }