The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+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. 

asked in Compiler Design by Veteran (52.1k points)
edited by | 595 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
49,814 questions
54,517 answers
75,287 users