Re: Upload-Plugin
Alexander Dymo <[email protected]> Tue, 12 Feb 2008 17:23:32 +0200
| Newsgroups | gmane.comp.kde.devel.quanta |
|---|---|
| Message-ID | <[email protected]> |
On Tuesday 12 February 2008 11:04:11 Eric Laffoon wrote: > > > kdevplatform has a parser-infrastructure too - is this used in any > > > way? > > No. > What about what Alex said way back in Germany 4 years ago when we first > discussed this? He said the parsers could integrate. It seemed hard for me > to believe and I think impossible for you. I think they would need to be > pluggable, and I can't imagine inversely pluggable parsers. However it's > not inconceviable to have modular parsing. Different parsers synchronizing > I think would be a nightmare of threads. Here is what we have in kdev4 infrastructure now... Each source file can be parsed by different parsers - it's the matter of setting the mime type in the language plugin. For example, theoretically ruby, javascript and html language plugins could define "rhtml" as supported extension. In this case foo.rhtml (ruby + html) would be parsed by 3 different parsers (in 3 different threads). The problem here is that each such parser should be able to parse only relevant portions of the file, ignoring the others. Another (possible) problem is that parsers will work without any synchronizations. This means that for the source file you'll get separate AST's (one for ruby code, one for html code and one for javascript code in my example). So there should be either the dedicated code to merge AST's (dunno how hard to implement) or the dedicated parser "controller" which would break the source file into parts and parse them with different parsers (IMHO hard to implement). I don't know if that is of any help to you guys right now. Let me know what you'd need here.