public class Scanner extends Object implements Lexer
This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Modifier | Constructor and Description |
---|---|
protected |
Scanner(ScannerFactory fac,
char[] buf,
int inputLength) |
protected |
Scanner(ScannerFactory fac,
CharBuffer buf)
Create a scanner from the input array.
|
protected |
Scanner(ScannerFactory fac,
JavaTokenizer tokenizer) |
Modifier and Type | Method and Description |
---|---|
int |
errPos()
Return the position where a lexical error occurred;
|
void |
errPos(int pos)
Set the position where a lexical error occurred;
|
Position.LineMap |
getLineMap()
Build a map for translating between line numbers and
positions in the input.
|
void |
nextToken()
Consume the next token.
|
Tokens.Token |
prevToken()
Return the last character position of the previous token.
|
Tokens.Token |
split()
Splits the current token in two and return the first (splitted) token.
|
Tokens.Token |
token()
Return current token.
|
Tokens.Token |
token(int lookahead)
Return token with given lookahead.
|
protected Scanner(ScannerFactory fac, CharBuffer buf)
inputLength < input.length
or
input[input.length -1]
is a white space character.fac
- the factory which created this Scannerbuf
- the input, might be modified
Must be positive and less than or equal to input.length.protected Scanner(ScannerFactory fac, char[] buf, int inputLength)
protected Scanner(ScannerFactory fac, JavaTokenizer tokenizer)
public Tokens.Token token()
Lexer
public Tokens.Token token(int lookahead)
Lexer
public Tokens.Token prevToken()
Lexer
public void nextToken()
Lexer
public Tokens.Token split()
Lexer
public Position.LineMap getLineMap()
Lexer
getLineMap
in interface Lexer
public int errPos()
Lexer
Copyright © 2016. All rights reserved.