Enhanced C#
Language of your choice: library documentation
Properties | Public Member Functions | List of all members
Loyc.Syntax.Lexing.ILexer< Token > Interface Template Reference

A standard interface for lexers. More...


Source file:
Inheritance diagram for Loyc.Syntax.Lexing.ILexer< Token >:
Loyc.Syntax.IIndexToLine Loyc.Syntax.IHasFileName Loyc.Ecs.Parser.EcsLexer Loyc.Syntax.Les.Les2Lexer Loyc.Syntax.Les.Les3Lexer Loyc.Syntax.Lexing.BaseILexer< CharSrc, Token > Loyc.Syntax.Lexing.LexerWrapper< Token > Loyc.Syntax.Lexing.TokenListAsLexer Loyc.Ecs.Parser.EcsPreprocessor Loyc.Syntax.Lexing.IndentTokenGenerator< Token > Loyc.Syntax.Lexing.TokensToTree Loyc.Syntax.Lexing.TriviaSaver Loyc.Syntax.Lexing.WhitespaceFilter< Token >

Remarks

A standard interface for lexers.

Template Parameters
TokenType of tokens produced by the lexer (usually Loyc.Syntax.Lexing.Token).

Properties

ISourceFile SourceFile [get]
 The file being lexed. More...
 
IMessageSink ErrorSink [get, set]
 Event handler for errors. More...
 
int IndentLevel [get]
 Indentation level of the current line. This is updated after scanning the first whitespaces on a new line, and may be reset to zero when NextToken() returns a newline. More...
 
UString IndentString [get]
 Gets a string slice that holds the spaces or tabs that were used to indent the current line. More...
 
int LineNumber [get]
 Current line number (1 for the first line). More...
 
int InputPosition [get]
 Current input position (an index into SourceFile.Text). More...
 
- Properties inherited from Loyc.Syntax.IHasFileName
string FileName [get]
 

Public Member Functions

Maybe< TokenNextToken ()
 Scans the next token and returns information about it. More...
 
- Public Member Functions inherited from Loyc.Syntax.IIndexToLine
ILineColumnFile IndexToLine (int index)
 Returns the position in a source file of the specified index. More...
 

Member Function Documentation

◆ NextToken()

Property Documentation

◆ ErrorSink

Event handler for errors.

◆ IndentLevel

int Loyc.Syntax.Lexing.ILexer< Token >.IndentLevel
get

Indentation level of the current line. This is updated after scanning the first whitespaces on a new line, and may be reset to zero when NextToken() returns a newline.

◆ IndentString

Gets a string slice that holds the spaces or tabs that were used to indent the current line.

◆ InputPosition

int Loyc.Syntax.Lexing.ILexer< Token >.InputPosition
get

Current input position (an index into SourceFile.Text).

Referenced by Loyc.Syntax.Les.Les2Lexer.NextToken(), and Loyc.Syntax.Les.Les3Lexer.NextToken().

◆ LineNumber

int Loyc.Syntax.Lexing.ILexer< Token >.LineNumber
get

Current line number (1 for the first line).

◆ SourceFile

The file being lexed.

This property should never be null.

Referenced by Loyc.Syntax.Les.Les3LanguageService.Parse(), Loyc.Syntax.Les.Les2LanguageService.Parse(), and Loyc.Ecs.EcsLanguageService.Parse().