Question
Consider the grammar $S \rightarrow a$$S \rightarrow a b$The given grammar is:(A) LR (1) only(B) LL (1) only(C) Both LR (1) and LL (1)(D) LR (1) but not LL (1)
Step 1
The grammar has two production rules: $S \rightarrow a$ and $S \rightarrow ab$. Show more…
Show all steps
Your feedback will help us improve your experience
James Kiss and 101 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Given grammar is (A) Only LR (1) (B) Only LL (1) (C) Both LR (1) and LL (1) (D) Neither LR (1) nor LL (1)
COMPILER DESIGN
LEXICAL ANALYSIS AND PARSING
The following grammar is $S \rightarrow A a A b / B b B a$ $A \rightarrow \varepsilon$ $B \rightarrow \varepsilon$ (A) LL (1) (B) Not LL (1) (C) Recursive (D) Ambiguous
Which of the following is an unambiguous grammar that is not LR (1)? (A) $S \rightarrow \mathrm{Uab} \mid \mathrm{Vac}$ $U \rightarrow d$ $V \rightarrow d$ (B) $S \rightarrow \mathrm{Uab} / \mathrm{Vab} / \mathrm{Vac}$ $U \rightarrow d$ $V \rightarrow d$ (C) $S \rightarrow A B$ $A \rightarrow a$ $B \rightarrow b$ (D) $S \rightarrow A b$ $A \rightarrow a / c$
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD