Class Scanner
- java.lang.Object
-
- com.google.javascript.jscomp.parsing.parser.Scanner
-
public class Scanner extends java.lang.Object
Scans javascript source code into tokens. All entrypoints assume the caller is not expecting a regular expression literal except for nextRegularExpressionLiteralToken.7 Lexical Conventions
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Scanner.CommentRecorder
-
Constructor Summary
Constructors Constructor Description Scanner(ErrorReporter errorReporter, Scanner.CommentRecorder commentRecorder, SourceFile file, int offset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SourceFile
getFile()
int
getOffset()
SourcePosition
getPosition()
LiteralToken
nextRegularExpressionLiteralToken()
TemplateLiteralToken
nextTemplateLiteralToken()
Token
nextToken()
Token
peekToken()
Token
peekToken(int index)
void
setPosition(SourcePosition position)
-
-
-
Constructor Detail
-
Scanner
public Scanner(ErrorReporter errorReporter, Scanner.CommentRecorder commentRecorder, SourceFile file, int offset)
-
-
Method Detail
-
getFile
public SourceFile getFile()
-
getOffset
public int getOffset()
-
setPosition
public void setPosition(SourcePosition position)
-
getPosition
public SourcePosition getPosition()
-
nextToken
public Token nextToken()
-
nextRegularExpressionLiteralToken
public LiteralToken nextRegularExpressionLiteralToken()
-
nextTemplateLiteralToken
public TemplateLiteralToken nextTemplateLiteralToken()
-
peekToken
public Token peekToken()
-
peekToken
public Token peekToken(int index)
-
-