JFlexXref.java revision 1122
0N/A * The contents of this file are subject to the terms of the 0N/A * Common Development and Distribution License (the "License"). 0N/A * You may not use this file except in compliance with the License. 0N/A * language governing permissions and limitations under the License. 0N/A * When distributing Covered Code, include this CDDL HEADER in each 0N/A * If applicable, add the following below this CDDL HEADER, with the 0N/A * fields enclosed by brackets "[]" replaced with your own identifying 0N/A * information: Portions Copyright [yyyy] [name of copyright owner] 119N/A * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. 261N/A * Base class for Xref lexers. 58N/A * @author Lubos Kosco 0N/A /** EOF value returned by yylex(). */ 65N/A // TODO when bug #16053 is fixed, we should add a getter to a file 65N/A // that's included from all the Xref classes so that we avoid the 260N/A // The auto-generated constructors for the Xref classes don't 112N/A // expect a checked exception, so wrap it in an AssertionError. 0N/A // This should never happen, since all the Xref classes will get 0N/A // a public static YYEOF field from JFlex. 0N/A throw ae;
// NOPMD (stack trace is preserved by initCause(), but 0N/A // PMD thinks it's lost) 0N/A * Reinitialize the xref with new contents. 58N/A * @param contents a char buffer with text to analyze 58N/A * @param length the number of characters to use from the char buffer 111N/A /** Get the next token from the scanner. */ 111N/A /** Reset the scanner. */ 111N/A /** Get the value of {@code yyline}. */ 111N/A /** Set the value of {@code yyline}. */ 77N/A * Write xref to the specified {@code Writer}. 207N/A * @param out xref destination 77N/A * @throws IOException on error when writing the xref 99N/A while (
yylex() !=
yyeof) {
// NOPMD while statement intentionally empty 77N/A // nothing to do here, yylex() will do the work 77N/A * Terminate the current line and insert preamble for the next line. The 77N/A * line count will be incremented. 0N/A * @throws IOException on error when writing the xref 77N/A * Write a symbol and generate links as appropriate. 77N/A * @param symbol the symbol to write 111N/A * @param keywords a set of keywords recognized by this analyzer (no links 111N/A * will be generated if the symbol is a keyword) 77N/A * @param line the line number on which the symbol appears 77N/A * @throws IOException if an error occurs while writing to the stream 173N/A // This is a keyword, so we don't create a link. 173N/A // This is the definition of the symbol. 119N/A // 1) Create an anchor for direct links. (Perhaps we should only 106N/A // do this when there's exactly one definition of the symbol in 106N/A // this file? Otherwise, we may end up with multiple anchors with 99N/A // 2) Create a link that searches for all references to this symbol. 125N/A // May have multiple anchors with the same function name, 125N/A // store line number for accurate location used in list.jsp. 126N/A // This is a reference to a symbol defined exactly once in this file. 126N/A // Generate a direct link to the symbol definition. 126N/A // This is a symbol that is not defined in this file, or a symbol 126N/A // that is defined more than once in this file. In either case, we 126N/A // can't generate a direct link to the definition, so generate a 126N/A // link to search for all definitions of that symbol instead. 144N/A * Write HTML escape sequence for the specified Unicode character, unless 144N/A * it's an ISO control character, in which case it is ignored. 261N/A * @param c the character to write 261N/A * @throws IOException if an error occurs while writing to the stream 0N/A * Write an e-mail address. 77N/A * @param address the address to write 77N/A * @throws IOException if an error occurs while writing to the stream