Going through every token/word on every line

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by John Youren
Avatar
Hi,

I am after a method of
1). Going through every line in the document
2). Going through every word/token in the document

as I am writing a wizard that looks for variables that start with a number

the code would look something like

For i as int16 = 0 to rows.count - 1
for j as int16 = 0 to row(i).words.count - 1
// Do code with row(i).words.item(J)
next j
next


Would someone show me how this is done, thank you!

Comments (1)

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

That's exactly what a TokenStream is for. The "Parsing Guide / Lexical Parsing" topic tells you how to get a TokenStream. Then just use its methods to navigate through the Token objects in a Document.


Actipro Software Support

The latest build of this product (v2020.1 build 0400) was released 28 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.