CST 8152 Compilers Midterm #1 Review Questions
What is a compiler? an interpreter?
Where does compilation fit in the steps that make up Language Processing?
- What is the output of each step of the process?
What is the front end of a compiler? the back end?
Name and describe the function of each of the three parts of the compiler front end.
- What is the output of each of the three parts?
- Give C Language examples of errors that would be detected in each part.
Name and describe the basic functions of the compiler back end.
Define these terms: lexeme, token, pattern, deterministic automaton, nondeterministic automaton,
Why is syntax analysis usually recursive, where lexical analysis is not?
What are the meanings of the Regular Expression operators *, +, and ?
Given a description of a set of strings, write a Regular Expression that matches those strings.
- e.g. strings of letters ending in a or bcd
- e.g. strings of digits containing a 3 before a 5
- e.g. unsigned integer constant, unsigned floating constant
Given a Regular Expression, give examples of strings matched by the expression.
What is a Finite State Machine (FSM)?
What restrictions are placed on a FSM to make it a Deterministic Finite Automaton (DFA)?
Given a Regular Expression, write the DFA transition diagram that recognizes it (or vice-versa).
Given a DFA, write its corresponding Transition Table (or vice-versa).
Write a C Language NextState() function that implements the transitions of a given DFA or Transition Table.
Write a while() loop that uses the NextState() function to implement a DFA.
Write a Column() function that classifies characters for indexing a Transition Table.