In this paper, we introduce a context-free grammar G : x → xy, y → zu, z → zw, w → xv, u → xyz −1 v, v → x −1 zwu over the variable set V = {x, y, z, w, u, v}. We use this grammar to study joint distributions of several permutation statistics related to descents, rises, peaks and valleys. By considering the pattern of an exterior peak, we introduce the exterior peaks of pattern 132 and of pattern 231. Similarly, peaks can also be classified according to their patterns. Let D be the formal derivative operator with respect to the grammar G. By using a grammatical labeling, we show that D n (z) is the generating function of the number of permutations on [n] = {1, 2, . . . , n} with given numbers of exterior peaks of pattern 132 and of pattern 231, and proper double descents. By solving a cylinder differential equation, we obtain an explicit formula of the generating function of D n (z), which can be viewed as a unification of the results of Elizalde-Noy, Barry, Basset, Fu and Gessel. Specializations lead to the joint distributions of certain consecutive patterns in permutations, as studied by Elizalde-Noy and Kitaev. By a different labeling with respect to the same grammar G, we derive the joint distribution of peaks of pattern 132 and of pattern 231, double descents and double rises, with the generating function also expressed by the parabolic cylinder functions. This formula serves as a refinement of the work of Carlitz-Scoville. Furthermore, we obtain the joint distribution of exterior peaks of pattern 132 and of pattern 231 over alternating permutations.