Postfix Translation
Postfix Translation
In a production A β Ξ±, the translation rule of A.CODE consists of the concatenation of the CODE translations of the non-terminals in Ξ± in the same order as the non-terminals appear in Ξ±.
Production can be factored to achieve postfix form.
Postfix translation of while statement
The production
Can be factored as:
A suitable transition scheme would be
| Production Rule | Semantic Action |
|---|---|
| W β while | W.QUAD = NEXTQUAD |
| C β W E do | C W E do |
| Sβ C S1 | BACKPATCH (S1.NEXT, C.QUAD) S.NEXT = C.FALSE GEN (goto C.QUAD) |
Postfix translation of for statement
The production
Can be factored as
Labels: CD Unit-3, Compiler Design
Discussion & Queries (<$I18NNumComments$>):
<$CommentPager$>
-
<$I18NAtCommentTimeWithPermalink$>, <$I18NCommentAuthorSaid$>
-
<$CommentPager$>
<$BlogCommentBody$>
<$BlogCommentDeleteIcon$>