hw5 - COP4020 Spring 2011 Homework Assignment 5 1. Errors...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
COP4020 Spring 2011 Homework Assignment 5 1. Errors in a computer program can be classified according to when they are detected and, if they are detected at compile time, what part of the compiler detects them. Assuming we use C, give an example of each of the following. a) A lexical error, detected by the scanner (hint: the scanner accepts only ASCII characters that are legal to use in C) b) A syntax error, detected by the parser c) A static semantic error, detected by semantic analysis d) A dynamic semantic error, detected by the code generated by the compiler e) An error that the compiler can neither catch nor easily generate code to catch (this could be a violation of the language definition, not just a program bug). 2. Convert the regular expression letter ( letter | digit )* to an NFA using the NFA equivalents (base case, concatenation, alternation, Kleene closure) of the regular expression operations as can be found on page 55 and 56 in the textbook.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

hw5 - COP4020 Spring 2011 Homework Assignment 5 1. Errors...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online