The Gateway to Computer Science Excellence
+4 votes

The language $L,$ defined by the following grammar, allows use of real or integer data in expressions and assignment statements.

<assign-stmt> :: <LHS> := <E>
          <E> ::= <E> + <T>|<T>
          <T> ::= <T> * <V>|<V>
          <V> ::= id|(<E>)
        (LHS) :: id

It is required to convert expression and assignment string of $L$ into postfix strings that use the type-specific operations $(+,i),(+,r),(*,i),(*,r),(:=,i)$ and $(:=,r)$
Write a syntax-directed translation scheme to convert expression and assignment strings into the postfix form. You may assume that the name and type of variable can be obtained by making the function calls’ give_name $(id)$ and give_type $(id)$ respectively. 

in Compiler Design by Veteran (52.3k points)
edited by | 652 views

Please log in or register to answer this question.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,833 questions
57,726 answers
107,846 users