[試題] 102上 徐慰中 編譯程式設計 第一次小考+解答

作者: rod24574575 (天然呆)   2015-06-13 08:40:19
課程名稱︰編譯程式設計
課程性質︰選修
課程教師:徐慰中
開課學院:電資學院
開課系所︰資工系
考試日期(年月日)︰2013.10.23
考試時限(分鐘):
試題 :
0) Which of the following are not in the six compilation phases?
1) Lexical analysis
2) Syntax analysis
3) Preprocessing phase
4) IR code generation
5) Linkage phase
1) Which of the following statements about the AC-to-DC compiler in Chapter 2
are not true?
1) AC-to-DC is a single pass compiler
2) AC supports type widening and narrowing
3) AC supports subtraction operations
4) AC-to-DC uses bottom-up parsing
2) Why do we try to use as much formalism as possible in the language
specification?
1) To avoid ambiguity in analysis
2) To increase the expressive power
3) To automate the translator generation
4) To rule out non-CS students in the Compiler field
3) The CFG of AC is LL(1), what does it mean by LL?
1) Long Life parsing
2) Least difficult, Left to right parsing
3) Left to right parsing to find the Leftmost derivation tree
4) Left Lane parsing
4) What are the advantages of interpretation as opposed to compilation?
1) Higher degree of machine independence
2) Overall higher performance
3) Easier to write
4) Better diagnostics
5) In an AST, an internal node is usually
1) a non-terminal
2) a terminal
3) an operator
4) an operand
6) Which of the following are not authors of the textbook ("Crafting a
Compiler")?
1) Alfred Aho
2) Charles N. Fischer
3) James Gosling
4) Ron K. Cytron
5) Wei Chung Hsu
7) Which of the following are authors of the textbook ("Compilers: Principles,
techniques, & Tools, second edition")?
1) Alfred Aho
2) Shih-Wei Liao
3) Jeffrey Ullman
4) Monica Lam
5) Andrew Appel
8) Which of the following could be part of semantic analysis?
1) Check type consistency
2) Check whether a statement is reachable
3) Check for possible uninitialized variables
4) Check whether a while statement is nested
9) A retargetable compiler shares which of the following phases for different
target machines?
1) Scanning
2) Parsing
3) IR code generation
4) Machine independent optimization
10) What is the target machine of our C

Links booklink

Contact Us: admin [ a t ] ucptt.com