public interface NewCpdTokens
sensorContext.newCpdTokens().onFile(inputFile) .addToken(1, 10, 1, 15, "class") .addToken(1, 16, 1, 18, "IDENTIFIER") // Add more tokens .save;
Modifier and Type | Method and Description |
---|---|
NewCpdTokens |
addToken(int startLine,
int startLineOffset,
int endLine,
int endLineOffset,
java.lang.String image)
Shortcut to avoid calling
InputFile.newRange(int, int, int, int) |
NewCpdTokens |
addToken(TextRange range,
java.lang.String image)
Call this method to register a token in a range.
|
NewCpdTokens |
onFile(InputFile inputFile)
The tokenized file.
|
void |
save()
Call this method only once when your are done with defining tokens of the file.
|
NewCpdTokens onFile(InputFile inputFile)
NewCpdTokens addToken(TextRange range, java.lang.String image)
range
- Token position. Use InputFile.newRange(int, int, int, int)
to get a valid range.image
- Text content of the token. Can be replaced by a constant placeholder for some tokens (like litterals).NewCpdTokens addToken(int startLine, int startLineOffset, int endLine, int endLineOffset, java.lang.String image)
InputFile.newRange(int, int, int, int)
void save()