Re: Upload-Plugin
"Niko Sams" <[email protected]> Fri, 15 Feb 2008 20:46:22 +0100
| Newsgroups | gmane.comp.kde.devel.quanta |
|---|---|
| Message-ID | <[email protected]> |
On Feb 12, 2008 4:23 PM, Alexander Dymo <[email protected]> wrote: > 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). Actually I don't know a thing about parsers. But if there is a parser for ruby+html+javascript in kdevplatform - it must be possible to reuse at least the html and javasript parts and other parts probably for php+html+javascript+css in quanta4. Niko