Javatpoint Logo
Javatpoint Logo

Syntax directed translation scheme

  • The Syntax directed translation scheme is a context -free grammar.
  • The syntax directed translation scheme is used to evaluate the order of semantic rules.
  • In translation scheme, the semantic rules are embedded within the right side of the productions.
  • The position at which an action is to be executed is shown by enclosed between braces. It is written within the right side of the production.

Example

Production Semantic 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}

Next TopicSDT Implementation





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA