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
Public fields | Properties | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected fields | List of all members
Loyc.Ecs.Parser.EcsLexer Class Reference

Lexer for EC# source code (see ILexer{Token}). More...


Source files:
Inheritance diagram for Loyc.Ecs.Parser.EcsLexer:
Loyc.Syntax.Lexing.BaseLexer Loyc.Syntax.Lexing.ILexer< Token > Loyc.Syntax.IIndexToLine

Remarks

Lexer for EC# source code (see ILexer{Token}).

See also
TokensToTree

Public fields

bool AllowNestedComments = false
 
int SpacesPerTab = 4
 

Properties

new ISourceFile SourceFile [get]
 
int IndentLevel [get]
 
UString IndentString [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

 EcsLexer (string text, IMessageSink sink)
 
 EcsLexer (ICharSource text, string fileName, IMessageSink sink, int startPosition=0)
 
void Reset (ICharSource source, string fileName="", int inputPosition=0)
 
Maybe< TokenNextToken ()
 Scans the next token and returns information about it. More...
 
void Restart ()
 
- Public Member Functions inherited from Loyc.Syntax.IIndexToLine
SourcePos IndexToLine (int index)
 Returns the position in a source file of the specified index. More...
 

Static Public Member Functions

static int MeasureIndent (UString indent, int spacesPerTab)
 

Protected Member Functions

override void Error (int lookaheadIndex, string message)
 
new int LA (int i)
 
- Protected Member Functions inherited from Loyc.Syntax.Lexing.BaseLexer
 BaseLexer (ICharSource source, string fileName="", int inputPosition=0, bool newSourceFile=true)
 

Protected fields

Dictionary< UString, object > _idCache = new Dictionary<UString, object>()
 

Member Function Documentation

Maybe<Token> Loyc.Ecs.Parser.EcsLexer.NextToken ( )
inline

Scans the next token and returns information about it.

Returns
The next token, or null at the end of the source file.

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