when a reference starts with ., find from root
add Makefile for regenerating grammar