In This Article

VBLexer Class

Represents a Visual Basic lexer (lexical analyzer) implementation.

public class VBLexer : DotNetLexerBase, IMergableLexer, ILexer, IKeyedObject
Inheritance:
object MergableLexerBase DotNetLexerBase object
Implements:
IMergableLexer ILexer IKeyedObject

Constructors

VBLexer()

Initializes a new instance of the VBLexer class.

public VBLexer()

Properties

LexicalStates

Gets the collection of lexical states used by this lexer.

public ILexicalStateCollection LexicalStates { get; }

Property Value

ILexicalStateCollection:

The collection of lexical states used by this lexer.

Methods

GetAllLexicalStateTransitions()

Returns a collection containing all ILexicalStateTransition objects within the lexer.

public override IEnumerable<ILexicalStateTransition> GetAllLexicalStateTransitions()

Returns

IEnumerable<ILexicalStateTransition>:

A collection containing all ILexicalStateTransition objects within the lexer.

Remarks

This method allows consumers to see which language transitions can be made within the lexer.

GetNextToken(ITextBufferReader, ILexicalState)

Performs a lex to return the next MergableLexerResult from a ITextBufferReader and seeks past it if there is a match.

public override MergableLexerResult GetNextToken(ITextBufferReader reader, ILexicalState lexicalState)
Parameter Type Description
reader ITextBufferReader

An ITextBufferReader that is reading a text source.

lexicalState ILexicalState

The ILexicalState that specifies the current state.

Returns

MergableLexerResult:

A MergableLexerResult indicating a lexer result.

IsKeyword(string)

Returns whether the specified identifier is a keyword.

public bool IsKeyword(string identifier)
Parameter Type Description
identifier string

The identifier text.

Returns

bool:

true if the specified identifier is a keyword; otherwise, false.

Remarks

This method doesn't return true for contextual keywords.

Inherited Members