Pattern matching and generating.