23JON
@23JON (23 JON)

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

プログラミング言語の質問

学校の課題で確認があります。
こんな問題が出題されました。

  1. 以下の文法に従い,演算子順位行列を用いて2.3の構文解析アルゴリズムに基づいて, 文 b + (a * c + d) が構文解析される過程を示せ.

G = (VN, VT, P, s) VN = {E, T, F} VT = {+, *, (, ), a, b, c, d}
P = {E → E + E, E → E * E, E → ( E ), E → a, E → b, E → c, E → d}
s = E

この問題の答えは、以下で正しいでしょうか。
E  ⇒  E+E  ⇒  E+(E)  ⇒  E+(E+E)  ⇒  E+(E*E+E)  ⇒   
b+(E*E+E)    ⇒  b+(a*E+E)  ⇒  b+(a*c+E)  ⇒  b+(a*c+d)

0

No Answers yet.

Your answer might help someone💌