Language design and translation: paradigms, binding times, syntax, stages in translation and formal models. - One Line Questions

1. What is a 'token' in the context of lexical analysis? A basic building block of the source code, like an identifier or operator.
2. What is an 'abstract syntax tree' (AST)? A hierarchical representation of the source code's structure.
3. What is a common representation for the output of a syntax analyzer? A parse tree or abstract syntax tree
4. When is the binding of a variable's value to its identifier typically performed in an imperative language? At execution time
5. The binding of a variable's type to its identifier can occur at which of the following times? All of the above
6. Which binding time is associated with the resolution of function calls to their definitions? Execution Time
7. The binding of a variable to a specific memory location typically occurs at: Load Time or Execution Time
8. Which binding time is associated with the allocation of memory for global variables? Load Time
9. Which formal language model is typically used to describe the syntax recognized by a lexical analyzer? Finite Automata
10. In programming languages, 'static binding' (early binding) occurs: Before the program begins execution (e.g., at compile time).
11. The binding of a variable's scope to its declaration typically occurs at: Compile Time
12. Which binding time is generally the earliest? Language Definition Time
13. The binding of a constant's value occurs at: Compile Time or Language Definition Time
14. Which formal model is commonly used to describe the syntax of programming languages using a set of production rules? Context-Free Grammar
15. What is the primary characteristic of the 'imperative' programming paradigm? Use of statements that change a program's state.
16. Which of the following is an example of a binding that typically occurs at execution time? Function call parameters
17. Which programming paradigm emphasizes the concept of 'objects' with associated data and methods? Object-Oriented Programming
18. The concept of 'state' is central to which programming paradigm? Imperative Programming
19. In functional programming, 'immutability' means: Data cannot be changed after it is created.
20. The 'declarative' programming paradigm focuses on: What the result should be, without specifying the control flow.
21. Which programming paradigm is characterized by the evaluation of functions and avoiding side effects? Functional Programming
22. Which paradigm uses 'if-then' rules and logical inference as its core mechanism? Logic Programming
23. A 'lambda expression' is a feature commonly found in: Functional Programming
24. The paradigm that models computation as the evaluation of mathematical functions is: Functional Programming
25. What is the main advantage of using an intermediate representation like an AST? It simplifies the implementation of a compiler by separating analysis and synthesis phases.
26. Which stage of translation is primarily responsible for checking the grammatical correctness of the source code according to the language's syntax rules? Syntax Analysis (Parsing)
27. The process of converting an abstract syntax tree (AST) into a sequence of machine instructions is called: Code Generation
28. Which stage of translation involves checking for type compatibility and other consistency rules not covered by syntax? Semantic Analysis
29. Which phase of translation is responsible for generating optimized code? Code Optimization
30. Which stage of translation is responsible for converting the program into a format that is closer to machine code? Intermediate Code Generation
31. The translation process of a compiler can be broadly divided into two main phases: analysis and synthesis. Which of the following belongs to the synthesis phase? Code Generation
32. A 'recursive descent parser' is a type of: Syntax Analyzer
33. Which programming language paradigm is closely associated with lambda calculus? Functional Programming
34. Which of the following is a common method for defining the syntax of programming languages? Backus-Naur Form (BNF)
35. Which type of grammar is powerful enough to describe most programming language syntaxes but not all possible computer programs? Context-Free Grammar
36. What is 'late binding' (dynamic binding) primarily concerned with? Delaying the resolution of references until runtime.
37. What is 'inheritance' in object-oriented programming? The process where a new class derives properties and behaviors from an existing class.
38. In object-oriented programming, 'encapsulation' refers to: The bundling of data (attributes) and methods (functions) that operate on the data.
39. What does 'polymorphism' mean in the context of object-oriented programming? The ability of an object or method to take on many forms.
40. A context-free grammar is a formal system used to describe: The syntax of programming languages.
41. Semantic analysis in a compiler focuses on: The meaning of statements.
42. In programming language design, what does 'binding time' refer to? The time at which a variable's value is determined.
43. Which of the following is an example of a binding that occurs at Language Definition Time? The type of an operator.
44. What is the role of 'code generation' in a compiler? To produce the target machine code or bytecode.
45. What is the role of a 'parser' in a compiler? To build a parse tree or AST from the token stream.
46. What is the primary purpose of intermediate code generation in a compiler? To represent the source program in a machine-independent form.
47. What is the main role of a lexical analyzer (scanner) in a compiler? To convert source code into a sequence of tokens.
48. What is the primary goal of defining the syntax of a programming language? To define the structure and arrangement of symbols.
49. What is the purpose of a symbol table in a compiler? To store information about identifiers (variables, functions, etc.) and their attributes.
50. What is the primary goal of semantic analysis? To check for type errors and other logical inconsistencies.