implement basic select compiler