【问题标题】:How to create an AST with a CAPTURE binding?如何使用 CAPTURE 绑定创建 AST?
【发布时间】:2010-12-15 11:55:43
【问题描述】:

我有兴趣使用 Eclipse JDT 创建CAPTURE 绑定。

我已经阅读了几个捕获转换教程,但是当我复制粘贴示例代码 sn-ps 时,我永远无法在抽象语法树中找到捕获转换绑定(使用插件 ASTView 可视化 AST)。

如何做到这一点?

【问题讨论】:

    标签: java eclipse capture eclipse-jdt


    【解决方案1】:

    Deepak Azad @ Eclipse 论坛提供的示例:

    interface Box<T> {
        public T get();
        public void put( T element);
    }
    
    class CaptureTest {
        public void rebox( Box<?> box) {
            box.get(); // return type of get() is a capture binding
        }
    }
    

    【讨论】:

    猜你喜欢
    • 2015-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多