Class Scanner


  • class Scanner
    extends java.lang.Object
    • Field Detail

      • BOL

        private int BOL
      • dataStack

        private java.util.Stack dataStack
      • keywords

        private java.util.Vector<java.lang.String> keywords
      • openEndedKeywords

        private java.util.Vector<java.lang.String> openEndedKeywords
      • wildcardKeywords

        private java.util.Vector<java.lang.String> wildcardKeywords
      • verbose

        private boolean verbose
      • escapedOK

        boolean escapedOK
      • emitAll

        private boolean emitAll
      • corbaLevel

        private float corbaLevel
      • debug

        private boolean debug
    • Constructor Detail

      • Scanner

        Scanner​(IncludeEntry file,
                java.lang.String[] keywords,
                boolean vbose,
                boolean emitAllIncludes,
                float cLevel,
                boolean debug)
         throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • sortKeywords

        void sortKeywords​(java.lang.String[] keywords)
      • wildcardAtEitherEnd

        private boolean wildcardAtEitherEnd​(java.lang.String string)
      • wildcardsInside

        private boolean wildcardsInside​(java.lang.String string)
      • readFile

        void readFile​(IncludeEntry file)
               throws java.io.IOException
        Throws:
        java.io.IOException
      • readFile

        void readFile​(IncludeEntry file,
                      java.lang.String filename)
               throws java.io.IOException
        Throws:
        java.io.IOException
      • getToken

        Token getToken()
                throws java.io.IOException
        Throws:
        java.io.IOException
      • scanString

        void scanString​(java.lang.String string)
      • scanIncludedFile

        void scanIncludedFile​(IncludeEntry file,
                              java.lang.String filename,
                              boolean includeIsImport)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • unread

        private void unread​(char ch)
      • readChar

        void readChar()
               throws java.io.IOException
        Throws:
        java.io.IOException
      • getWString

        private java.lang.String getWString()
                                     throws java.io.IOException
        Starting at a quote, reads a string with possible unicode or octal values until an end quote. Doesn't handle line feeds or comments.
        Throws:
        java.io.IOException
      • getCharacterToken

        private Token getCharacterToken​(boolean isWide)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • singleCharEscapeSequence

        private Token singleCharEscapeSequence​(boolean isWide)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • getString

        private Token getString()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • matchesClosedWildKeyword

        private boolean matchesClosedWildKeyword​(java.lang.String string)
      • matchesOpenWildcard

        private java.lang.String matchesOpenWildcard​(java.lang.String string)
      • blankOutMatch

        private java.lang.String blankOutMatch​(java.lang.String string,
                                               int start,
                                               int length)
      • getIdentifier

        private java.lang.String getIdentifier​(java.lang.String string)
      • getDirective

        private Token getDirective()
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • getNumber

        private Token getNumber()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • getFractionNoInteger

        private Token getFractionNoInteger()
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • getFraction

        private Token getFraction​(java.lang.String string)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getExponent

        private Token getExponent​(java.lang.String string)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • isItHex

        private Token isItHex()
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • getOctalNumber

        private Token getOctalNumber()
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • getHexNumber

        private Token getHexNumber​(java.lang.String string)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • getNDigitHexNumber

        private int getNDigitHexNumber​(int n)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • isHexChar

        private boolean isHexChar​(char hex)
      • get3DigitOctalNumber

        private int get3DigitOctalNumber()
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • getInteger

        private Token getInteger()
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • replaceTrigraph

        private Token replaceTrigraph()
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • skipWhiteSpace

        void skipWhiteSpace()
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • skipBlockComment

        private void skipBlockComment()
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • skipLineComment

        void skipLineComment()
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • getLineComment

        private java.lang.String getLineComment()
                                         throws java.io.IOException
        Extract a line comment from the input buffer.
        Throws:
        java.io.IOException
      • getBlockComment

        private java.lang.String getBlockComment()
                                          throws java.io.IOException
        Extract a block comment from the input buffer.
        Throws:
        java.io.IOException
      • skipUntil

        Token skipUntil​(char c)
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • getUntil

        java.lang.String getUntil​(char c)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getUntil

        java.lang.String getUntil​(char c,
                                  boolean allowQuote,
                                  boolean allowCharLit,
                                  boolean allowComment)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getUntil

        java.lang.String getUntil​(char c1,
                                  char c2)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • appendToString

        private java.lang.String appendToString​(java.lang.String string,
                                                boolean allowQuote,
                                                boolean allowCharLit,
                                                boolean allowComment)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • getStringToEOL

        java.lang.String getStringToEOL()
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • filename

        java.lang.String filename()
      • currentLineNumber

        int currentLineNumber()
      • lastTokenLineNumber

        int lastTokenLineNumber()
      • currentLine

        java.lang.String currentLine()
      • lastTokenLine

        java.lang.String lastTokenLine()
      • currentLinePosition

        int currentLinePosition()
      • lastTokenLinePosition

        int lastTokenLinePosition()