anchor.diff:  // Based on:
   // - citeseer.ist.psu.edu/cifuentes98specifying.html
   // - sslscanner.l and sslparser.y from UQBT source distribution.
  +// - sslscanner.l and sslparser.y from boomerang source distribution.
   
   header {
   
  
positive.code: start
  	: #(SPEC (part)*)
  		{
              names = self.instructions.keys()
              names.sort()
              for name in names:
  
negative.code:                 else:
                      self.instructions[n] = ip, rtl
          }
  	| #( . ( . )* )
  		// copy other parts unmodified
  	;
  
  constant_expr! returns [v]
  	: n:NUM
  		{ v = int(n.getText()) }
  	| #(PLUS l=constant_expr r=constant_expr)
  		{ v = l + r }
  	| #(MINUS l=constant_expr r=constant_expr)
  		{ v = l - r }
  	;
  
  table_expr! returns [res]
  	: #( LCURLY h=table_expr { res = h } (t=table_expr { res.extend(t) })* )
  	| #( CROSSP h=table_expr { res = h } (t=table_expr { res = [self.astFactory.create(NAME, hh.getText() + tt.getText()) for tt in t for hh in h] })* )
  	| #( QUOTE any:. ) { res = [self.astFactory.dupTree(any)] }
  	| n:NAME { res = self.tables.get(n.getText(), [n]) }
  	;
  
  parameter_list! returns [res]
  	: #(PARAMS { res = [] } ( n:NAME { res.append(n.getText()) } )* )
  	;
  
  // Returns a list of ('name', 'variables') pairs, where 'name' is the 
  // instruction name and 'variables' is a dict mapping the corresponding 
  // variables/values resulting from table lookup.
  instr_name! returns [res]
  	: #( INSTR_NAME 
  			{ res = [("", {})] }
  		( e=instr_name_elem
              {
                  tmp = []
                  for rn, rv in res:
                      for en, ev in e:
                          n = rn + en
                          v = rv.copy()
                          v.update(ev)
                          tmp.append((n, v))
                  res = tmp
              }
  		)*
  	)
  	;
  
  // Same return value as 'instr_name'.
  instr_name_elem! returns [res]
  	: name:NAME
  		{ res = [(#name.getText(), {})] }
  	| PRIME optname:NAME 
  		{ res = [("", {}), (#optname.getText(), {})] }
  	| #(LSQUARE tname:NAME
  		{
              try:
                  table = self.tables[#tname.getText()]
              except KeyError:
                  raise SemanticException(#tname, "undefined table")
  		}
  		( vname:NAME
  			{ res = [(table[idx].getText(), {#vname.getText(): #(#[NUM, str(idx)])}) for idx in range(len(table))]}
  		| tidx:NUM 
  			{
                  try:
                      res = [(table[int(#tidx.getText())], {})]
                  except KeyError:
                      raise SemanticException(#tname, "index outside bounds")
              }
  		))
  	| d:DECOR
  		{ res = [('.' + d.getText()[1:], {})] }
  	;
  
  // Expands variables, table references, and functions in RTL.
  //
  // NOTE: Especial care must be taken here in order to *duplicate* AST nodes, and 
  // not simply refer to them, as that would result in corruption of the AST.
  rtl_expand
  	:! #( RTL 
  			{ ## = #(#[RTL,"RTL"]) }
  		(rt:rtl_expand
  		 	{
                  // do not nest RTL blocks
                  if #rt.getType() == RTL:
                      if #rt.getFirstChild():
                          ##.addChild(#rt.getFirstChild())
  