Posted 10 years ago by KC
Version: 4.0.0289
How can i traverse or otherwise retrieve a list of all keywords for VB within the .Net addon? I.e. I need a list of everything like "If", "Do", "Loop" etc...

I know I can hard code a list... but I would believe there would be a way to get the list from the semantic parser or frrom the .Net addon somehow?

Comments (1)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
We do something like this in our lexer:
for (int index = (int)VBTokenID.KeywordStart + 1; index < (int)VBTokenID.KeywordEnd; index++) {
    string keyword = VBTokenID.GetTokenKey(index).ToLowerInvariant();
    if (keyword.EndsWith("keyword"))
        keyword = keyword.Substring(0, keyword.Length - 7);
    // Add to collection here

Actipro Software Support

The latest build of this product (v21.1.1) was released 12 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.