3
$\begingroup$

I came across $2$ translation schemes of Syntax Directed Translation (SDT) in compilers which are as follows :

  • Using a top-down translation scheme, we can implement any $L$-attributed definition based on a $LL(1)$ grammar.
  • Using a bottom-up translation scheme, we can also implement any $L$-attributed definition based on a $LL(1)$ grammar (each $LL(1)$ grammar is also an $LR(1)$ grammar).

What these $2$ Definitions actually mean ? I am not getting ..


I am well aware of $L$-attributed definition and $S$-attributed definition of SDT and top down parsing and bottom up parsing but It is just that I am unable to recollect this information and phrase it according to the definitions given above.


It would be good, if I can get one example of both definitions so, that I can phrase it meaningfully of what is said .

$\endgroup$
1
$\begingroup$

LL Means Left read and Left derived and LR is Left read and Right derived the left and right part generally makes the difference between how the parser is written and if it top down or bottom up parsing.

The dragon book should be your go-to reference for anything related to parsers and parsing techniques.

$\endgroup$
1
$\begingroup$
  • Using a top-down translation scheme, we can implement any $LL$-attributed definition based on $LL(1)$ grammar.
  • Using a bottom-up translation scheme, we can also implement any $LL$-attributed definition based on $LL(1)$ grammar (each $LL(1)$ grammar is also an $LR(1)$ grammar). Using bottom-up translation scheme, we implement $LR$ grammar actually but since $LL(1) \subset LR(1)$ we can safely implement $LL(1)$ grammar as well. enter image description here
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.