def build_and_run_file(filename):
(directory, name, extension) = get_file_tuple(filename)<EOL>if extension == '<STR_LIT:c>':<EOL><INDENT>print("<STR_LIT>", YELLOW, "<STR_LIT>" + filename + "<STR_LIT>",RESET, "<STR_LIT>")<EOL>compiler = Compiler(filename)<EOL>out = compiler.compile()<EOL>if out != <NUM_LIT:0>:<EOL><INDENT>print('<STR_LIT>', out, '<STR_LIT>')<EOL>return out<EOL><DEDENT>print("<STR_LIT>")<EOL>out = compiler.run()<EOL>return out<EOL><DEDENT>elif extension == '<STR_LIT>':<EOL><INDENT>print("<STR_LIT>", YELLOW, "<STR_LIT>" + filename + "<STR_LIT>",RESET, "<STR_LIT>")<EOL>compiler = Compiler(filename)<EOL>out = compiler.compile()<EOL>if out != <NUM_LIT:0>:<EOL><INDENT>print('<STR_LIT>', out, '<STR_LIT>')<EOL>return out<EOL><DEDENT>print("<STR_LIT>")<EOL>out = compiler.run()<EOL>return out<EOL><DEDENT>elif extension == '<STR_LIT>':<EOL><INDENT>print("<STR_LIT>", YELLOW, "<STR_LIT>" + filename + "<STR_LIT>",RESET, "<STR_LIT>")<EOL>compiler = Compiler(filename)<EOL>out = compiler.run()<EOL>return out<EOL><DEDENT>elif extension == '<STR_LIT>':<EOL><INDENT>command = EXECUTABLE_JAVAC + '<STR_LIT:U+0020>' + filename<EOL>perform_system_command(command)<EOL>command_run = EXECUTABLE_JAVA + '<STR_LIT:U+0020>' + name<EOL>test_file = directory + "<STR_LIT:/>" + name + "<STR_LIT>"<EOL>if os.path.exists(test_file):<EOL><INDENT>command_run += "<STR_LIT>" + test_file<EOL><DEDENT>return perform_system_command(command_run)<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>")<EOL>return -<NUM_LIT:1><EOL><DEDENT>
Builds and runs the filename specified
        according to the extension
        PARAM filename: name of file to build and run