Topics for COSC4400 midterm exam The exam is in class on Monday, Mar 4. The exam may include questions on anything we've discussed so far this semester. In particular, that includes the topics in Chapter 2 and Sections 3.1 and 3.2 of the textbook. You are allowed to bring one 3x5 notecard (written on both sides) if you would like. Given a standard control structure (loop, if, etc.), you should be able to write corresponding stack machine code or semantic actions to generate appropriate stack machine code like in Assignment #2. Given a regular expression, you should be able to describe a non-deterministic automaton (NFA) that recognizes that expression. Given a non-deterministic automaton (NFA), you should be to construct an equivalent deterministic automaton (DFA). Given a JFlex specification file, you should be able to describe its response to specific input (for instance, given this input, what tokens would the scanner return). Be familiar with regular expressions for patterns, returning tokens and attributes, ignoring comments and white space, using start states (e.g. STRING) Given a context-free grammar, you should be able to: - Construct parse trees for input strings - Determine if the grammar is ambiguous - Rewrite an ambiguous grammar to an equivalent unambiguous one (esp. associativity and precedence ambiguities). - Rewrite a production rule to remove left-recursion in order to use the grammar for predictive parsing. - Compute FIRST and FOLLOW sets. - Construct the LL(1) parse table. Given a grammar with associated semantics rules, you should be able to construct an annotated parse tree showing associated semantic values. Given a suitable grammar, you should be able to construct a recursive descent parser for the grammar.