Each token listed with text

SyntaxEditor for Windows Forms Forum

Posted 9 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 9 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 9 years ago by Joe
Avatar
Thanks a lot!
The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.