In This Article

VBLexer Class

Represents a Visual Basic lexer (lexical analyzer) implementation.

public class VBLexer : DotNetLexerBase, IMergeableLexer, ILexer, IKeyedObject
Inheritance:
object MergeableLexerBase DotNetLexerBase object
Implements:
IMergeableLexer ILexer IKeyedObject

Constructors

VBLexer()

Initializes an instance of the class.

public VBLexer()

Properties

LexicalStates

The collection of lexical states used by this lexer.

public ILexicalStateCollection LexicalStates { get; }

Property Value

ILexicalStateCollection

Methods

GetAllLexicalStateTransitions()

Returns a collection containing all ILexicalStateTransition objects within the lexer.

public override IEnumerable<ILexicalStateTransition> GetAllLexicalStateTransitions()

Returns

IEnumerable<ILexicalStateTransition>

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 MergeableLexerResult from a ITextBufferReader and seeks past it if there is a match.

public override MergeableLexerResult 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

MergeableLexerResult

IsKeyword(string?)

Returns whether the specified identifier is a keyword.

public static 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

Extension Methods