Package com.google.googlejavaformat.java
Class JavacTokens
java.lang.Object
com.google.googlejavaformat.java.JavacTokens
A wrapper around javac's lexer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static classAJavaTokenizerthat saves comments.(package private) static classATokens.Commentthat saves its text and start position.(package private) static classAn unprocessed input token, including whitespace and comments. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final CharSequenceThe lexer eats terminal comments, so feed it one we don't care about. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static com.google.common.collect.ImmutableList<JavacTokens.CommentWithTextAndPosition> getComments(com.sun.tools.javac.parser.Tokens.Token token, Map<com.sun.tools.javac.parser.Tokens.Comment, JavacTokens.CommentWithTextAndPosition> comments) static com.google.common.collect.ImmutableList<JavacTokens.RawTok> getTokens(String source, com.sun.tools.javac.util.Context context, Set<com.sun.tools.javac.parser.Tokens.TokenKind> stopTokens) Lex the input and return a list ofJavacTokens.RawToks.
-
Field Details
-
EOF_COMMENT
The lexer eats terminal comments, so feed it one we don't care about.
-
-
Constructor Details
-
JavacTokens
private JavacTokens()
-
-
Method Details
-
getTokens
public static com.google.common.collect.ImmutableList<JavacTokens.RawTok> getTokens(String source, com.sun.tools.javac.util.Context context, 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, Map<com.sun.tools.javac.parser.Tokens.Comment, JavacTokens.CommentWithTextAndPosition> comments)
-