ksrini@1138: /* ksrini@1138: * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. ksrini@1138: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ksrini@1138: * ksrini@1138: * This code is free software; you can redistribute it and/or modify it ksrini@1138: * under the terms of the GNU General Public License version 2 only, as ksrini@1138: * published by the Free Software Foundation. Oracle designates this ksrini@1138: * particular file as subject to the "Classpath" exception as provided ksrini@1138: * by Oracle in the LICENSE file that accompanied this code. ksrini@1138: * ksrini@1138: * This code is distributed in the hope that it will be useful, but WITHOUT ksrini@1138: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ksrini@1138: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ksrini@1138: * version 2 for more details (a copy is included in the LICENSE file that ksrini@1138: * accompanied this code). ksrini@1138: * ksrini@1138: * You should have received a copy of the GNU General Public License version ksrini@1138: * 2 along with this work; if not, write to the Free Software Foundation, ksrini@1138: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ksrini@1138: * ksrini@1138: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ksrini@1138: * or visit www.oracle.com if you need additional information or have any ksrini@1138: * questions. ksrini@1138: */ ksrini@1138: package com.sun.tools.javac.parser; ksrini@1138: ksrini@1138: import com.sun.tools.javac.tree.JCTree; ksrini@1138: ksrini@1138: /** ksrini@1138: * Specifies the methods to access a mappings of syntax trees to end positions. ksrini@1138: *

This is NOT part of any supported API. ksrini@1138: * If you write code that depends on this, you do so at your own ksrini@1138: * risk. This code and its internal interfaces are subject to change ksrini@1138: * or deletion without notice.

ksrini@1138: */ ksrini@1138: public interface EndPosTable { ksrini@1138: ksrini@1138: /** ksrini@1138: * This method will return the end position of a given tree, otherwise a ksrini@1138: * Positions.NOPOS will be returned. ksrini@1138: * @param tree JCTree ksrini@1138: * @return position of the source tree or Positions.NOPOS for non-existent mapping ksrini@1138: */ ksrini@1138: public int getEndPos(JCTree tree); ksrini@1138: ksrini@1138: /** ksrini@1138: * Give an old tree and a new tree, the old tree will be replaced with ksrini@1138: * the new tree, the position of the new tree will be that of the old ksrini@1138: * tree. ksrini@1138: * not exist. ksrini@1138: * @param oldtree a JCTree to be replaced ksrini@1138: * @param newtree a JCTree to be replaced with ksrini@1138: * @return position of the old tree or Positions.NOPOS for non-existent mapping ksrini@1138: */ ksrini@1138: public int replaceTree(JCTree oldtree, JCTree newtree); ksrini@1138: }