Prog Lang Final Exam Questions Flashcards
Which phase converts source code into tokens?
Lexical analysis
What does { } mean in EBNF?
Repetition
Which reserved word is used to declare a constant in Java?
final
What is produced during syntax analysis?
Parse tree or AST
Which of the following is NOT a reserved word in Java?
define
Which category do if, else, and switch belong to in Java reserved words?
Control flow keywords
Which of the following best describes semantics?
The meaning of a program
Which statement is true about syntax and semantics?
- Syntax errors can occur even if semantics are correct
- Semantic errors can occue even if syntax is correct
- Both syntax and semantics must be correct for a program to function properly
What does static binding refer to?
Binding that occurs before the program runs
What is the purpose of a symbol table in a compiler?
To store mappings of names to their attributes
What is an example of dynamic binding?
Determining the type of a variable at runtime
What is a dangling reference?
A pointer pointing to deallocate memory
Which language uses garbage collection to handle memory management?
Java