Enhanced C#
Language of your choice: library documentation
Properties | Public Member Functions | Protected fields | List of all members
Loyc.Syntax.SourceFile< CharSource > Class Template Reference

A default implementation of ISourceFile based on IndexPositionMapper. More...


Source file:
Inheritance diagram for Loyc.Syntax.SourceFile< CharSource >:
Loyc.Syntax.IndexPositionMapper< CharSource > Loyc.Syntax.ISourceFile Loyc.Syntax.IIndexPositionMapper Loyc.Syntax.IIndexPositionMapper Loyc.Syntax.IIndexToLine Loyc.Syntax.IIndexToLine Loyc.Syntax.IHasFileName Loyc.Syntax.IHasFileName Loyc.Syntax.Lexing.LexerSourceFile< CharSource >

Remarks

A default implementation of ISourceFile based on IndexPositionMapper.

Type Constraints
CharSource :ICharSource 

Properties

CharSource Text [get]
 
- Properties inherited from Loyc.Syntax.IndexPositionMapper< CharSource >
string? FileName [get]
 
int LineCount [get]
 
- Properties inherited from Loyc.Syntax.IHasFileName
string FileName [get]
 
- Properties inherited from Loyc.Syntax.ISourceFile
ICharSource Text [get]
 

Public Member Functions

 SourceFile (CharSource source, ILineColumnFile startingPos=null)
 
 SourceFile (CharSource source, string fileName)
 
 SourceFile (ICharSource source, ILineColumnFile startingPos=null)
 
 SourceFile (ICharSource source, string fileName)
 
- Public Member Functions inherited from Loyc.Syntax.IndexPositionMapper< CharSource >
 IndexPositionMapper (CharSource source, ILineColumnFile startingPos=null)
 Initializes CharIndexPositionMapper. More...
 
 IndexPositionMapper (CharSource source, string fileName)
 
LineColumnFile IndexToLine (int index)
 Returns the position in a source file of the specified index. More...
 
int LineToIndex (int lineNo)
 Returns the index in a source file of the beginning of the specified line, where the first line is number 1, not 0. More...
 
int LineToIndex (ILineAndColumn pos)
 
 IndexPositionMapper (IListSource< char > source, SourcePos startingPos=null)
 
 IndexPositionMapper (IListSource< char > source, string fileName)
 

Protected fields

new CharSource _source
 
- Protected fields inherited from Loyc.Syntax.IndexPositionMapper< CharSource >
CharSource _source
 
InternalList< int > _lineOffsets = InternalList<int>.Empty
 
bool _offsetsComplete = false
 
ILineColumnFile _startingPos = null
 

Additional Inherited Members

- Protected Member Functions inherited from Loyc.Syntax.IndexPositionMapper< CharSource >
void Reset (CharSource source, string fileName)
 Reinitializes the object (as though the constructor were called again). More...
 
void Reset (CharSource source, ILineColumnFile startingPos=null)
 
LineColumnFile NewSourcePos (int Line, int PosInLine)
 
void ReadUntilAfter (int toIndex)
 
bool AdvanceAfterNextNewline (ref int index)