Visual grammar