add compile method to compiler