Package org.openrefine.grel
Class Scanner
- java.lang.Object
-
- org.openrefine.grel.Scanner
-
public class Scanner extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Scanner.ErrorToken
static class
Scanner.NumberToken
static class
Scanner.RegexToken
static class
Scanner.Token
static class
Scanner.TokenType
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getIndex()
Scanner.Token
next(boolean regexPossible)
The regexPossible flag is used by the parser to hint the scanner what to do when it encounters a slash.
-
-
-
Field Detail
-
_text
protected String _text
-
_index
protected int _index
-
_limit
protected int _limit
-
-
Method Detail
-
getIndex
public int getIndex()
-
next
public Scanner.Token next(boolean regexPossible)
The regexPossible flag is used by the parser to hint the scanner what to do when it encounters a slash. Since the divide operator / and the opening delimiter of a regex literal are the same, but divide operators and regex literals can't occur at the same place in an expression, this flag is a cheap way to distinguish the two without having to look ahead.- Parameters:
regexPossible
-- Returns:
-
-