             throw new Error("Assertion failed");
     }
 
-    function cleanup(lines) {
+    function preprocess(lines) {
 	var j = 0;
 	var first = true;
 	for ( var i=0, limit=lines.length ; i < limit ; i++ ) {

	return lines;
    }

    function patterns(lines) {
	var output = [];
	var P = null;
	var G = null;
	var A = null;
	var res;
	for ( var i=0, limit=lines.length ; i < limit ; i++ ) {
	    var L = lines[i];
	    if (P == null) {
		res = /^pattern\s+(.*)$/.exec(L);
		assert(res != null);

     ident    ::= C++ identifier
     eol      ::= newline or end-of-file

   Identifiers in the pattern must be opcode names; these are resolved at 
   compile time and the peephole optimizer state machine uses them to
   transition from one state to another.  The guard is evaluated in case 
   there are side conditions apart from the opcode values; the guard must 
   be a C++ expression.  The action represents individual instruction
   words that replace the instructions matched by the pattern; each word
   should be a C++ expression.

   The syntax $n.m refers to the m'th word of the n'th matched instruction.
   It can be used in the guard and action.

   The guard will be evaluated zero or one times per match.  (The current
   implementation only invokes a guard after longer matches have failed,
   so zero times is typical - you can't track state machine progress by
   having side effects in the guard.)

   For example (this one has only one instruction in the action):

     pattern  OP_getlocal ; OP_getlocal ; OP_getlocal
     guard    $0.1 < 1024 && $1.1 < 1024 && $2.1 < 1024
     action   OP_get3locals ; ($2.1 << 20) | ($1.1 << 10) | $0.1

   Continuation lines are allowed, they start with '*' in the first column.
   The continuation line, less its '*', is pasted onto the end of the
   preceding line.

   Comment lines start with // (possibly preceded by blanks).  Comment lines
   and blank lines are ignored everywhere before continuation lines are 
   resolved.  Comments can't follow patterns, guards, or actions on the 
   same line.

   Restrictions (not checked by this program):

   - The action cannot introduce more words than the instruction originally
     occupied  (it would not be hard to lift this restriction). 

   - Lookupswitch must not appear in these patterns.

   - Any PC-relative branch instruction must be the last in the pattern or
     in the replacement code.

 */
   
