Question: I need help with some compsci work - Class Activity Consider the following partial context-free grammar, in which The non-terminal term is the start symbol.

I need help with some compsci work -

I need help with some compsci work - Class Activity Consider thefollowing partial context-free grammar, in which The non-terminal "term" is the startsymbol. NUM is a terminal. The star (*) and the double-star (**)symbols are different terminals. Treat ** as one terminal symbol. We wantto design a top-down parsing algorithm. We need to perform the following

Class Activity Consider the following partial context-free grammar, in which The non-terminal "term" is the start symbol. NUM is a terminal. The star (*) and the double-star (**) symbols are different terminals. Treat ** as one terminal symbol. We want to design a top-down parsing algorithm. We need to perform the following tasks, Determine Nullable values Determine FIRST sets Determine FOLLOW sets Create parse table term = factor Y Y = * factor factor = factor power power = atom X X = ** power atom = NUM Answer to Activity - Determine FOLLOW Sets FOLLOW Relations Notes FOLLOW Sets Rules term = factor Y $ Y = * factor Y= E factor = factor factor = power power = atom X X = ** power X = E atom = NUM Answer to Activity - Required Info For Parsing Table Rules FIRST Sets of RHS RHS Nullable FOLLOW Sets of LHS term = factor Y $ Y = * factor Y = E factor = ~ factor factor = power power = atom X X = ** power X = E atom = NUM Answer to Activity - Top-Down Parse Table NUM $ term factor Y power atom Use empty cells to indicate syntax error. Stack Input NUM * NUM $ Term Answer to Activity Parsing Example Using Stack, Show the trace of stack for parsing NUM * NUM $

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!