X-ref grammar