Docsity

Syntax Descriptions - Assignment 1 - Programming Language Compilers | CS 5363, Assignments of Computer Science

Toggle sidebar
bg1
Homework 1: Syntax descriptions
Due before class on Sep 15, 2006
1. (15pts) Construct a regular expression for each one of the following languages.
(a) Nonnegative integers represented in base 8. For example, 123, 357, 2, 34 are all
valid strings in the language, but 59 and 9dare not.
(b) Floating point numbers with at most 3 digits after the floating point โ€œ.โ€. For
example, 3.1, 5.235 are both valid strings in the language, but 3.2345 (too many
digits after โ€œ.โ€) and 34 (missing the floating point) are not.
(c) Strings over {a, b, c}that does not contain the substring ab.
2. (10pts) Build a NFA for the regular expression (a|b)โˆ—baโˆ—. Convert your NFA to a
DFA. While recommended, you are not required to give the ๎˜-closure calculations.
1

Partial preview of the text

Download Syntax Descriptions - Assignment 1 - Programming Language Compilers | CS 5363 and more Assignments Computer Science in PDF only on Docsity!

Homework 1: Syntax descriptions

Due before class on Sep 15, 2006

  1. (15pts) Construct a regular expression for each one of the following languages.

(a) Nonnegative integers represented in base 8. For example, 123, 357, 2, 34 are all valid strings in the language, but 59 and 9d are not. (b) Floating point numbers with at most 3 digits after the floating point โ€œ.โ€. For example, 3.1, 5.235 are both valid strings in the language, but 3.2345 (too many digits after โ€œ.โ€) and 34 (missing the floating point) are not. (c) Strings over {a, b, c} that does not contain the substring ab.

  1. (10pts) Build a NFA for the regular expression (a|b) โˆ— baโˆ—. Convert your NFA to a DFA. While recommended, you are not required to give the -closure calculations.