Which of the following phase of the compiler is Syntax Analysis?
A translation scheme is shown as-
Output for 3 * 2 + 4 is ______.
1 Crore+ students have signed up on EduRev. Have you? Download the App |
Consider the following grammar along with translation rules.
Here # and % are operators and id is a token that represents an integer and id•val represents the corresponding integer value. The set of non-terminals is {S, T, R, P} and a subscripted non-terminal indicates an instance of the non-terminal.
Using this translation scheme, the computed value of S•val for root of the parse tree for the expression 20#10%5#8%2%2 is ______.
Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation (SDT) actions, given as pseudo-code:
P → D* E*
D → int ID {record that ID.lexeme is of type int}
D → bool ID { record that ID.lexeme is of type bool}
E → E1 + E2 {check that E1.type = E2.type = int; set E.type := int}
E → !E1 {check that E1.type = bool; set E.type := bool}
E → ID {set E.type := int}
With respect to the above grammar; which one of the following choices is correct?
Convert the pre-fix expression to in-fix
--*+ABC*DE+FG
Consider the following grammar and the semantic actions to support the inherited type declaration attributes. Let X1, X2, X3, X4, X5 and X6 be the placeholders for the non-terminals D, T, L or L1 in the following table:
Which one of the following are the appropriate choices for X1, X2, X3 and X4?
Consider the syntax-directed transition scheme given below with non-terminals {A, B, C} and terminals {a, b, c}
S → AC {print*} | aB{print ***}
A → Sb {print **}
B → c {print *}
C → S {print *}
Using the above SDT, calculate the total number of * that are going to be printed in the output for the input acbac.
_____ is done by attaching rules or algorithms or program fragments to productions in a grammar.