Each token listed with text

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by Joe
Version: 4.0.0285
Avatar
Hi guys,

I have a further question.
Up to now I use this code to write my parsed document in another file.
writer.WriteLine(this.editor.Document.Text);
Unfortunately that's a string and I can not detect each single token, but that's what I want.
I need something like this:
ActiproSoftware.SyntaxEditor.TokenCollection tokenCollection = this.editor.Document.Tokens;
Here I have all the tokens listed in the correct order. But instead of
"[Simple Token: Identifier (0, 11)]" I'd like to have the correct names like it appears in the document. For example: "[Simple Token: FunctionName (0, 11)]".
Is there a way to do this?

Bye

Comments (2)

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

The Tokens give you their type (via Key) but to get the actual document text represented by them you'd have to do a GetSubstring on the document with the token's text range.


Actipro Software Support

Posted 14 years ago by Joe
Avatar
Thanks a lot!
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.