Commit 1e10fd63 authored by Adam P. Goucher's avatar Adam P. Goucher

Accept file names as command-line arguments

parent 51084663
Pipeline #37795762 passed with stages
in 6 minutes and 21 seconds
......@@ -11,11 +11,17 @@
///bin/cat /dev/null; date
///bin/cat /dev/null; exit $status
int main() {
int main(int argc, char* argv[]) {
std::string infile = "infile.mc";
std::string outfile = "outfile.mc";
if (argc > 1) { infile = argv[1]; }
if (argc > 2) { outfile = argv[2]; }
apg::lifetree<uint32_t, 1> lt(1000);
apg::lifetree<uint32_t, 4> lt4(100);
apg::pattern inf(&lt4, "infile.mc");
apg::pattern inf(&lt4, infile);
apg::sparselab spl(&lt);
apg::scstream scs;
......@@ -36,7 +42,7 @@ int main() {
apg::pattern y = x & x[2] & x[4] & x[6] & x[8];
apg::pattern g = x - y;
y += g.stream(scs.gstream);
std::ofstream out("outfile.mc");
std::ofstream out(outfile);
y.write_macrocell(out);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment