Interface NewSymbolTable
-
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 Modifier and Type Method Description 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
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
-
-