Which one of the following is correct for the given parse tree?
| Operator | Precedence | Associativity | Arity |
|---|---|---|---|
| + | High | Left | Binary |
| _ | Medium | Right | Binary |
| * | Low | Left | Binary |
The value of the expression $$2 - 5 + 1 - 7 * 3$$ in this language is _______________.
The grammars use D as the start symbol, and use six terminal symbols int ; id [ ] num.
| Grammar G1 | Grammar G2 |
|---|---|
| D → intL; | D → intL; |
| L → id[E | L → idE |
| E → num | E → E[num] |
| E → num][E | E → [num] |
Which of the grammars correctly generate the declaration mentioned above?
$$\eqalign{ & \,\,\,\,\,\,\,S \to \,\,\,\,\,\,\,F|H \cr & \,\,\,\,\,\,F \to \,\,\,\,\,\,\,p|c \cr & \,\,\,\,\,\,H \to \,\,\,\,\,\,\,d|c \cr} $$
where $$S, F$$ and $$H$$ are non-terminal symbols, $$p, d,$$ and $$c$$ are terminal symbols. Which of the following statement(s) is/are correct?
$$\,\,\,\,\,\,\,S1.\,\,\,\,\,\,\,LL\left( 1 \right)\,\,$$ can parse all strings that are generated using grammar $$G$$
$$\,\,\,\,\,\,\,S2.\,\,\,\,\,\,\,LR\left( 1 \right)\,\,$$ can parse all strings that are generated using grammar $$G$$
GATE CSE Subjects
Browse all chapters by subject