Package com.google.googlejavaformat.java
Class JavacTokens
- java.lang.Object
-
- com.google.googlejavaformat.java.JavacTokens
-
final class JavacTokens extends java.lang.ObjectA wrapper around javac's lexer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classJavacTokens.AccessibleScanner(package private) static classJavacTokens.CommentSavingTokenizerAJavaTokenizerthat saves comments.(package private) static classJavacTokens.CommentWithTextAndPositionATokens.Commentthat saves its text and start position.(package private) static classJavacTokens.RawTokAn unprocessed input token, including whitespace and comments.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.CharSequenceEOF_COMMENTThe lexer eats terminal comments, so feed it one we don't care about.
-
Constructor Summary
Constructors Modifier Constructor Description privateJavacTokens()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static com.google.common.collect.ImmutableList<JavacTokens.CommentWithTextAndPosition>getComments(com.sun.tools.javac.parser.Tokens.Token token, java.util.Map<com.sun.tools.javac.parser.Tokens.Comment,JavacTokens.CommentWithTextAndPosition> comments)static com.google.common.collect.ImmutableList<JavacTokens.RawTok>getTokens(java.lang.String source, com.sun.tools.javac.util.Context context, java.util.Set<com.sun.tools.javac.parser.Tokens.TokenKind> stopTokens)Lex the input and return a list ofJavacTokens.RawToks.
-
-
-
Method Detail
-
getTokens
public static com.google.common.collect.ImmutableList<JavacTokens.RawTok> getTokens(java.lang.String source, com.sun.tools.javac.util.Context context, java.util.Set<com.sun.tools.javac.parser.Tokens.TokenKind> stopTokens)
Lex the input and return a list ofJavacTokens.RawToks.
-
getComments
private static com.google.common.collect.ImmutableList<JavacTokens.CommentWithTextAndPosition> getComments(com.sun.tools.javac.parser.Tokens.Token token, java.util.Map<com.sun.tools.javac.parser.Tokens.Comment,JavacTokens.CommentWithTextAndPosition> comments)
-
-