package prolog.model;

import java.io.*;
import prolog.*;

/**
 * <p>The symboltable is created by the scanner and parser during parsing.
 * All identifiers and strings of the sourceprogram are replaced by a number.
 * In the symboltable, the relation between the number and the original
 * string is stored</p>
 */
public interface ISymbolTable
{
	/**
	 * clears the symboltyble
	 */
	public void clear();

	/**
	 * encodes the given word
	 * @param word
	 * @return
	 */
	public int encode( String word );

	/**
	 * decodes the given word
	 * @param index
	 * @return
	 */
	public String decode( int index );

	/**
	 * decodes the given word
	 * @param index
	 * @return
	 */
	public String decode( IAtom index );

	/**
	 * generates xml representing the symboltable
	 */
	public void genXml( Writer out )
		throws IOException;
}
