• 2022-06-11
    考虑下面的属性文法G(S):产 生 式语 义 规 则S ® ABC print A.num, B.num, C.num A ® [img=20x22]1803d731db39d57.png[/img] aA.num = [img=20x22]1803d731db39d57.png[/img].num + 1A ® εA.num = 0B ® [img=20x22]1803d731ec91e62.png[/img] bB.num = [img=20x22]1803d731ec91e62.png[/img].num + 1B ® εB.num = 0C ® [img=20x22]1803d731fcad3f0.png[/img] cC.num = [img=20x22]1803d731fcad3f0.png[/img].num + 1C ® εC.num = 0对于输入字符串aabbbc进行语法分析和属性计算,输出结果是
    A: 1 2 3
    B: 3 2 1
    C: 2 3 1
    D: 2 1 3
  • 举一反三