A Common Framework to Recognize Two-dimensional Languages