286N/A * reserved comment block 286N/A * DO NOT REMOVE OR ALTER! 286N/A * Copyright 2001-2004 The Apache Software Foundation or its licensors, 286N/A * Licensed under the Apache License, Version 2.0 (the "License"); 286N/A * you may not use this file except in compliance with the License. 286N/A * You may obtain a copy of the License at 286N/A * Unless required by applicable law or agreed to in writing, software 286N/A * distributed under the License is distributed on an "AS IS" BASIS, 286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 286N/A * See the License for the specific language governing permissions and 286N/A * limitations under the License. 286N/A * Parses plain text Catalog files. 286N/A * <p>This class reads plain text Open Catalog files.</p> 286N/A * <a href="mailto:Norman.Walsh@Sun.COM">Norman.Walsh@Sun.COM</a> 286N/A /** The input stream used to read the catalog */ 286N/A * Character lookahead stack. Reading a catalog sometimes requires 286N/A * up to two characters of lookahead. 286N/A * Token stack. Recognizing an unexpected catalog entry requires 286N/A * the ability to "push back" a token. 286N/A /** The current position on the lookahead stack */ 286N/A /** Are keywords in the catalog case sensitive? */ 286N/A * Construct a CatalogReader object. 286N/A * Start parsing a text catalog file. The file is 286N/A * actually read and parsed 286N/A * as needed by <code>nextEntry</code>.</p> 286N/A * @param fileUrl The URL or filename of the catalog file to process 286N/A * @throws MalformedURLException Improper fileUrl 286N/A * @throws IOException Error reading catalog file 286N/A * <p>Makes sure the catalog file is closed.</p> 286N/A // ----------------------------------------------------------------- 286N/A * Return the next token in the catalog file. 286N/A * <p>FYI: This code does not throw any sort of exception for 286N/A * a file that contains an n 286N/A * @return The Catalog file token from the input stream. 286N/A * @throws IOException If an error occurs reading from the stream. 286N/A // Skip over leading whitespace and comments 286N/A // skip leading whitespace 286N/A while (
ch <=
' ') {
// all ctrls are whitespace 286N/A // now 'ch' is the current char from the file 286N/A // we've found a comment, skip it... 286N/A "Unterminated comment in catalog file; EOF treated as end-of-comment.");
286N/A // Ok, we've found the end of the comment, 286N/A // loop back to the top and start again... 286N/A // return the next whitespace or comment delimited 286N/A * Return the next logical character from the input stream. 286N/A * @return The next (logical) character from the input stream. The 286N/A * character may be buffered from a previous lookahead. 286N/A * @throws IOException If an error occurs reading from the stream.