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 int
BOL
private float
corbaLevel
private ScannerData
data
private java.util.Stack
dataStack
private boolean
debug
(package private) static int
Dot
private boolean
emitAll
(package private) boolean
escapedOK
private java.util.Vector<java.lang.String>
keywords
(package private) static int
None
private java.util.Vector<java.lang.String>
openEndedKeywords
(package private) static int
Plus
(package private) static int
Star
private boolean
verbose
private 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.String
appendToString(java.lang.String string, boolean allowQuote, boolean allowCharLit, boolean allowComment)
private java.lang.String
blankOutMatch(java.lang.String string, int start, int length)
(package private) java.lang.String
currentLine()
(package private) int
currentLineNumber()
(package private) int
currentLinePosition()
(package private) IncludeEntry
fileEntry()
(package private) java.lang.String
filename()
private int
get3DigitOctalNumber()
private java.lang.String
getBlockComment()
Extract a block comment from the input buffer.private Token
getCharacterToken(boolean isWide)
private Token
getDirective()
private Token
getExponent(java.lang.String string)
private Token
getFraction(java.lang.String string)
private Token
getFractionNoInteger()
private Token
getHexNumber(java.lang.String string)
private java.lang.String
getIdentifier(java.lang.String string)
private Token
getInteger()
private java.lang.String
getLineComment()
Extract a line comment from the input buffer.private int
getNDigitHexNumber(int n)
private Token
getNumber()
private Token
getOctalNumber()
private Token
getString()
(package private) java.lang.String
getStringToEOL()
(package private) Token
getToken()
(package private) java.lang.String
getUntil(char c)
(package private) java.lang.String
getUntil(char c, boolean allowQuote, boolean allowCharLit, boolean allowComment)
(package private) java.lang.String
getUntil(char c1, char c2)
private java.lang.String
getWString()
Starting at a quote, reads a string with possible unicode or octal values until an end quote.private boolean
isHexChar(char hex)
private Token
isItHex()
(package private) java.lang.String
lastTokenLine()
(package private) int
lastTokenLineNumber()
(package private) int
lastTokenLinePosition()
private boolean
matchesClosedWildKeyword(java.lang.String string)
private java.lang.String
matchesOpenWildcard(java.lang.String string)
(package private) void
readChar()
(package private) void
readFile(IncludeEntry file)
(package private) void
readFile(IncludeEntry file, java.lang.String filename)
private Token
replaceTrigraph()
(package private) void
scanIncludedFile(IncludeEntry file, java.lang.String filename, boolean includeIsImport)
(package private) void
scanString(java.lang.String string)
private Token
singleCharEscapeSequence(boolean isWide)
private void
skipBlockComment()
(package private) void
skipLineComment()
(package private) Token
skipUntil(char c)
(package private) void
skipWhiteSpace()
(package private) void
sortKeywords(java.lang.String[] keywords)
private void
unread(char ch)
private boolean
wildcardAtEitherEnd(java.lang.String string)
private boolean
wildcardsInside(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.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()
-
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()
-
-