Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem2 Convert the NFA from problem 1 to Deterministic Finite Automaton (DFA)

ID: 3875994 • Letter: P

Question

Problem2 Convert the NFA from problem 1 to Deterministic Finite Automaton (DFA) Problem 3 Suppose there is a programming language D++ in which arithmetic expressions are given in the following form Infix Notation D44 A+B A-B AB!+ ABI ABS ABS/ ABCI+S ABS C A/B A (B+C A B+C Create a Context-Free Grammar for language D++. Identify terminals and non-terminals. Is this grammar ambiguous? Problem 4 Demonstrate a parse tree for expression: ABS CDI+S Problem 5 Create a DFA for a bottom-up parsing using grammar EE+TIT, T-(E)11. Using the DFA, demonstrate bottom-up parsing for expression: (1+1)+1

Explanation / Answer

2) All the variables in the D++ part become terminals and infix become non terminals.

The context free grammar becomes:

(A+B) -> AB!+

(A-B) -> AB!-

(A*B)-> AB$*

(A/B)->AB$/

3)

The parse tree for AB$*CD!+$*

(A*B)*(C+D)

| |

(AB$*) * (CD!+)

|

AB$*CD!+$*

A

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote