Probably a dumb question

SyntaxEditor Brainstorming Forum

Posted 15 years ago by Matt Whitfield
Avatar
I've just been looking at the code refactored in my app for when the new SE comes along in it's WinForms guise - and I have been using TokenStreams to avoid iterating through the Tokens collection, such that the Tokens collection isn't needed.

But...

I can't find a way to get a TokenStream initialised without referencing the Tokens collection in some way. Am I missing something?

Comments (4)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Matt,

Internally the TokenStream works off of the Tokens collection, so that is unavoidable. TextStream does too.

In the new object model, there is only an ITextSnapshotReader, which is basically the same thing as TextStream but with a few more methods. It can iterate tokens however the tokens it iterates are generated on demand instead of being persisted in memory.


Actipro Software Support

Posted 15 years ago by Matt Whitfield
Avatar
Ok thanks.

I know i'm not on the 'allowed' list of people for testing because I'm not a WPF customer - but would it be possible for me to have early access to the documentation so I can read up?

And is it still the case that the Tokens collection is 'optional' which means that the lexical parsing parses on demand if the collection is not used?
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Matt,

We only have class library docs at this point, nothing else, so it probably wouldn't be too useful for you. The newer design doesn't store tokens at all, it's not an option. But as mentioned the interface you use to read through text and tokens is about the same as the current TextStream object, so that is a good one to use for less future conversion.


Actipro Software Support

Posted 15 years ago by Matt Whitfield
Avatar
Ok brilliant :) Thanks very much :)