How to create an AST with a CAPTURE binding?

2019-06-18 04:43发布

I am interested in using the Eclipse JDT to create a CAPTURE binding.

I've read several capture conversion tutorials, but when I copy-paste sample code snippets, I can never find a capture conversion binding in the Abstract Syntax Tree (using the plugin ASTView for visualizing the AST).

How can this be accomplished?

1条回答
该账号已被封号
2楼-- · 2019-06-18 05:34

Example provided by Deepak Azad @ Eclipse Forums:

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
    }
}
查看更多
登录 后发表回答