Question about TokenIDType

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by Greg Shaffer - Boulder
Avatar
Hi Again,

I think I followed the directions for the TokenIDType name, yet when I step through my program none of the IDs are set.

1) I create an enum like this:

public enum ETypeID
{
DefaultToken,
CommentWordToken,
...
}

2) I set the SyntaxLanguage's TokenIDType

SyntaxLanguage.TokenIDType = typeof(ETypeID);

Based on the directions in the documention (which describes a TokenIDTypeName), I'm not sure what I did wrong. The enum values I've defined match the values in the default C# language.

What am I missing?

Thanks,
Greg

Comments (5)

Posted 14 years ago by Greg Shaffer - Boulder
Avatar
Hey,

Nevermind.

I guess it is not as easy as that. It would be nice if you didn't have to add a tag to your language file, and if you could just set the IDs for the items wanted by setting the TokenIDType.

-Greg
Posted 14 years ago by Greg Shaffer - Boulder
Avatar
I do have a question:

Instead of making programmers add a tag to the XML file for token ID type name, why can't you check to see if the TokenIDType is defined and use it to initialize the token ids after the XML has been read? Or, perform a match routine in the TokenIDType setter?

Is this not possible?

Thanks,
Greg
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Greg,

Right now it only loads the IDs from the TokenIDType if it is specified in the XML, as you figured out. Setting it at run-time does nothing.

I'll add something to the TODO list for adding a method to rebind the IDs at run-time.


Actipro Software Support

Posted 14 years ago by Greg Shaffer - Boulder
Avatar
That sounds good.

I could not find any use of this feature in the TestApplication. Is implementing this in the TestApplication on the TODO list?

Also, since you provide default language definitions in XML, is it possible to provide a default Token and State ID enums or classes? I'm sure that CodeSmith is great, but I'm in the camp where I don't fiddle with the language definition so having to generate an ID class on my own is not ideal.

Thanks,
Greg
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We'll add it to the TODO list to add to the sample application. That would help everyone get an idea on how to use them.


Actipro Software Support

The latest build of this product (v2018.1 build 0342) was released 11 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.