Week 3 assignment for Team Python
A. Create a CFG that can be used to validate the expression below.
𝑨 = (𝟓 ÷ 𝟕)𝟐 − (𝟖 × 𝟗)𝟑 + 𝟔
i. Draw the parse tree.
ii. Draw the abstract syntax tree.
B. Create a CFG for the if-elif-else statement in Python.
C. Design a Regular expression for 3-letter English words that start with the letter
‘c’.
Week 3 assignment for Team Java
A. Create a CFG that can be used to validate the expression below.
−𝒃 ± √𝒃𝟐 − 𝟒𝒂𝒄
𝒙=
𝟐𝒂
i. Draw the parse tree.
ii. Draw the abstract syntax tree.
B. Create a CFG for the switch statement in Java.
C. Design a Regular expression for 4-letter English words that start with the letter
‘b’ and end with the letter ‘n’.