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

Implementation of Syntax directed translation

Implementation of Syntax directed translation

Syntax direct translation is implemented by constructing a parse tree and performing the actions in a left to right depth first order.

SDT is implementing by parse the input and produce a parse tree as a result.

Example

ProductionSemantic Rules
S β†’ E ${ printE.VAL }
E β†’ E + E{E.VAL := E.VAL + E.VAL }
E β†’ E * E{E.VAL := E.VAL * E.VAL }
E β†’ (E){E.VAL := E.VAL }
E β†’ I{E.VAL := I.VAL }
I β†’ I digit{I.VAL := 10 * I.VAL + LEXVAL }
I β†’ digit{ I.VAL:= LEXVAL}

Parse tree for SDT:

Implementation of Syntax directed translation

Fig: Parse tree

Labels: ,

Discussion & Queries (<$I18NNumComments$>):

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

<$BlogCommentBody$>

<$BlogCommentDeleteIcon$>
<$CommentPager$>