πŸŽ“ 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 guidelines.

πŸ“

Exam Question Papers

Previous 5 years solved university papers.

πŸ’‘

Lab Manuals & Viva

Practical codes with outputs & interview Qs.

Core Subjects & Units Hub

Click on any specific unit to immediately view its lecture notes below

Viewing All Lectures

Postfix Notation

Postfix Notation

  • Postfix notation is the useful form of intermediate code if the given language is expressions.
  • Postfix notation is also called as 'suffix notation' and 'reverse polish'.
  • Postfix notation is a linear representation of a syntax tree.
  • In the postfix notation, any expression can be written unambiguously without parentheses.
  • The ordinary (infix) way of writing the sum of x and y is with operator in the middle: x * y. But in the postfix notation, we place the operator at the right end as xy *.
  • In postfix notation, the operator follows the operand.

Example

Production

  1. E  β†’  E1 op E2                       
  2. E  β†’  (E1)  
  3. E   β†’  id  
Semantic RuleProgram fragment
E.code = E1.code || E2.code || opprint op
E.code = E1.code
E.code = idprint id

Labels: ,

Discussion & Queries (<$I18NNumComments$>):

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

<$BlogCommentBody$>

<$BlogCommentDeleteIcon$>
<$CommentPager$>