src/share/classes/com/sun/tools/javac/parser/EndPosTable.java

Mon, 14 Nov 2011 15:11:10 -0800

author
ksrini
date
Mon, 14 Nov 2011 15:11:10 -0800
changeset 1138
7375d4979bd3
permissions
-rw-r--r--

7106166: (javac) re-factor EndPos parser
Reviewed-by: jjg

ksrini@1138 1 /*
ksrini@1138 2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
ksrini@1138 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ksrini@1138 4 *
ksrini@1138 5 * This code is free software; you can redistribute it and/or modify it
ksrini@1138 6 * under the terms of the GNU General Public License version 2 only, as
ksrini@1138 7 * published by the Free Software Foundation. Oracle designates this
ksrini@1138 8 * particular file as subject to the "Classpath" exception as provided
ksrini@1138 9 * by Oracle in the LICENSE file that accompanied this code.
ksrini@1138 10 *
ksrini@1138 11 * This code is distributed in the hope that it will be useful, but WITHOUT
ksrini@1138 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ksrini@1138 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ksrini@1138 14 * version 2 for more details (a copy is included in the LICENSE file that
ksrini@1138 15 * accompanied this code).
ksrini@1138 16 *
ksrini@1138 17 * You should have received a copy of the GNU General Public License version
ksrini@1138 18 * 2 along with this work; if not, write to the Free Software Foundation,
ksrini@1138 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ksrini@1138 20 *
ksrini@1138 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ksrini@1138 22 * or visit www.oracle.com if you need additional information or have any
ksrini@1138 23 * questions.
ksrini@1138 24 */
ksrini@1138 25 package com.sun.tools.javac.parser;
ksrini@1138 26
ksrini@1138 27 import com.sun.tools.javac.tree.JCTree;
ksrini@1138 28
ksrini@1138 29 /**
ksrini@1138 30 * Specifies the methods to access a mappings of syntax trees to end positions.
ksrini@1138 31 * <p><b>This is NOT part of any supported API.
ksrini@1138 32 * If you write code that depends on this, you do so at your own
ksrini@1138 33 * risk. This code and its internal interfaces are subject to change
ksrini@1138 34 * or deletion without notice.</b></p>
ksrini@1138 35 */
ksrini@1138 36 public interface EndPosTable {
ksrini@1138 37
ksrini@1138 38 /**
ksrini@1138 39 * This method will return the end position of a given tree, otherwise a
ksrini@1138 40 * Positions.NOPOS will be returned.
ksrini@1138 41 * @param tree JCTree
ksrini@1138 42 * @return position of the source tree or Positions.NOPOS for non-existent mapping
ksrini@1138 43 */
ksrini@1138 44 public int getEndPos(JCTree tree);
ksrini@1138 45
ksrini@1138 46 /**
ksrini@1138 47 * Give an old tree and a new tree, the old tree will be replaced with
ksrini@1138 48 * the new tree, the position of the new tree will be that of the old
ksrini@1138 49 * tree.
ksrini@1138 50 * not exist.
ksrini@1138 51 * @param oldtree a JCTree to be replaced
ksrini@1138 52 * @param newtree a JCTree to be replaced with
ksrini@1138 53 * @return position of the old tree or Positions.NOPOS for non-existent mapping
ksrini@1138 54 */
ksrini@1138 55 public int replaceTree(JCTree oldtree, JCTree newtree);
ksrini@1138 56 }

mercurial