Advanced Programming I Lecture Notes

Advanced Programming I Lecture Notes

6 February 2007 • Assignment 1 Code Review


Outline

The Problem

Make A Wish

Regular Expressions

Regular Languages

Generating A Language

Inventory

More Work

Make A Wish

What's Left?

Simple Regular Expressions

simple-regexp-end()

simple-regexp-end(regexp)
  case regexp[0] of
    '?' e = simple-regexp-end(regexp + 1)

    '*' e = simple-regexp-end(regexp + 1)

    '|' e = simple-regexp-end(regexp + 1)
        e = simple-regexp-end(regexp + e)

    '(' e = 1
        while regexp[e] != ')'
	  e = simple-regexp-end(regexp + e)

    else  e = 1

  return e

Generating Simple Languages

Regular Expression Data

Regular Language Data

Errors

Testing

Tests

Generic Tests

Assignment Tests

Coding

Program Defensively

No Coredumping

Commented-Out Code

Write Small Functions

Comment Functions

Example Function Comments


This page last modified on 8 February 2006.

This work is covered by a
Creative Commons License.