in Compiler Design edited by
789 views
0 votes
0 votes
Which of the Statements are True :

S1: LR(1) grammar can be LR(0) but not LL(1).

S2 : Every regular language is LL(1)

S3 : Three address code is linear representation of Syntax Tree.
in Compiler Design edited by
by
789 views

3 Comments

$1.$ False, $LR(1)$ can be both $LR(0)$ and $LL(1)$

$2.$ Every regular is not $LL(1)$

$3.$ True
2
2
LR(1) grammer may or may not be LL(1) and LR(0).
0
0
moved by
3 Address Code is a linear representation of Intermediate Code and Syntax is a tree representation of Intermediate Code. Then how can Three address code is linear representation of Syntax Tree  ??
0
0

1 Answer

0 votes
0 votes

1 comment

Only the third statement is true. LR(1) grammars are a type of bottom-up parsing technique, and LL(1) grammars are a type of top-down parsing technique. There is no inherent relationship between the two, so it is not necessarily true that an LR(1) grammar can be an LL(1) grammar. Similarly, not all regular languages are necessarily LL(1) languages. Three-address code, on the other hand, is a linear representation of a syntax tree, so statement three is true.
0
0