AspectJ中的局部变量 [英] Local Variables in AspectJ

查看:122
本文介绍了AspectJ中的局部变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在实现Java语言的不变式扩展。我正在为新语言实现解析器,并将AST注释为中间表示。现在,我正在考虑使用AspectJ来控制在访问AST时在哪里注入代码以控制变量,但是我发现了问题。 AspectJ没有局部变量的连接点。

I'm implementing an invariants extension to the java language. I'm implementing the parser for my new language and annotated AST as an intermediate representation. Now I'm thinking of using AspectJ to control where to inject code in a visit to AST to control the variables but I detect a problem. AspectJ doesn't have a joinpoint to local variables. Is there any extension to aspectj or other aspect programming framework with this functionality?

问候

推荐答案

局部变量访问未在AspectJ中作为连接点公开,而且我不知道对AspectJ进行任何扩展。

Local variable access is not exposed as a joinpoint in AspectJ, and I do not know of any extension to AspectJ to do that.

也许更低-诸如ASM之类的级别字节码检测库在您的情况下可能会有所帮助。使用ASM,您可以在JVM字节代码级别上工作。

Maybe lower-level bytecode instrumentation libraries like ASM could be helpful in your case. With ASM you can work on JVM byte code level.

这篇关于AspectJ中的局部变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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