/**
 * 
 */
package dspl.backend.test;


import dspl.SymbolTable;
import dspl.intermediate.instructions.Instruction;

/**
 * Base abstract class for other classes to extend which generate the intermediate format
 * required for the backend to finish compiling. <p>
 * The intent is to allow the testing of back-end features by manually compiling the expected
 * intermediate format, rather than having to wait for the front end to be completed before
 * being able to test the back-end compiling asm. <br>
 * @author David
 */
public abstract class IntermediateTestCase {
	public Instruction firstInst; 
	public SymbolTable st; 
	
	/**
	 * Get the First Instruction represneting the Test Case Program
	 * @return first Instruction in the test case program
	 */
	public Instruction getFirstInstr() {
		if (firstInst==null) { 
			throw new Error("Error: getFirstInst called when firstInst is null"); 
		}
		return firstInst; 
	}
	
	/**
	 * Get the symbol table 
	 * @return symboltable
	 */
	public SymbolTable getSymbolTable() { 
		if (st==null) {
			throw new Error("Error: getSymbolTable called when symbol table is null"); 
		}
		return st; 
	}
	
	/**
	 * Returns the test case name<br> Example "HelloWorldv1"; 
	 * @return
	 */
	public abstract String getTestCaseName(); 
}
