change the way of searching reference node when parsing boolean gate