javasupport

Richard Dale Richard_Dale at tipitina.demon.co.uk
Mon Jun 4 09:27:00 UTC 2001


On Sun, 03 Jun 2001, Bernd Gehrmann wrote:
> On Sun, 3 Jun 2001, Richard Dale wrote:
> > BTW - what does the new ctags stuff do? I thought you had ported the
> > ctags parser to use the KDevelop class store - but I can't find any code to do
> > that. 
> 
> That was the original plan, and I think Sandy will remember me
> talking about it ;-) There are basically two ways of employing
> ctags as a parser: First, you can use the ctags command externally
> and read the tags file it writes from disk. Second, you can use
> the parsers (like ruby.c) and write some C++ code around it such
> that the parsers deliver their tags to KDevelop's class store.
> I still think that the latter is possible, although it requires
> some non-trivial work to isolate the code that is really necessary 
> from the code that is specific to the command line program.
> 
> Nevertheless, this approach is quite unsatisfactory. ctags outputs
> only tags, i.e. identifier strings, and little more. For C++,
> you don't get e.g. the full method signature which includes the
> types of parameters. For other languages, it is simpler, but
> I would prefer to write real parsers written in C++ in KDevelop's
> framework whereever possible. For many scripting languages it is
> quite easy to implement some hacks with regular expressions like
> I did with Python and Perl. Since ctags parsers are also hacks
> without proper tokenizers, we are not much worse then ;-)
> I think it's possible for Ruby.
Yes, I know what you mean as I did the same to add Java to KDE Studio  -
it involved redoing the C++ stuff to add the missing parsing of the method
arguments. I still have that work, I know exactly what needs to be done. But
then so do you from what you say. I could have a go at adapting it for ctags
5.x up from 3.x, which has Ruby. 

But then if you have managed to parse perl usefully with just regular
expressions, it should be possible for Ruby. Or I could use a Java parser (I
think there is a JRuby), and write it in Java. Choices, choices...

> > I'm keen on KDevelop Ruby support, and I see this in ctagsdlg.cpp:
> > 
> > static CTagsKindMapping kindMappingRuby[] = {
> >     { 'c', I18N_NOOP("class")               },
> >     { 'f', I18N_NOOP("function")            },
> >     { 'm', I18N_NOOP("mixin")               },
> >     { 0  , 0                                }
> > };
> 
> Hmm, now I see it I'm a bit surprised. The mixin is
> mentioned in the manpage, but I don't think ctags really
> generates such tags.
We would need to show them as superclasses in the class browser. Should the
browser be able to distinguish between classes and interfaces/categories/
or mixins for those languages which have two type of 'class' declarations?

> > What is it all about, if that isn't a silly question?
> 
> It's not a silly question :-) That part was a 1-evening hack to
> get at least some basic support for all the languages we don't
> have proper support for yet. It allows you to open a dialog
> where you can enter a search string which is then searched for
> in the tags file. The search string supports regular expressions,
> e.g. you can search for '.*Factory' to get all identifiers which
> end on Factory, i.e. all class names and function names or whatever
> the parser supports. In a check list with tag types, you can choose
> which types you want to use. By clicking in the result list, you
> go to the source file location. There is no connection to the class
> store or the class view.
OK - I've got it - a sort of turbo grep.

-- Richard


-
to unsubscribe from this list send an email to kdevelop-devel-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop-devel mailing list