anchor.diff:    | KW_TRUE { $val = "True" }
     | KW_FALSE { $val = "False" }
     | ^(KW_NEW class_name actual_parameter_list?)
  -  | voc=variable_or_call { $val = '\%s[0]' \% $voc.tmp }
  -  | ^(Pre voc=variable_or_call incdec_op
  -    {
  -      self.print_line('\%s[0] = \%s[0] \%s 1' \% ($voc.tmp, 
  -                        $voc.tmp, $incdec_op.op))
  -      $val = '\%s[0]' \% $voc.tmp
  -    })
     | ^(Post voc=variable_or_call incdec_op
       {
         $val = self.get_temp()
  
positive.code:   ;
  
  expr returns [val]
    : ^(EQ 
      voc=variable_or_call e=expr
      { 
        self.print_line('\%s[0] = \%s' \% ($voc.tmp, $e.val))
        $val = '\%s[0]' \% $voc.tmp
      })
    | ^(DOT_EQ
      voc=variable_or_call expr
      {
        self.print_line('\%s[0] = str(\%s[0]) + str(\%s)' \% ($voc.tmp, $voc.tmp, $e.val))
        $val = '\%s[0]' \% $voc.tmp
      })
    | ^(assign_op voc=variable_or_call expr
      {
        self.print_line('\%s[0] = \%s[0] \%s \%s' \% ($voc.tmp, 
                          $voc.tmp, $assign_op.op, $e.val))
        $val = '\%s[0]' \% $voc.tmp
      })
    | ^(LOG_OR { $val = '(\%s or \%s)' \% ($e1.val, $e2.val) })
    | ^(LOG_AND { $val = '(\%s and \%s)' \% ($e1.val, $e2.val) })
    | ^(OR { $val = '(\%s | \%s)' \% ($e1.val, $e2.val) })
    | ^(XOR { $val = '(\%s ^ \%s)' \% ($e1.val, $e2.val) })
    | ^(AND { $val = '(\%s & \%s)' \% ($e1.val, $e2.val) })
    | ^(IS_EQ e1=expr e2=expr { $val = '(\%s == \%s)' \% ($e1.val, $e2.val) })
    | ^(IS_NEQ e1=expr e2=expr { $val = '(\%s != \%s)' \% ($e1.val, $e2.val) })
    | ^(IS_IDENT expr expr)
  
negative.code:   print 'import sys'
    print ''
    print 'def array(x):'
    print '  arg, is_ref = x'
    print '  if is_ref:'
    print '    arg = arg[0]'
    print '  return [[[arg]]]'
    print ''
    print 'def count(x):'
    print '  arg, is_ref = x'
    print '  if is_ref:'
    print '    arg = arg[0]'
    print '  return [len(arg)]'
    print ''
  } : top_statement*
    ;
  