public static void parse (string[] args) {
	Vala.Parser parser = new Vala.Parser ();
	Vala.CodeContext context = new Vala.CodeContext();
	Vala.CodeContext.push(context);

	foreach (var path in args) {
		if (path.has_suffix (".vala")) {
			context.add_source_file (new Vala.SourceFile (context, Vala.SourceFileType.SOURCE, path));
		}
	}

	context.add_external_package("glib-2.0");
	context.add_external_package("gobject-2.0");
	context.add_external_package("libvala-0.40");

	parser.parse (context);

	context.resolver.resolve (context);
	context.analyzer.analyze (context);
	context.flow_analyzer.analyze (context);

	Vala.CodeContext.pop();
}

public static int main (string[] args) {

	int i = 0;
	while (i < 2) {
		// simulate calling the compiler multiple times
		parse(args);
		i++;
	}
	return 0;
}
