The code for all nodes is in src/backend/executor.
I think that you will find it useful to look at the big switch
statements in ExecInitNode() and friends in execProcnode.c .
--
Peter Geoghegan http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services