001package gudusoft.gsqlparser.ir.bound;
002
003import gudusoft.gsqlparser.ir.common.SourceAnchor;
004
005/**
006 * Base class for all bound symbols (names resolved to semantic objects).
007 */
008public abstract class BoundSymbol {
009
010    private final String name;
011    private final BoundScope declaringScope;
012    private final SourceAnchor declarationAnchor;
013
014    protected BoundSymbol(String name, BoundScope declaringScope, SourceAnchor declarationAnchor) {
015        this.name = name;
016        this.declaringScope = declaringScope;
017        this.declarationAnchor = declarationAnchor;
018    }
019
020    public String getName() { return name; }
021    public BoundScope getDeclaringScope() { return declaringScope; }
022    public SourceAnchor getDeclarationAnchor() { return declarationAnchor; }
023
024    public abstract ESymbolKind getSymbolKind();
025
026    @Override
027    public String toString() {
028        return getSymbolKind() + ":" + name;
029    }
030}