build an ast