Recent questions tagged syntax-directed-translation

742
views
2 answers
1 votes
Here a as well as c can be the answer based on the construction of the parse tree. So how to decide which one to choose?
442
views
1 answers
1 votes
Consider the following transition rules:A--> BCC-->+BC | A | epsilionB--> DB{print '+';} | epsilionD--> (A)| id{print id.value;}On input ' 5+67 ', this translation schme will print..............
378
views
1 answers
2 votes
Read the following grammars and their translations:$S\rightarrow xX\;\left \{ print ``0" \right \}$ ... $ using Bottom-Up Parsing (with the above translations)?$0111012$0111-20$0211-10$011112$
1.1k
views
2 answers
2 votes
Let Grammar be with these transitions:S -> a{print "0"}AA -> b{print "1"}BA -> c{print "2"}A -> ε{print "-"}B -> d{print "1"} ... input string abdbdc using Bottom-Up Parsing with above translations:A) 0211-10B) 0211110C) 0111-20D) 0111012
802
views
1 answers
1 votes
Consider translation rules : S → S1 * A{S. Val = S1. Val + A. Val}/A{S. Val = A. Val}A → A1 - B{A. Val = A1. Val - B. Val}/B{A. Val = B. Val}B → C | ... * 4 is a1 and output for input 6 * 2 / 1 - 2 * 3 is a2, then a1 - a2 is ___________.
825
views
1 answers
0 votes
A shift reduced parser carries out the actions specified within braces Immediately after reducing with the corresponding rule of grammar.S --> xxW (print ... translation scheme described by the above rules.bcacaaabcc aabca ccbaa
441
views
2 answers
0 votes
1.3k
views
4 answers
1 votes
1.2k
views
5 answers
0 votes
Associativity and precedence of operators is defined by grammar. So C should be right.Please help
1.3k
views
1 answers
2 votes
here it is given bottom up parsing still action is given in middle so output should be GAAAAT??? Is it true that in syntax tree tanslation bottom up and top down gives same answer???
4.0k
views
1 answers
1 votes
767
views
1 answers
1 votes
Consider the following grammar for variable declarations:<vardecl> $\rightarrow$ <vardecl><idlist> : <type>;<vardecl> $\rightarrow \in$ ... procedures operating on the symbol table; you need not elaborate upon these procedures.
286
views
1 answers
0 votes
Consider the following syntax directed definitionA --> BCC.i = c(A.i) .........1B.i = b(A.s) ... attribute.Which one is violating L attribute definition?(a) 1(b) 2(c) 3(d) None of the above.
2.3k
views
1 answers
1 votes
Which of the following Attribute can be evaluated by a shift-reduce parser that executes semantic action only at reduce moves and never at shift?(a) synthesized attribute(b) inherited attribute(c) both (a) and (b)(d) none of the above
856
views
1 answers
3 votes
Consider the following syntax directed definition of any desk calculator:$L \rightarrow En \{ \text{print}(E.val) \}$E \rightarrow E1 + 1 \{ E.val = E1.val + Z.val \} ... $?$9$6$10$11$
715
views
2 answers
2 votes
Which of these is NOT true about Abstract Syntax Tree (AST)?An AST is usually the result of the syntax analysis phase of a compiler.AST has ... a programming language.AST is also used in program analysis and program transformation systems.
299
views
1 answers
3 votes
Consider following Translation Scheme:$S \rightarrow ER$R \rightarrow ^* E \{ print \{' *' \}; \} R \mid \epsilon$E \rightarrow F + E \{ print ('+');\} \mid F$F \rightarrow S \mid id \{ ... * 7 + 9$ "?$1 7* + 9$1 * 7 9 +$1 7 9 * +$179 + *$
667
views
0 answers
2 votes
I think we can not traverse the tree..because it is not a valid SDT, A is taking value from sign.Correct me if i am wring.
838
views
1 answers
0 votes
Is this statement correct...Attribute evaluation in S-attribute grammars can be incorporated conveniently in both top-down parsing and bottom-up parsing since S-attributed grammars are not inherited.
1.5k
views
1 answers
4 votes
$Q_1 \Rightarrow$ For synthesized attribute, value is only computed when symbol is on the _____ side of production. For inherited attribute, value is computed in productions ... is called $c).$ Refers to global variable $d).$ None of these