An exaggeration, or is it? 1. c-to-python can convert an entire tree of nodes in a matter of seconds. I've already created the source tree using the newly- improved import @auto script.
Of course, this will almost certainly reveal new problems with c-to- python, so "the day" will be delayed a bit :-) 2. For purposes of prototyping and testing, we can ignore CPP, swig's enhanced C preprocessor. That is, we can assume that the swig unit tests run on the output of CPP. Of course, there will be unit tests for CPP itself "later". Or we could just pipe CPP's output... 3. As stated in the Swig Master Class, the essence of swig is the creation of type tables from C type declarations. This is a well- defined task. It should be easy to find the code that does this. We can concentrate on this code! Furthermore, swig's debug-tags option offers us a “way in” to this code. Crucially, it can form the basis of unit tests. Almost everything else in swig could be ignored initially. 4. Following the extreme programming model, you could say that all we have to do is develop a framework for running unit tests of the code. Leo is a great environment for that. This environment will increase energy: we will be doing real work almost instantly. 5. I am tempted to ignore the existing parser entirely. It's not such a crazy idea! All we need is a parser that allows us to create type tables! Writing unit tests for such a parser would be straightforward. Tokenizing C code for swig is trivial. I can use a simplified version of the existing tokenizer: the tokenizer can eliminate whitespace and comments because the parser never changes source code. Unlike c-to- python, using tokens is natural because the source code never changes. All the bison/parser code would disappear. Of course, I would then have to create my own parser, but notice, the parser can concentrate only on declarations. In other words, we can stay much “closer” to the type tables than in a traditional tables. Yes, this is a blue-sky idea, but I could, in fact, get started on it *today*. I'm not going to do that: I want to improve c-to-python (and other tools) first. I also want to finish my study of the Swig Master Class. However, "the day" is not so far off... Edward P.S. Similar remarks apply, even more strongly, to converting swig's enhanced CPP. EKR -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
