GATEverse
← GATE CSE 1997

Q23

NATMarks unknown

The language L,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 LL into postfix strings that use the type-specific operations (+,i),(+,r),(∗,i),(∗,r),(:=,i)(+,i),(+,r),(*,i),(*,r),(:=,i) and (:=,r)(:=,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)(id) and give_type (id)(id) respectively.

Sign in to save attempts.

Loading…