Skip to content
Tuesday, December 1, 2026Ideas worth exploring. Knowledge worth sharing.
S. SenseCentralDISCOVER EVERY DAY
Compiler Design

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.

Author

  • J. BoomiNathan is a writer at SenseCentral who specializes in making tech easy to understand. He covers mobile apps, software, troubleshooting, and step-by-step tutorials designed for real people—not just experts. His articles blend clear explanations with practical tips so readers can solve problems faster and make smarter digital choices. He enjoys breaking down complicated tools into simple, usable steps.

WRITTEN BY

Boomi Nathan

<p data-start="1570" data-end="2005">J. BoomiNathan is a writer at SenseCentral who specializes in making tech easy to understand. He covers mobile apps, software, troubleshooting, and step-by-step tutorials designed for real people—not just experts. His articles blend clear explanations with practical tips so readers can solve problems faster and make smarter digital choices. He enjoys breaking down complicated tools into simple, usable steps.</p>

More from this author ↗

Leave a Reply

Your email address will not be published. Required fields are marked *