JFlexXref.java revision 1354
850N/A * The contents of this file are subject to the terms of the 850N/A * Common Development and Distribution License (the "License"). 850N/A * You may not use this file except in compliance with the License. 850N/A * language governing permissions and limitations under the License. 850N/A * When distributing Covered Code, include this CDDL HEADER in each 850N/A * If applicable, add the following below this CDDL HEADER, with the 850N/A * fields enclosed by brackets "[]" replaced with your own identifying 850N/A * information: Portions Copyright [yyyy] [name of copyright owner] 1259N/A * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. 1185N/A * Portions Copyright 2011 Jens Elkner. 1020N/A * Base class for Xref lexers. 1121N/A /** EOF value returned by yylex(). */ 1185N/A /** See {@link RuntimeEnvironment#getUserPage()}. Per default initialized 1190N/A * in the constructor and here to be consistent and avoid lot of 1190N/A /** See {@link RuntimeEnvironment#getUserPageSuffix()}. Per default 1190N/A * initialized in the constructor and here to be consistent and avoid lot of 1259N/A * Description of the style to use for a type of definitions. 1259N/A /** Name of the style definition as given by CTags. */ 1259N/A /** Class name used by the style sheets when rendering the xref. */ 1259N/A * The title of the section to which this type belongs, or {@code null} 1259N/A * if this type should not be listed in the navigation panel. 1259N/A /** Construct a style description. */ 1259N/A * Description of styles to use for different types of definitions. 1121N/A // TODO when bug #16053 is fixed, we should add a getter to a file 1121N/A // that's included from all the Xref classes so that we avoid the 1121N/A // The auto-generated constructors for the Xref classes don't 1121N/A // expect a checked exception, so wrap it in an AssertionError. 1121N/A // This should never happen, since all the Xref classes will get 1121N/A // a public static YYEOF field from JFlex. 1121N/A throw ae;
// NOPMD (stack trace is preserved by initCause(), but 1121N/A * Reinitialize the xref with new contents. 1121N/A * @param contents a char buffer with text to analyze 1121N/A * @param length the number of characters to use from the char buffer 1121N/A /** Get the next token from the scanner. */ 1121N/A /** Get the value of {@code yyline}. */ 1121N/A /** Set the value of {@code yyline}. */ 1121N/A * Write xref to the specified {@code Writer}. 1121N/A * @param out xref destination 1121N/A * @throws IOException on error when writing the xref 1121N/A // nothing to do here, yylex() will do the work 1145N/A * Write a JavaScript function that returns an array with the definitions 1145N/A * to list in the navigation panel. Each element of the array is itself an 1145N/A * array containing the name of the definition type, the CSS class name for 1145N/A * the type, and an array of (symbol, line) pairs for the definitions of 1145N/A // No definitions, no symbol table to write 1145N/A // We want the symbol table to be sorted 1145N/A // Order by symbol name, and then by line number if multiple 1145N/A // definitions use the same symbol name 1185N/A /* no LF intentionally - xml is whitespace aware ... */ 1145N/A * Get the style description for a definition type. 1145N/A * @param type the definition type 1259N/A * @return the style of a definition type, or {@code null} if no style is 1121N/A * Terminate the current line and insert preamble for the next line. The 1121N/A * line count will be incremented. 1121N/A * @throws IOException on error when writing the xref 1121N/A * Write a symbol and generate links as appropriate. 1121N/A * @param symbol the symbol to write 1121N/A * @param keywords a set of keywords recognized by this analyzer (no links 1121N/A * will be generated if the symbol is a keyword) 1121N/A * @param line the line number on which the symbol appears 1121N/A * @throws IOException if an error occurs while writing to the stream 1121N/A // This is a keyword, so we don't create a link. 1121N/A // This is the definition of the symbol. 1121N/A // 1) Create an anchor for direct links. (Perhaps we should only 1121N/A // do this when there's exactly one definition of the symbol in 1121N/A // this file? Otherwise, we may end up with multiple anchors with 1121N/A // 2) Create a link that searches for all references to this symbol. 1121N/A // This is a reference to a symbol defined exactly once in this file. 1121N/A // Generate a direct link to the symbol definition. 1121N/A // This is a symbol that is not defined in this file, or a symbol 1121N/A // that is defined more than once in this file. In either case, we 1121N/A // can't generate a direct link to the definition, so generate a 1121N/A // link to search for all definitions of that symbol instead. 1121N/A * Write HTML escape sequence for the specified Unicode character, unless 1121N/A * it's an ISO control character, in which case it is ignored. 1121N/A * @param c the character to write 1121N/A * @throws IOException if an error occurs while writing to the stream 1123N/A * Write an e-mail address. The address will be obfuscated if 1123N/A * {@link RuntimeEnvironment#isObfuscatingEMailAddresses()} returns 1122N/A * @param address the address to write 1122N/A * @throws IOException if an error occurs while writing to the stream