Class TextCatalogReader

    • Field Detail

      • catfile

        protected InputStream catfile
        The input stream used to read the catalog
      • stack

        protected int[] stack
        Character lookahead stack. Reading a catalog sometimes requires up to two characters of lookahead.
      • tokenStack

        protected Stack tokenStack
        Token stack. Recognizing an unexpected catalog entry requires the ability to "push back" a token.
      • top

        protected int top
        The current position on the lookahead stack
      • caseSensitive

        protected boolean caseSensitive
        Are keywords in the catalog case sensitive?
    • Constructor Detail

      • TextCatalogReader

        public TextCatalogReader()
        Construct a CatalogReader object.
    • Method Detail

      • setCaseSensitive

        public void setCaseSensitive​(boolean isCaseSensitive)
      • getCaseSensitive

        public boolean getCaseSensitive()
      • finalize

        protected void finalize()
        The destructor.

        Makes sure the catalog file is closed.

        Overrides:
        finalize in class Object
      • nextToken

        protected String nextToken()
                            throws IOException,
                                   CatalogException
        Return the next token in the catalog file.

        FYI: This code does not throw any sort of exception for a file that contains an n

        Returns:
        The Catalog file token from the input stream.
        Throws:
        IOException - If an error occurs reading from the stream.
        CatalogException
      • nextChar

        protected int nextChar()
                        throws IOException
        Return the next logical character from the input stream.
        Returns:
        The next (logical) character from the input stream. The character may be buffered from a previous lookahead.
        Throws:
        IOException - If an error occurs reading from the stream.