clast traversal and node filtering support
[cloog.git] / examples / example / example.c
blob403d213674c1e10127ab80eeafc0e8e59f949ca1
1 /* This is a very simple example of how to use the CLooGLib inside your
2 * programs. You should compile it by typing 'make' (after edition of the
3 * makefile), then test it for instance by typing
4 * 'more FILE.cloog | ./example' (or example.exe under Cygwin).
5 */
7 # include <stdio.h>
8 # include <cloog/cloog.h>
10 int main()
12 CloogState *state;
13 CloogInput *input;
14 CloogOptions * options ;
15 struct clast_stmt *root;
17 state = cloog_state_malloc();
18 options = cloog_options_malloc(state);
19 input = cloog_input_read(stdin, options);
21 root = cloog_clast_create_from_input(input, options);
22 clast_pprint(stdout, root, 0, options);
24 cloog_clast_free(root);
25 cloog_options_free(options) ;
26 cloog_state_free(state);
28 return 0 ;