Interface NewSymbolTable


  • public interface NewSymbolTable
    This 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 Detail

      • newSymbol

        @Deprecated
        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).
        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.
      • 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