假设某程序语言的文法如下:S→a|b|(T)T→TdS|S其中:VT=a,b,d,(,),VNS,T,S是开始符号。考查该文法,称句型(Sd(T)db)是S的一个 (33) ,其中, (34) 是句柄: (35) 是素短语; (36) 是该句型的直接短语; (37) 是短语。 (33)处填()。
A. 最左推导
B. 最右推导
C. 规范推导
D. 推导
假设某程序语言的文法如下:S→SaT|TT→TbR|RT→PdR|P P→fSg|e其中:VT=a,b,d,e,f,g,VNS,T,R,P,S是开始符号。那么,此方法是 (38) 方法。这种文法的语法分析通常采用优先矩阵,优先矩阵给出了该文法中各个终结符之间的优先关系 (大于,小于,等于,无关系)。在上述文法中,某些终结符之间的优先关系如下:b (39) a:f (40) g;a (41) a;d (42) d。 (38)处填()。
A. 正规文法
B. 算符文法
C. 二义文法
D. 属性文法
There are many kinds of friends. Some are always ( 1 ) you, but don’t understand you. Some say only a few words to you, but understand you. Many people will step in your life, but only ( 2 )friends leave footprints. I shall always recall the autumn and the girl with the ( 3 ). She will always bring back the friendship between us. I know she will always be my best friend. It was the golden season. I could see the yellow leaves ( 4 )with the cool ( 5 ). In such a season, I liked walking alone on the roads covered with leaves, ( 6 )to the sound of them. Autumn is a ( 7 )season and life is uninteresting. The free days always get me ( 8 ). But one day, the sound of a violin ( 9 )into my ears like a stream flowing in the mountains. I was so surprised that I jumped to see what it was. A young girl, standing in the wind, was ( 10 )in playing her violin. I had ( 11 )seen her before. The music was so nice that I listened quietly. Lost in the music, I didn’t know that I had been ( 12 )there for so long but my existence did not seem to disturb her. Leaves were still falling. Every day she played the violin at the corner of the building ( 13 )I went downstairs to watch her performance. I was the only listener. The autumn seemed no longer lonely and life became ( 14 ). ( 15 )we didn’t know each other, I thought we were already good friends. I believe she also loved me. Autumn was nearly over. One day, when I was listening carefully, the sound suddenly ( 16 ). To my astonishment, the girl came over to me. “You must like music from the violin.” she said. “Yes. And you play very well. Why did you stop” I asked. Suddenly, a ( 17 )expression appeared on her face and I could feel something unusual. “I came here to see my grandmother, but now I must leave. I once played very badly. It was your listening every day that ( 18 )me.” she said. “In fact, it was your playing ( 19 )gave me a meaningful autumn,” I answered, “Let’s be friends.” The girl smiled, and so did I. I never heard her play again in my life. I no longer went downstairs to listen to her. Only thick leaves were left behind. But I will always remember the fine figure (身影) of the girl. She is like a ( 20 )―so short, so bright, like a shooting star giving off so much light that makes the autumn beautiful.
A. happy
B. sad
C. strange
D. surprised