public final class JavadocScannerUtil extends Object
JavadocScanner
.Modifier and Type | Method and Description |
---|---|
static int |
consumeLineEnd(JavadocScanner scanner,
boolean multiline)
Consumes the next line-break, and its consequent white-space, and asterisk tokens.
|
static int |
countUntil(Collection<JavadocTokenKind> kinds,
JavadocScanner scanner,
int start)
Returns the number of tokens from the starting index until each token has the specified kind.
|
static int |
countUntilBlockEnd(JavadocScanner scanner,
int start)
Returns the number of tokens from the starting index until the current block was closed.
|
static int |
countUntilCommentEnd(JavadocScanner scanner,
boolean returnMinusIfMissing,
int start)
Returns the number of tokens from the starting index until the end of this comment.
|
static int |
countUntilNextLineStart(JavadocScanner scanner,
int start)
Returns the number of tokens from the starting index until the next printable token on the subsequent lines.
|
static int |
countUntilNextPrintable(JavadocScanner scanner,
int start)
Returns the number of tokens from the starting index until the next printable token.
|
static int |
countWhile(Collection<JavadocTokenKind> kinds,
JavadocScanner scanner,
int start)
Returns the number of tokens from the starting index while each token has the specified kind.
|
static List<JavadocToken> |
lookaheadTokens(JavadocScanner scanner,
int start,
int count)
Returns the a sequence of tokens.
|
public static List<JavadocToken> lookaheadTokens(JavadocScanner scanner, int start, int count)
count
,
except EOF token (JavadocTokenKind.EOF
) and its trailing tokens.scanner
- the target scannerstart
- the starting indexcount
- the max token countpublic static int countWhile(Collection<JavadocTokenKind> kinds, JavadocScanner scanner, int start)
kinds
- the target kinds (JavadocTokenKind.EOF
will be ignored)scanner
- the target scannerstart
- the starting indexpublic static int countUntil(Collection<JavadocTokenKind> kinds, JavadocScanner scanner, int start)
kinds
- the target kinds (JavadocTokenKind.EOF
will be always enabled)scanner
- the target scannerstart
- the starting indexpublic static int countUntilBlockEnd(JavadocScanner scanner, int start)
scanner
- the target scannerstart
- the starting indexpublic static int countUntilCommentEnd(JavadocScanner scanner, boolean returnMinusIfMissing, int start)
scanner
- the target scannerreturnMinusIfMissing
- true
to return -1
if missing the end of comment,
or false
to return the number of tokens if missing itstart
- the starting indexpublic static int countUntilNextPrintable(JavadocScanner scanner, int start)
scanner
- the target scannerstart
- the starting indexpublic static int countUntilNextLineStart(JavadocScanner scanner, int start)
scanner
- the target scannerstart
- the starting indexpublic static int consumeLineEnd(JavadocScanner scanner, boolean multiline)
multiline
option, this also consumes them on the subsequent lines.scanner
- the target scannermultiline
- true
to consume line end on multiple lines, otherwise false
Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.