public class ScannerUtils extends java.lang.Object
| Constructor and Description |
|---|
ScannerUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.List<IToken> |
getTokens(java.lang.String content,
ELanguage language)
Returns the results of scanning a string.
|
static java.util.List<IToken> |
getTokens(java.lang.String content,
ELanguage language,
java.lang.String origin)
Returns the results of scanning a string.
|
static java.util.List<IToken> |
readTokens(ILenientScanner scanner)
Read tokens from a lenient scanner and store them in a list.
|
static void |
readTokens(IScanner scanner,
java.util.List<IToken> tokens,
java.util.List<ScannerException> exceptions)
Read tokens from a strict scanner and store them in a list.
|
public ScannerUtils()
public static void readTokens(IScanner scanner, java.util.List<IToken> tokens, java.util.List<ScannerException> exceptions) throws java.io.IOException
ETokenType.EOF at the end of the
file. This last token will not be added to the list of tokens.scanner - the scanner to read fromtokens - the list to store tokensexceptions - another list to store possible exceptions that occurred during
scanning.java.io.IOException - thrown if scanner throws an IO exceptionpublic static java.util.List<IToken> readTokens(ILenientScanner scanner) throws java.io.IOException
ETokenType.EOF at the end of the
file. This last token will not be added to the list of tokens.scanner - the scanner to read fromjava.io.IOException - thrown if scanner throws an IO exceptionpublic static java.util.List<IToken> getTokens(java.lang.String content, ELanguage language)