1
GATE CSE 2018
+2
-0.6
Consider the following parse tree for the expression $$a \ne b\ c\ d \ne e \ne f,$$ involving two binary operators $$\$$ and $$\ne$$.

Which one of the following is correct for the given parse tree?

A
$$\$$ has higher precedence and is left associative; $$\ne$$ is right associative
B
$$\ne$$ has higher precedence and is left associative; $$\$$ is right associativ
C
$$\$$ has higher precedence and is left associative; $$\ne$$ is left associative
D
$$\ne$$ has higher precedence and is right associative; $$\$$ is left associative
2
GATE CSE 2016 Set 2
+2
-0.6
A student wrote two context-free grammars G1 and G2 for generating a single $$C$$-like array declaration. The dimension of the array is at least one. For example, $${\mathop{\rm int}} \,\,\,\,\,\,\,a[10]\,\,[3];$$\$

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?

A
Both G1 and G2
B
Only G1
C
Only G2
D
Neither G1 nor G2
3
GATE CSE 2016 Set 1
Numerical
+2
-0
The attributes of three arithmetic operators in some programming language are given below.

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 _______________.

4
GATE CSE 2015 Set 3
+2
-0.6
Consider the following grammar $$G$$

\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$$

A
Only $$S1$$
B
Only $$S2$$
C
both $$S1$$ and $$S2$$
D
Neither $$S1$$ nor $$S2$$
GATE CSE Subjects
EXAM MAP
Medical
NEET