/* * Main program * Reads and stores variables. * Invokes graph operations to build and colour the graph of variables. */ #include #include #include "token.h" #include "symbol.h" #include "graph.h" int main() { struct token t; GRAPH g; int stmt; token_init(stdin); stmt = 0; while (t = get_next_token(), t.type != EOF) { switch (t.type) { case TOKEN_IDENT: symbol_set_seen(t.symvalue, stmt); break; case ';': stmt++; break; /* ignore all else */ } } g = new_graph ... FILL IN STUFF HERE print_graph(g); return 0; } Here is an example of using the SYMBOL_ITER data type to add vertices for all of the symbols: SYMBOL_ITER i = new_symbol_iter(); SYMBOL x; for (x = first_symbol(i); x; x = next_symbol(i)) add_vertex(g, symbol_getname(x));