Has anyone been able to debug with VS2005?

Steve Horne stephenwantshornenospam100 at aol.com
Wed Nov 29 12:25:09 PST 2006


On Sat, 11 Nov 2006 23:36:08 -0300, Ary Manzana <ary at esperanto.org.ar>
wrote:

>I plan to support refactoring.

In that case, I hope you don't mind me throwing some general ramblings
your way.

I've been thinking about parsing recently. Not parsing for compilers,
but parsing for documentation/refactoring/whatever where you need to
make sense of incomplete and broken code.

And I've also been thinking about Google-style text searches.

To be specific, I was thinking that you could build an index based on
the tokenized source code, and then search for all points in the code
that match a certain grammar in much the same way that you would
search the index for a regular expression match in a search engine
that supported it.

The index might be a ternary tree, for instance, containing substrings
of the tokenised source from each possible start token. You could
limit those substrings to some small number of tokens to avoid needing
polynomial time to build the index, and to make incremental changes
practical. Anything that matches the first 8 (or whatever) tokens that
are kept in the index, you just refer back to the full tokenised
source to find out how far the matching continues.

Add some Tomita/backtracking/whatever trickery to get past ambiguities
and this sounds to me like a workable method for doing things like
spotting all functions or all variable declarations or whatever in an
incomplete/broken source file with limited context (library headers
etc) available.

It seems to me somehow closer to the way people read code than to
traditional parsing, in that it can basically spot landmark patterns
anywhere in the code without needing to understand the whole of the
source file.

Is this sense, or nonsense?

-- 
Remove 'wants' and 'nospam' from e-mail.



More information about the Digitalmars-d-learn mailing list