Class Parser
- java.lang.Object
-
- io.github.lukehutch.fastclasspathscanner.utils.Parser
-
public class Parser extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Parser.ParseException
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
advance(int numChars)
void
appendToToken(char c)
void
appendToToken(String str)
String
currToken()
Get the current token, and reset the token to empty.void
expect(char expectedChar)
char
getc()
int
getPosition()
String
getPositionInfo()
Object
getState()
CharSequence
getSubsequence(int startPosition, int endPosition)
String
getSubstring(int startPosition, int endPosition)
boolean
hasMore()
void
next()
char
peek()
void
peekExpect(char expectedChar)
boolean
peekMatches(String strMatch)
void
setPosition(int position)
Object
setState(Object state)
void
skipWhitespace()
String
toString()
-
-
-
Constructor Detail
-
Parser
public Parser(String string) throws Parser.ParseException
- Throws:
Parser.ParseException
-
-
Method Detail
-
getPositionInfo
public String getPositionInfo()
-
getState
public Object getState()
-
getc
public char getc() throws Parser.ParseException
- Throws:
Parser.ParseException
-
peek
public char peek()
-
peekExpect
public void peekExpect(char expectedChar) throws Parser.ParseException
- Throws:
Parser.ParseException
-
peekMatches
public boolean peekMatches(String strMatch)
-
next
public void next()
-
advance
public void advance(int numChars)
-
hasMore
public boolean hasMore()
-
getPosition
public int getPosition()
-
setPosition
public void setPosition(int position)
-
getSubsequence
public CharSequence getSubsequence(int startPosition, int endPosition)
-
getSubstring
public String getSubstring(int startPosition, int endPosition)
-
expect
public void expect(char expectedChar) throws Parser.ParseException
- Throws:
Parser.ParseException
-
appendToToken
public void appendToToken(String str)
-
appendToToken
public void appendToToken(char c)
-
skipWhitespace
public void skipWhitespace()
-
currToken
public String currToken()
Get the current token, and reset the token to empty.- Returns:
- The current token. Resets the current token to empty.
-
-