Add helper for compile to ast