Package gw.internal.gosu.parser
Class SourceCodeTokenizerInternal
java.lang.Object
gw.internal.gosu.parser.SourceCodeTokenizerInternal
This class is adapted from java.io.SourceCodeTokenizer. It adds the notion
of operator to the mix. You can define your own operators or use the
default set of operators, which are taken from the Java Language Spec.
It also captures state information for use by our parser e.g., current token
location, line number and column.
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanbooleanintintprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final int -
Constructor Summary
ConstructorsConstructorDescriptionSourceCodeTokenizerInternal(SourceCodeReader reader, ITokenizerInstructor instructor) SourceCodeTokenizerInternal(Reader reader) SourceCodeTokenizerInternal(CharSequence sourceCode) -
Method Summary
Modifier and TypeMethodDescriptionvoidbitshiftOperatorChars(int iLow, int iHigh) voidcharQuoteChar(int ch) voidcommentChar(int ch) copy()voideolIsSignificant(boolean bFlag) static String[]static String[]intintintintintintgetType()protected voidbooleanbooleanbooleanbooleanisEOF()booleanbooleanisOperator(String strOperator) booleanbooleanbooleanbooleanbooleanvoidlowerCaseMode(boolean bLowerCaseMode) intvoidoperatorChars(int iLow, int iHigh) voidvoidordinaryChar(int ch) voidordinaryChars(int iLow, int iHigh) voidvoidquoteChar(int ch) protected intreadWithInstructions(int c) voidreset()voidreset(SourceCodeReader reader) voidvoidsetCommentsSignificant(boolean bCommentsSignificant) voidsetInstructor(ITokenizerInstructor instructor) voidsetParseDotsAsOperators(boolean parseDotsAsOperators) voidsetSupportsKeywords(boolean supportsKeywords) voidsetWhitespaceSignificant(boolean bWhitespaceSignificant) toString()voidwhitespaceChars(int iLow, int iHigh) voidwordChars(int iLow, int iHigh)
-
Field Details
-
CT_WHITESPACE
protected static final int CT_WHITESPACE- See Also:
-
CT_DIGIT
protected static final int CT_DIGIT- See Also:
-
CT_ALPHA
protected static final int CT_ALPHA- See Also:
-
CT_QUOTE
protected static final int CT_QUOTE- See Also:
-
CT_COMMENT
protected static final int CT_COMMENT- See Also:
-
CT_OPERATOR
protected static final int CT_OPERATOR- See Also:
-
CT_BITSHIFT_OPERATOR
protected static final int CT_BITSHIFT_OPERATOR- See Also:
-
CT_CHARQUOTE
protected static final int CT_CHARQUOTE- See Also:
-
_iType
public int _iType -
_keyword
-
_strValue
-
_iInvalidCharPos
public int _iInvalidCharPos -
_bUnterminatedString
public boolean _bUnterminatedString -
_bUnterminatedComment
public boolean _bUnterminatedComment
-
-
Constructor Details
-
SourceCodeTokenizerInternal
-
SourceCodeTokenizerInternal
-
SourceCodeTokenizerInternal
-
SourceCodeTokenizerInternal
-
-
Method Details
-
copy
-
reset
public void reset() -
reset
-
reset
-
getReader
-
getSource
-
getInstructor
-
setInstructor
-
isWhitespaceSignificant
public boolean isWhitespaceSignificant() -
setWhitespaceSignificant
public void setWhitespaceSignificant(boolean bWhitespaceSignificant) -
isCommentsSignificant
public boolean isCommentsSignificant() -
setCommentsSignificant
public void setCommentsSignificant(boolean bCommentsSignificant) -
getLineNumber
public int getLineNumber() -
getLineOffset
public int getLineOffset() -
incrementLineNumber
protected void incrementLineNumber() -
getTokenColumn
public int getTokenColumn() -
wordChars
public void wordChars(int iLow, int iHigh) -
whitespaceChars
public void whitespaceChars(int iLow, int iHigh) -
ordinaryChars
public void ordinaryChars(int iLow, int iHigh) -
ordinaryChar
public void ordinaryChar(int ch) -
getDefaultOperators
-
getDefaultBindingOperators
-
getBitshiftOperators
-
operators
-
operatorChars
public void operatorChars(int iLow, int iHigh) -
bitshiftOperatorChars
public void bitshiftOperatorChars(int iLow, int iHigh) -
isOperator
-
commentChar
public void commentChar(int ch) -
quoteChar
public void quoteChar(int ch) -
charQuoteChar
public void charQuoteChar(int ch) -
parseNumbers
public void parseNumbers() -
eolIsSignificant
public void eolIsSignificant(boolean bFlag) -
lowerCaseMode
public void lowerCaseMode(boolean bLowerCaseMode) -
isUnterminatedString
public boolean isUnterminatedString() -
isUnterminatedComment
public boolean isUnterminatedComment() -
setParseDotsAsOperators
public void setParseDotsAsOperators(boolean parseDotsAsOperators) -
isParseDotsAsOperators
public boolean isParseDotsAsOperators() -
popLastComment
-
getTokenStart
public int getTokenStart() -
getTokenEnd
public int getTokenEnd() -
readWithInstructions
- Throws:
IOException
-
isAnalyzingSeparately
public boolean isAnalyzingSeparately() -
isAnalyzingDirective
public boolean isAnalyzingDirective() -
getTokens
-
nextToken
- Throws:
IOException
-
toString
-
getType
public int getType() -
isEOF
public boolean isEOF() -
isNOTHING
public boolean isNOTHING() -
getEofToken
-
isSupportsKeywords
public boolean isSupportsKeywords() -
setSupportsKeywords
public void setSupportsKeywords(boolean supportsKeywords)
-