'Initializes Config. This is a separate method as it raises an exception
if there is a parse error.'

def Init(self, params):

    generator_flags = params.get('generator_flags', {})
    config_path = generator_flags.get('config_path', None)
    if (not config_path):
        return
    try:
        f = open(config_path, 'r')
        config = json.load(f)
        f.close()
    except IOError:
        raise Exception(('Unable    to    open    file    ' + config_path))
    except ValueError as e:
        raise Exception((('Unable    to    parse    config    file    ' + config_path) + str(e)))
    if (not isinstance(config, dict)):
        raise Exception('config_path    must    be    a    JSON    file    containing    a    dictionary')
    self.files = config.get('files', [])
    self.additional_compile_target_names = set(config.get('additional_compile_targets', []))
    self.test_target_names = set(config.get('test_targets', []))
