def symbol(self, index):
<EOL>if isinstance(index, str):<EOL><INDENT>return index<EOL><DEDENT>elif (index < <NUM_LIT:0>) or (index >= self.symtab.table_len):<EOL><INDENT>self.error("<STR_LIT>")<EOL><DEDENT>sym = self.symtab.table[index]<EOL>if sym.kind == SharedData.KINDS.LOCAL_VAR:<EOL><INDENT>return "<STR_LIT>".format(sym.attribute * <NUM_LIT:4> + <NUM_LIT:4>)<EOL><DEDENT>elif sym.kind == SharedData.KINDS.PARAMETER:<EOL><INDENT>return "<STR_LIT>".format(<NUM_LIT:8> + sym.attribute * <NUM_LIT:4>)<EOL><DEDENT>elif sym.kind == SharedData.KINDS.CONSTANT:<EOL><INDENT>return "<STR_LIT>".format(sym.name)<EOL><DEDENT>else:<EOL><INDENT>return "<STR_LIT>".format(sym.name)<EOL><DEDENT>
Generates symbol name from index