Interface NewSymbolTable
-
- All Known Implementing Classes:
DefaultSymbolTable
public interface NewSymbolTableThis builder is used to define symbol references on files. Example: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();- Since:
- 5.6
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description NewSymbolnewSymbol(int startOffset, int endOffset)Deprecated.since 5.6 Only supported to ease migration from old API.NewSymbolnewSymbol(int startLine, int startLineOffset, int endLine, int endLineOffset)Shortcut to avoid callingInputFile.newRange(int, int, int, int)NewSymbolnewSymbol(TextRange range)Register a new symbol declaration.NewSymbolTableonFile(InputFile inputFile)The file the symbol table belongs to.voidsave()Call this method only once when your are done with defining all symbols of the file.
-
-
-
Method Detail
-
onFile
NewSymbolTable onFile(InputFile inputFile)
The file the symbol table belongs to.
-
newSymbol
@Deprecated NewSymbol newSymbol(int startOffset, int endOffset)
Deprecated.since 5.6 Only supported to ease migration from old API. Please prefernewSymbol(int, int, int, int).Register a new symbol declaration.- Parameters:
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 newSymbol(TextRange range)
Register a new symbol declaration.- Parameters:
range- Range of text for the symbol declaration. See for exampleInputFile.newRange(int, int, int, int).
-
newSymbol
NewSymbol newSymbol(int startLine, int startLineOffset, int endLine, int endLineOffset)
Shortcut to avoid callingInputFile.newRange(int, int, int, int)
-
save
void save()
Call this method only once when your are done with defining all symbols of the file. It is not permitted to save a symbol table twice for the same file.- Throws:
java.lang.IllegalStateException- if you have defined overlapping symbols
-
-