org.sonar.api.batch.sensor.symbol
Interface SymbolTableBuilder


@Beta
public interface SymbolTableBuilder

Experimental, do not use.

Use this builder to create symbol references. For now only references in the same file are supported.

Since:
4.5

Method Summary
 void done()
          Call this method only once when your are done with defining symbols of the file.
 void newReference(Symbol symbol, int fromOffset)
          Records that a Symbol is referenced at another location in the same file.
 Symbol newSymbol(int fromOffset, int toOffset)
          Create a new symbol.
 

Method Detail

newSymbol

Symbol newSymbol(int fromOffset,
                 int toOffset)
Create a new symbol.

Parameters:
fromOffset - Starting offset in a file for the symbol declaration. File starts at offset '0'.
toOffset - Ending offset of symbol declaration.
Returns:
a new Symbol that can be used later in newReference(Symbol, int)

newReference

void newReference(Symbol symbol,
                  int fromOffset)
Records that a Symbol is referenced at another location in the same file.

Parameters:
symbol - Symbol previously created with newSymbol(int, int)
fromOffset - Starting offset of the place symbol is referenced. No need for end offset here since we assume it is same length.

done

void done()
Call this method only once when your are done with defining symbols of the file.



Copyright © 2009–2014 SonarSource. All rights reserved.