The document is a midterm exam for a Compiler Construction course. It contains 3 questions:
1) Minimize a given DFA with an alphabet of a and b.
2) Convert a given regular expression over alphabet a,b,c,d to a DFA using subset construction.
3) Explain how a given C++ code sample would be tokenized by a lexical analyzer through regular expressions, NFAs, DFA minimization, and more.
The document is a midterm exam for a Compiler Construction course. It contains 3 questions:
1) Minimize a given DFA with an alphabet of a and b.
2) Convert a given regular expression over alphabet a,b,c,d to a DFA using subset construction.
3) Explain how a given C++ code sample would be tokenized by a lexical analyzer through regular expressions, NFAs, DFA minimization, and more.
The document is a midterm exam for a Compiler Construction course. It contains 3 questions:
1) Minimize a given DFA with an alphabet of a and b.
2) Convert a given regular expression over alphabet a,b,c,d to a DFA using subset construction.
3) Explain how a given C++ code sample would be tokenized by a lexical analyzer through regular expressions, NFAs, DFA minimization, and more.
Question# 3. Write down the steps that how lexical analyzer will transform the following code into Tokens. Explain the following code through Regular expressions, Regular expressionsto NFA, NFA to DFA and DFA minimization. (4)
// C++ Program to display all elements
// of an initialized two dimensional array
#include <iostream> using namespace std;
int main() { int test[3][2] = {{2, -5}, {4, 0}, {9, 1}};
// use of nested for loop
// access rows of the array for (int i = 0; i < 3; ++i) {