πŸŽ“ Computer Science & Engineering Portal

Master Engineering Disciplines with Structured Notes

Comprehensive academic lecture notes, exam-oriented unit summaries, laboratory manuals, and previous year question papers designed strictly for university students.

πŸ“‘

University Syllabi

AKTU & AICTE aligned semester credit guidelines.

πŸ“

Exam Question Papers

Previous 5 years solved university semester papers.

πŸ’‘

Lab Manuals & Viva

Practical codes with outputs and interview questions.

πŸ“š All Topics & Units Directory

Click on any subject tag to open its genuine notes directly

Loading your subjects directory...

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

  1. S   β†’  while M1 E do M2 S1  

Can be factored as:

  1. S β†’    C S1  
  2.    C β†’    W E do  
  3.    W β†’    while  

A suitable transition scheme would be

Production RuleSemantic Action
W β†’ whileW.QUAD = NEXTQUAD
C β†’ W E doC W E do
S→ C S1BACKPATCH (S1.NEXT, C.QUAD)
S.NEXT = C.FALSE
GEN (goto C.QUAD)

Postfix translation of for statement

The production

  1. S     for L = E1 step E2 to E3 do S1  

Can be factored as

  1. F β†’    for L  
  2.    T  β†’   F = E1 by E2 to E3 do  
  3.    S  β†’   T S1  

Labels: ,

Discussion & Queries (<$I18NNumComments$>):

<$CommentPager$>
<$I18NAtCommentTimeWithPermalink$>, <$I18NCommentAuthorSaid$>

<$BlogCommentBody$>

<$BlogCommentDeleteIcon$>
<$CommentPager$>