public interface NewSymbolTable
NewSymbolTable symbolTable = sensorContext.newSymbolTable().onFile(inputFile); symbolTable.newSymbol(1, 10, 1, 15) .newReference(10, 12, 10, 17) .newReference(11, 11, 11, 16); // Add more symbols if needed symbolTable.save();
Modifier and Type | Method and Description |
---|---|
NewSymbol |
newSymbol(int startOffset,
int endOffset)
Deprecated.
since 5.6 Only supported to ease migration from old API. Please prefer
newSymbol(int, int, int, int) . |
NewSymbol |
newSymbol(int startLine,
int startLineOffset,
int endLine,
int endLineOffset)
Shortcut to avoid calling
InputFile.newRange(int, int, int, int) |
NewSymbol |
newSymbol(TextRange range)
Register a new symbol declaration.
|
NewSymbolTable |
onFile(InputFile inputFile)
The file the symbol table belongs to.
|
void |
save()
Call this method only once when your are done with defining all symbols of the file.
|
NewSymbolTable onFile(InputFile inputFile)
@Deprecated NewSymbol newSymbol(int startOffset, int endOffset)
newSymbol(int, int, int, int)
.startOffset
- Starting position in file for the declaration of this symbol. Beginning of a file starts with offset '0'.endOffset
- End position in file for this symbol declaration.NewSymbol newSymbol(TextRange range)
range
- Range of text for the symbol declaration. See for example InputFile.newRange(int, int, int, int)
.NewSymbol newSymbol(int startLine, int startLineOffset, int endLine, int endLineOffset)
InputFile.newRange(int, int, int, int)
void save()
IllegalStateException
- if you have defined overlapping symbolsCopyright © 2009–2018 SonarSource. All rights reserved.