Package com.sun.tools.corba.ee.idl
Class Scanner
- java.lang.Object
-
- com.sun.tools.corba.ee.idl.Scanner
-
class Scanner extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private intBOLprivate floatcorbaLevelprivate ScannerDatadataprivate java.util.StackdataStackprivate booleandebug(package private) static intDotprivate booleanemitAll(package private) booleanescapedOKprivate java.util.Vector<java.lang.String>keywords(package private) static intNoneprivate java.util.Vector<java.lang.String>openEndedKeywords(package private) static intPlus(package private) static intStarprivate booleanverboseprivate java.util.Vector<java.lang.String>wildcardKeywords
-
Constructor Summary
Constructors Constructor Description Scanner(IncludeEntry file, java.lang.String[] keywords, boolean vbose, boolean emitAllIncludes, float cLevel, boolean debug)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringappendToString(java.lang.String string, boolean allowQuote, boolean allowCharLit, boolean allowComment)private java.lang.StringblankOutMatch(java.lang.String string, int start, int length)(package private) java.lang.StringcurrentLine()(package private) intcurrentLineNumber()(package private) intcurrentLinePosition()(package private) IncludeEntryfileEntry()(package private) java.lang.Stringfilename()private intget3DigitOctalNumber()private java.lang.StringgetBlockComment()Extract a block comment from the input buffer.private TokengetCharacterToken(boolean isWide)private TokengetDirective()private TokengetExponent(java.lang.String string)private TokengetFraction(java.lang.String string)private TokengetFractionNoInteger()private TokengetHexNumber(java.lang.String string)private java.lang.StringgetIdentifier(java.lang.String string)private TokengetInteger()private java.lang.StringgetLineComment()Extract a line comment from the input buffer.private intgetNDigitHexNumber(int n)private TokengetNumber()private TokengetOctalNumber()private TokengetString()(package private) java.lang.StringgetStringToEOL()(package private) TokengetToken()(package private) java.lang.StringgetUntil(char c)(package private) java.lang.StringgetUntil(char c, boolean allowQuote, boolean allowCharLit, boolean allowComment)(package private) java.lang.StringgetUntil(char c1, char c2)private java.lang.StringgetWString()Starting at a quote, reads a string with possible unicode or octal values until an end quote.private booleanisHexChar(char hex)private TokenisItHex()(package private) java.lang.StringlastTokenLine()(package private) intlastTokenLineNumber()(package private) intlastTokenLinePosition()private booleanmatchesClosedWildKeyword(java.lang.String string)private java.lang.StringmatchesOpenWildcard(java.lang.String string)(package private) voidreadChar()(package private) voidreadFile(IncludeEntry file)(package private) voidreadFile(IncludeEntry file, java.lang.String filename)private TokenreplaceTrigraph()(package private) voidscanIncludedFile(IncludeEntry file, java.lang.String filename, boolean includeIsImport)(package private) voidscanString(java.lang.String string)private TokensingleCharEscapeSequence(boolean isWide)private voidskipBlockComment()(package private) voidskipLineComment()(package private) TokenskipUntil(char c)(package private) voidskipWhiteSpace()(package private) voidsortKeywords(java.lang.String[] keywords)private voidunread(char ch)private booleanwildcardAtEitherEnd(java.lang.String string)private booleanwildcardsInside(java.lang.String string)
-
-
-
Field Detail
-
Star
static final int Star
- See Also:
- Constant Field Values
-
Plus
static final int Plus
- See Also:
- Constant Field Values
-
Dot
static final int Dot
- See Also:
- Constant Field Values
-
None
static final int None
- See Also:
- Constant Field Values
-
BOL
private int BOL
-
data
private ScannerData data
-
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.IOExceptionStarting 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.IOExceptionExtract a line comment from the input buffer.- Throws:
java.io.IOException
-
getBlockComment
private java.lang.String getBlockComment() throws java.io.IOExceptionExtract 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()
-
fileEntry
IncludeEntry fileEntry()
-
currentLineNumber
int currentLineNumber()
-
lastTokenLineNumber
int lastTokenLineNumber()
-
currentLine
java.lang.String currentLine()
-
lastTokenLine
java.lang.String lastTokenLine()
-
currentLinePosition
int currentLinePosition()
-
lastTokenLinePosition
int lastTokenLinePosition()
-
-