+#include "yapi.h"
+#include "application.h"
+#include <fstream>
+
+using namespace std;
+
+int main()
+{
+ // create yapi run-time environment
+ RTE rte;
+
+ // redirect standard output
+ ofstream f("./app.out");
+ rte.setOutStream(f);
+
+ // redirect standard error
+ ofstream g("./app.err");
+ rte.setErrorStream(g);
+
+ // create toplevel process network
+ Application app(id("app"));
+
+ // start the process network and
+ // wait for processes to finish
+ rte.start(app);
+
+ // print workload
+ ofstream h("./appworkload.txt");
+ printWorkload(app, h);
+
+ // generate dotty file
+ ofstream i("./app.dot");
+ printDotty(app, i);
+
+ f.close();
+ g.close();
+ h.close();
+ i.close();
+
+ return 0;
+}