Project 3 help.


R. Clayton (rclayton@clayton.cs.monmouth.edu)
Wed, 17 Jan 2001 19:01:09 -0500 (EST)


So far, I have only gotten through the stage of being able to deal with simple
integers.

What are my options at this time?

  As time is growing short, you probably need to move directly to the most
  important thing: pattern matching. You should implement pattern matching
  over constants. Your pattern file will contain either constants or pattern
  variables. You have to be a little careful when writing your pattern files
  because it's easy to write non-terminating patterns with such a simple
  intermediate code. for example, if the pattern

    $1
    $2
    ->
    $2
    $1

  matches once, it matches infinitely many times on the same text. Two useful
  test patterns that are guaranteed to terminate are

    $1
    $2
    ->
    $1

  and

    $1
    $2
    ->
    $1 $2
    $2 $1

  The first terminates because it throws away one line every time it matches;
  eventually the intermediate code will be reduced to one line. The second
  terminates because it replaces two lines it can recognize with two lines it
  can't recognize; eventually all but possibly one line will be unrecognizable.

  Once you get this working, you can go back and add other parts of the
  intermediate code.



This archive was generated by hypermail 2.0b3 on Thu May 17 2001 - 12:00:05 EDT