Menu

(Solved) : 1 20 Points Consider Following Cfg Starting Non Terminal Generating Simple Arithmetic Expr Q30121699 . . .

1) (20 points) Consider the following CFG, with starting non-terminal A, for generating simple arithmetic expressions involving integers between 0 and 9: A-> AtEB B (A)A A->112131415 617181910 List the non-terminals for the above grammar. Which non-terminal is the starting non-terminal? List the terminals for the above grammar. Is the above context-free grammar a regular grammar (yes or no)? If not then specify one of the above productions that violates the format for a regular grammar. Give a leftmost derivation for the string 3+5*4 Give a parse tree for the same string 3+5*4 based on the above derivation. Is the grammar ambiguous (yes or no)? Be sure to prove your answer.|

1) (20 points) Consider the following CFG, with starting non-terminal A, for generating simple arithmetic expressions involving integers between 0 and 9: A-> AtEB B (A)A A->112131415 617181910 List the non-terminals for the above grammar. Which non-terminal is the starting non-terminal? List the terminals for the above grammar. Is the above context-free grammar a regular grammar (yes or no)? If not then specify one of the above productions that violates the format for a regular grammar. Give a leftmost derivation for the string 3+5*4 Give a parse tree for the same string 3+5*4 based on the above derivation. Is the grammar ambiguous (yes or no)? Be sure to prove your answer.| Show transcribed image text

Expert Answer


Answer to 1 20 Points Consider Following Cfg Starting Non Terminal Generating Simple Arithmetic Expr Q30121699 . . .

OR