parse and emit function declarations