Thu, 24 Nov 2011 13:36:20 +0000
7115046: Add AST node for lambda expressions
Summary: Add tree nodes for representing lambda expressions and update relevant visitors interfaces
Reviewed-by: jjg
jjg@416 | 1 | /* |
ohair@554 | 2 | * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. |
jjg@416 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
jjg@416 | 4 | * |
jjg@416 | 5 | * This code is free software; you can redistribute it and/or modify it |
jjg@416 | 6 | * under the terms of the GNU General Public License version 2 only, as |
ohair@554 | 7 | * published by the Free Software Foundation. Oracle designates this |
jjg@416 | 8 | * particular file as subject to the "Classpath" exception as provided |
ohair@554 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
jjg@416 | 10 | * |
jjg@416 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
jjg@416 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
jjg@416 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
jjg@416 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
jjg@416 | 15 | * accompanied this code). |
jjg@416 | 16 | * |
jjg@416 | 17 | * You should have received a copy of the GNU General Public License version |
jjg@416 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
jjg@416 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
jjg@416 | 20 | * |
ohair@554 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@554 | 22 | * or visit www.oracle.com if you need additional information or have any |
ohair@554 | 23 | * questions. |
jjg@416 | 24 | */ |
jjg@416 | 25 | |
jjg@416 | 26 | package com.sun.tools.javah; |
jjg@416 | 27 | |
jjg@416 | 28 | import java.io.PrintWriter; |
jjg@416 | 29 | import java.nio.charset.Charset; |
jjg@416 | 30 | import javax.tools.DiagnosticListener; |
jjg@416 | 31 | import javax.tools.JavaFileObject; |
jjg@416 | 32 | |
jjg@416 | 33 | import com.sun.tools.javac.file.JavacFileManager; |
jjg@416 | 34 | import com.sun.tools.javac.util.Context; |
jjg@416 | 35 | |
jjg@416 | 36 | /** |
jjg@416 | 37 | * javah's implementation of JavaFileManager. |
jjg@416 | 38 | * |
jjg@581 | 39 | * <p><b>This is NOT part of any supported API. |
jjg@581 | 40 | * If you write code that depends on this, you do so at your own risk. |
jjg@416 | 41 | * This code and its internal interfaces are subject to change or |
jjg@416 | 42 | * deletion without notice.</b> |
jjg@416 | 43 | */ |
jjg@416 | 44 | class JavahFileManager extends JavacFileManager { |
jjg@416 | 45 | private JavahFileManager(Context context, Charset charset) { |
jjg@416 | 46 | super(context, true, charset); |
jjg@416 | 47 | setIgnoreSymbolFile(true); |
jjg@416 | 48 | } |
jjg@416 | 49 | |
jjg@416 | 50 | static JavahFileManager create(final DiagnosticListener<? super JavaFileObject> dl, PrintWriter log) { |
jjg@416 | 51 | Context javac_context = new Context(); |
jjg@416 | 52 | |
jjg@416 | 53 | if (dl != null) |
jjg@416 | 54 | javac_context.put(DiagnosticListener.class, dl); |
jjg@416 | 55 | javac_context.put(com.sun.tools.javac.util.Log.outKey, log); |
jjg@416 | 56 | |
jjg@416 | 57 | return new JavahFileManager(javac_context, null); |
jjg@416 | 58 | } |
jjg@416 | 59 | |
jjg@416 | 60 | void setIgnoreSymbolFile(boolean b) { |
jjg@416 | 61 | ignoreSymbolFile = b; |
jjg@416 | 62 | } |
jjg@416 | 63 | } |