3 #include <isl_printer.h>
4 #include <isl_stream.h>
6 struct isl_arg_choice cat_format[] = {
7 {"isl", ISL_FORMAT_ISL},
8 {"omega", ISL_FORMAT_OMEGA},
9 {"polylib", ISL_FORMAT_POLYLIB},
10 {"latex", ISL_FORMAT_LATEX},
15 struct isl_options *isl;
19 struct isl_arg cat_options_arg[] = {
20 ISL_ARG_CHILD(struct cat_options, isl, "isl", isl_options_arg, "isl options")
21 ISL_ARG_CHOICE(struct cat_options, format, 0, "format", \
22 cat_format, ISL_FORMAT_ISL, "output format")
26 ISL_ARG_DEF(cat_options, struct cat_options, cat_options_arg)
28 int main(int argc, char **argv)
33 struct cat_options *options;
36 options = cat_options_new_with_defaults();
38 argc = cat_options_parse(options, argc, argv, ISL_ARG_ALL);
40 ctx = isl_ctx_alloc_with_options(cat_options_arg, options);
42 s = isl_stream_new_file(ctx, stdin);
43 obj = isl_stream_read_obj(s);
46 p = isl_printer_to_file(ctx, stdout);
47 p = isl_printer_set_output_format(p, options->format);
48 p = obj.type->print(p, obj.v);
49 p = isl_printer_end_line(p);
52 obj.type->free(obj.v);