rewrite obj compilation rule using static pattern