refactor to new idea for generating custom ast that can be compiled against a standard compiler