Extracted common parse_file() function.

Replaced template_generate_from_file() and read_sitedef_from_file() with
calls to parse_file().

Adjusted the signature of related lexer and parser functions to work with
parse_file().