|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.cdt.internal.formatter.scanner.SimpleScanner
org.eclipse.cdt.internal.formatter.scanner.Scanner
public class Scanner
A scanner operating on a character array and allowing to reposition the scanner.
Field Summary | |
---|---|
int |
eofPosition
|
char[] |
source
|
int |
startPosition
|
Constructor Summary | |
---|---|
Scanner()
|
Method Summary | |
---|---|
int |
getCurrentPosition()
Get the current scanner offset. |
int |
getCurrentTokenEndPosition()
Get the inclusive end offset of the current token. |
char[] |
getCurrentTokenSource()
Get the text of the current token as a character array. |
int |
getCurrentTokenStartPosition()
Get the start offset of the current token. |
int |
getNextChar()
Get the next character. |
boolean |
getNextChar(char c)
Move to next character iff it is equal to the given expected character. |
int |
getNextToken()
Get the next token as token type constant. |
void |
resetTo(int start,
int end)
Reset scanner to given inclusive start and end offsets |
void |
setCurrentPosition(int nextCharacterStart)
Set current scanner offset to given offset. |
void |
setSource(char[] source)
Set the source text as character array. |
java.lang.String |
toString()
For debugging purposes. |
Methods inherited from class org.eclipse.cdt.internal.formatter.scanner.SimpleScanner |
---|
cleanup, initialize, nextToken, setReuseToken, setSplitPreprocessor |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public char[] source
public int eofPosition
public int startPosition
Constructor Detail |
---|
public Scanner()
Method Detail |
---|
public void setSource(char[] source)
source
- the source textpublic void resetTo(int start, int end)
start
- inclusive start offsetend
- inclusive end offsetpublic int getCurrentTokenStartPosition()
public int getCurrentTokenEndPosition()
public int getCurrentPosition()
public int getNextChar()
public boolean getNextChar(char c)
c
- the expected character
true
if the next character was the expected characterpublic void setCurrentPosition(int nextCharacterStart)
nextCharacterStart
- the desired scanner offsetpublic char[] getCurrentTokenSource()
public int getNextToken()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |