是否可以解耦Eclipse的代码索引功能? [英] Is it possible to decouple the code indexing capabilities of Eclipse?

查看:453
本文介绍了是否可以解耦Eclipse的代码索引功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个大学课程的静态分析仪。为了为工具提供更多的功能,我希望能够查找调用层次结构(如Eclipse中的Ctrl + Alt + H)。这也将是一个快速的操作,所以查找可能需要针对索引而不是字节码扫描。



但是,编写Eclipse插件将是我太期望了。相反,我宁愿解析Eclipse的创建代码索引的部分,并使用库来执行查找。用户的界面将在命令行上,以简化实现。



我看到Eclipse使用Lucene进行索引[1],但是必须在Lucene上面,Eclipse允许的功能大量的工作。



问题是,是否可以将Eclipse的索引功能解耦以便重用?如果没有,还有其他可用的库可以进行我讨论的那种处理方式吗?



[1] Lucene In Action(IIRC)






编辑



我觉得有一些误会。我不打算检查类层次结构,我想检查调用层次结构。这就是为什么搜索和索引(某种类型的,虽然也许这不是正确的术语)进入讨论。检查类层次结构可能比检查调用层次结构要便宜得多。



至于编写Eclipse插件,是的,我很乐意,但是给定这个作业是在非常短的时间尺度上,我可能不太可能管理它。但是这是有用的信息,有些人觉得这并不像我认为的那么困难。



也许我过分强调了Eclipse,它发生在我身上我真的在寻找任何可以通过字节码检查调用图的API的工具。



感谢您的答案!

解决方案

走字节码并不困难,也不慢。我们以交互式速度对大型Java代码项目进行了静态分析。既然,你的时间很短,我建议你修改一些像eclipse中的调用图查看器插件[1]。此外,Eclipse代码很难理解,您最好编写自己的插件,使用尽可能多的Eclipse未记录的API。



[1] http://www.eclipseplugincentral.com/Web_Links-index-req-viewlink- cid-1326.html


I am looking to write a static analyser for a university class. To provide more power for the tool I would like to be able to look up the call hierarchy (as Ctrl+Alt+H does in Eclipse). This would also have to be a fast operation, so the lookup would probably have to be done against an index rather than bytecode scanning.

However, writing an Eclipse plugin would be too ambitious I expect. Instead I would rather decouple the parts of Eclipse which create the code index, and use a library to do lookups. The interface to the user would be on the command line, to simplify implementation.

I read that Eclipse uses Lucene to do the indexing[1], however, there must be a significant amount of work atop Lucene for the capabilities Eclipse allows.

The question is, is it possible to decouple the indexing capabilities of Eclipse for reuse? If not, are there other, readily available libraries available that could do the kind of processing I've discussed?

[1] Lucene In Action (IIRC)


EDIT

I think there's been some misunderstanding. I'm not looking to inspect the class hierarchy, I want to inspect the call hierarchy. That's why searching and indexing (of some kind, though maybe that's not the right term) comes into the discussion. Inspecting the class hierarchy is probably a lot less expensive than inspecting the call hierarchy.

As for writing an Eclipse plugin, yes I'd love to, but given this assignment is on a very short timescale it's probably unlikely I'll manage it. But it's useful information that some of you feel this is not as tough as I think it will be.

Perhaps I have put too much emphasis on Eclipse, it occurred to me I'm really looking for any tool that provides an API for inspecting a call graph through the bytecode.

Thanks for your answers so far!

解决方案

Walking the byte code is not hard at all and is not slow either. We have performed static analysis of large Java code projects at interactive speeds. Since, you are short on time I would suggest that you modify something like a call graph viewer plugin[1] in eclipse. Also, Eclipse code is hard to comprehend, you are better off writing your own plugin that uses as much of Eclipse's undocumented API's as possible.

[1] http://www.eclipseplugincentral.com/Web_Links-index-req-viewlink-cid-1326.html

这篇关于是否可以解耦Eclipse的代码索引功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆