On 06/03/07, SPE Stani's Python Editor <[EMAIL PROTECTED]> wrote:
On 3/6/07, Ali Afshar <[EMAIL PROTECTED]> wrote: > > On 05/03/07, SPE Stani's Python Editor <[EMAIL PROTECTED]> wrote: > > Hi All, > > Hi All, > > I have been playing with this demo, and it is very nice. Good work! > > > - The hierarchy is extracted in a recursive data class Node by the > > scintilla editor of which the root is passed to a wxTreeCtrl. So this > > should make easy to port it to other gui toolkits which have a > > scintilla control. > > Unfortunately, we don't have the scintilla control in PyGTK (well we > do, but we are forced to maintain it ourselves, and we never want to > be bound to use it). I am guessing the crux of the parsing etc is done > by the lexer for the editor, and then extracted. Unfortunately this > would be no good for non-scintilla based applications. > > Has anyone done any work on creating a generic parser in Python, or > any other language with Python bindings? Or has anyone got any > knowledge about taking the parser out of Scintilla and running it > independently of the UI? > > Thanks, > > Ali Maybe, based on scintilla there is silvercity: http://silvercity.sourceforge.net/ but it is not 100% python as it uses C code from scintilla. However I think it is available multiplatform. But I don't know if it also exports the folding capacity of scintilla. Brian Quinlan the developer of silvercity is on this list, so maybe he can answer. Brian, are you there? And otherwise there is pygments but I also don't know if it does folding or parsing. Otherwise you have some generic ast modules in the stdlib but also from logilab. Ast can be very interesting, but I wonder if it works with code with syntax errors, which is quite normal when you are editing and did not finish typingyour line. If you look at them it would be good to share your thoughts. I think that parsing (well if we don't use scintilla) is something we could share and develop together. A good parser is the core of a good IDE. Than again the advantage of silvercity/scintilla is that it is *generic* for a lot of languages besides python if your editor aims not to be solely a python editor. Maybe we can write a common api on scintilla and silvercity, which is of course an extra dependency. On Linux this is not really a problem as your package manager takes care of it. On windows if you use py2exe it is also not an issue, except for increasing your download size.
Thanks, I shall investigate all that stuff.
Another question is if silvercity works with Mac. I guess gtk will run on Mac in future and for now I see pida only supports linux and windows if I am not wrong.
It barely runs on windows (which is poor design on my part since my real-life work is all PyGTK on Windows), and runs under Mac using X, but not really natively (yet). Ali
