Enhanced C#
Language of your choice: library documentation

Documentation moved to ecsharp.net

GitHub doesn't support HTTP redirects, so you'll be redirected in 3 seconds.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Properties | Public Member Functions | Protected Member Functions | Protected fields | List of all members
Loyc.Syntax.Lexing.LexerWrapper< Token > Class Template Referenceabstract

A base class for wrappers that modify lexer behavior. Implements the ILexer interface, except for the NextToken() method. More...


Source file:
Inheritance diagram for Loyc.Syntax.Lexing.LexerWrapper< Token >:
Loyc.Syntax.Lexing.ILexer< Token > Loyc.Syntax.IIndexToLine Loyc.Ecs.Parser.CommentSaver Loyc.Ecs.Parser.EcsPreprocessor Loyc.Syntax.Lexing.IndentTokenGenerator< Token > Loyc.Syntax.Lexing.TokensToTree Loyc.Syntax.Lexing.WhitespaceFilter< Token > Loyc.Syntax.Les.LesIndentTokenGenerator

Remarks

A base class for wrappers that modify lexer behavior. Implements the ILexer interface, except for the NextToken() method.

Properties

ILexer< TokenLexer [get, set]
 
ISourceFile SourceFile [get]
 
virtual IMessageSink ErrorSink [get, set]
 
int IndentLevel [get]
 
UString IndentString [get]
 
int LineNumber [get]
 
int InputPosition [get]
 
- Properties inherited from Loyc.Syntax.Lexing.ILexer< Token >
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...
 

Public Member Functions

 LexerWrapper (ILexer< Token > sourceLexer)
 
abstract Maybe< TokenNextToken ()
 Returns the next (postprocessed) token. This method should set the _current field to the returned value. More...
 
SourcePos IndexToLine (int index)
 Returns the position in a source file of the specified index. More...
 
virtual void Reset ()
 

Protected Member Functions

void WriteError (int index, string msg, params object[] args)
 

Protected fields

Maybe< Token_current
 

Member Function Documentation

SourcePos Loyc.Syntax.Lexing.LexerWrapper< Token >.IndexToLine ( int  index)
inline

Returns the position in a source file of the specified index.

If index is negative, this should return a SourcePos where Line and PosInLine are zero (signifying an unknown location). If index is beyond the end of the file, this should retun the final position in the file.

Implements Loyc.Syntax.IIndexToLine.

abstract Maybe<Token> Loyc.Syntax.Lexing.LexerWrapper< Token >.NextToken ( )
pure virtual

Returns the next (postprocessed) token. This method should set the _current field to the returned value.

Implements Loyc.Syntax.Lexing.ILexer< Token >.

Implemented in Loyc.Ecs.Parser.CommentSaver, Loyc.Syntax.Lexing.IndentTokenGenerator< Token >, Loyc.Ecs.Parser.EcsPreprocessor, Loyc.Syntax.Lexing.TokensToTree, and Loyc.Syntax.Lexing.WhitespaceFilter< Token >.