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

Declarations

Declarations

When we encounter declarations, we need to lay out storage for the declared variables.

For every local name in a procedure, we create a ST(Symbol Table) entry containing:

  1. The type of the name
  2. How much storage the name requires

The production:

  1. D β†’    integer, id  
  2.    D  β†’   real, id  
  3.    D  β†’   D1, id  

A suitable transition scheme for declarations would be:

Production ruleSemantic action
D β†’ integer, idENTER (id.PLACE, integer)
  D.ATTR = integer
D β†’ real, idENTER (id.PLACE, real)
  D.ATTR = real
D β†’ D1, idENTER (id.PLACE, D1.ATTR)
  D.ATTR = D1.ATTR

ENTER is used to make the entry into symbol table and ATTR is used to trace the data type.

Labels: ,

Discussion & Queries (<$I18NNumComments$>):

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

<$BlogCommentBody$>

<$BlogCommentDeleteIcon$>
<$CommentPager$>