675N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 675N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 675N/A * This code is free software; you can redistribute it and/or modify it 675N/A * under the terms of the GNU General Public License version 2 only, as 675N/A * published by the Free Software Foundation. 675N/A * This code is distributed in the hope that it will be useful, but WITHOUT 675N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 675N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 675N/A * version 2 for more details (a copy is included in the LICENSE file that 675N/A * accompanied this code). 675N/A * You should have received a copy of the GNU General Public License version 675N/A * 2 along with this work; if not, write to the Free Software Foundation, 675N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 675N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 675N/A * or visit www.oracle.com if you need additional information or have any 675N/A * Utility and test program to check validity of tree positions for tree nodes. 675N/A * The program can be run standalone, or as a jtreg test. In standalone mode, 675N/A * errors can be displayed in a gui viewer. For info on command line args, 675N/A * run program with no args. 675N/A * jtreg: Note that by using the -r switch in the test description below, this test 675N/A * covering any new language features that may be tested in this test suite. 675N/A * @summary assorted position errors in compiler syntax trees 675N/A * @run main CheckAttributedTree -q -r -et ERRONEOUS . 675N/A * If test.src is set, program runs in jtreg mode, and will throw an Error 675N/A * if any errors arise, otherwise System.exit will be used, unless the gui 675N/A * viewer is being used. In jtreg mode, the default base directory for file 675N/A * args is the value of ${test.src}. In jtreg mode, the -r option can be 675N/A * given to change the default base directory to the root test directory. 675N/A * Run the program. A base directory can be provided for file arguments. 675N/A * In jtreg mode, the -r option can be given to change the default base 675N/A * directory to the test root directory. For other options, see usage(). 675N/A * @param baseDir base directory for any file arguments. 675N/A * @param args command line args 675N/A * @return true if successful or in gui mode 675N/A * Print command line help. 675N/A * @param out output stream 675N/A out.
println(
"non java files, or java files which cannot be parsed, will be ignored");
675N/A * Test a file. If the file is a directory, it will be recursively scanned 675N/A * @param file the file or directory to test 675N/A * @param file the file to be read 675N/A * @return the tree for the content of the file 675N/A * @throws IOException if any IO errors occur 675N/A * @throws TreePosTest.ParseException if any errors occur while parsing the file 675N/A String[]
opts = {
"-XDshouldStopPolicy=ATTR",
"-XDverboseCompilePolicy" };
682N/A //System.out.println("Try to add pairs. Elems are " + analyzedElems); 682N/A //System.out.println("Adding pair..."); 675N/A * Report an error. When the program is complete, the program will either 675N/A * exit or throw an Error if any errors have been reported. 675N/A * @param msg the error message 675N/A /** Number of files that have been analyzed. */ 675N/A /** Number of errors reported. */ 675N/A /** Flag: don't report irrelevant files. */ 675N/A /** Flag: show errors in GUI viewer. */ 675N/A /** The GUI viewer for errors. */ 675N/A /** Flag: report files as they are processed. */ 675N/A /** Option: encoding for test files. */ 675N/A /** The set of tags for tree nodes to be analyzed; if empty, all tree nodes 675N/A /** Set of files and directories to be excluded from analysis. */ 675N/A /** Set of tag names to be excluded from analysis. */ 675N/A /** Utility class for trees */ 675N/A * left uninitialized after attribution 675N/A "'null' found in tree ",
675N/A * Utility class providing easy access to position and other info for a tree node. 675N/A * javac does not provide an API to convert tag values to strings, so this class uses 675N/A * reflection to determine names of public static final int values in JCTree. 675N/A * Thrown when errors are found parsing a java file. 675N/A * DiagnosticListener to report diagnostics and count any errors that occur. 675N/A * GUI viewer for issues found by TreePosTester. The viewer provides a drop 675N/A * down list for selecting error conditions, a header area providing details 675N/A * about an error, and a text area with the ranges of text highlighted as 675N/A * Add another entry to the list of errors. 675N/A * @param file The file containing the error 675N/A * @param check The condition that was being tested, and which failed 675N/A * @param encl the enclosing tree node 675N/A * @param self the tree node containing the error 675N/A * Initialize the GUI window. 675N/A /** Show an entry that has been selected. */ 675N/A // update simple fields 675N/A // show file text with highlights 675N/A /** Create a test field. */ 675N/A /** Add a highlighted region based on the positions in an Info object. */ 675N/A /** Get the minimum valid position in a set of info objects. */ 675N/A /** Set the background on a component. */ 675N/A /** Scroll a text area to display a given position near the middle of the visible area. */ 675N/A // Using invokeLater appears to give text a chance to sort itself out 675N/A // before the scroll happens; otherwise scrollRectToVisible doesn't work. 675N/A // Maybe there's a better way to sync with the text... 675N/A /** Panel to display an Info object. */ 675N/A /** Object to record information about an error to be displayed. */