anchor.diff:    ;
   
   variable_or_call returns [tmp]
  -  : ^(Call name=ID { self.print_custom($ID.text + '(') }
  -      actual_parameter_list
  -      { self.print_custom(')') }
  -      index*)
  -  | ^(Variable 
  -      variable_name { $tmp = $variable_name.tmp }
  -      index*)
  +  : ^(Call name=ID apl=actual_parameter_list 
  +      { indices = [] } (index { indices.append($index.idx) })* 
  +    {
  +      $tmp = self.get_temp()
  +      index_list = ','.join(('[0][\%s]' \% x) for x in indices)
  +      self.print_line('\%s = \%s(\%s)\%s' \% ($tmp, $name.text, 
  +                            $apl.params_list, index_list))
  +    })
  +  | ^(Variable variable_name
  +      { indices = [] } (index { indices.append($index.idx) })*)
  +    {
  +      index_list = ','.join(('[0][\%s]' \% x) for x in indices)
  +      $tmp = $variable_name.tmp + index_list
  +    }
     | ^(OBJ_ACCESS variable_or_call variable_or_call)
     ;
   
  -actual_parameter_list
  -  : (^(Parameter expr))+
  -  ;
  -
  -index
  -  : ^(Index ArrayEnd
  -      {
  -        # TODO - hard
  -        self.print_custom('[-1]')
  -      })
  -  | ^(Index
  -      {
  -        self.print_custom('[')
  -      }
  -      expr
  -      {
  -        self.print_custom(']')
  -      })
  +actual_parameter_list returns [params_list]
  +  : { params = [] } (^(Parameter expr { params.append($expr.val) }))+
  +    { $params_list = ','.join(params) }
  +  ;
  +
  +index returns [idx]
  +  : ^(Index ArrayEnd { $idx = '-1' })
  +  | ^(Index expr { $idx = $expr.val })
     ;
   
   variable_name returns [tmp]
     : ^(DOLLAR ID 
       { 
  -      $tmp = self.get_temp()
  -      self.print_line('try: \%s = \%s' \% ($tmp, $ID.text))
  -      self.print_line('except NameError: \%s = \%s = [None]' \% ($tmp, $ID.text))
  +      $tmp = '\%s\%s' \% (self.TEMP_PREFIX, $ID.text)
  +      self.print_line('try: \%s = \%s\%s' \% ($tmp, self.VAR_PREFIX, $ID.text))
  +      self.print_line('except NameError: \%s = \%s\%s = [None]' \% ($tmp, 
  +                        self.VAR_PREFIX, $ID.text))
       })
     | ^(DOLLAR variable_name)
     | ^(DOLLAR expr)
  
positive.code:     self.print_newline()
  
    def get_temp(self):
      tmp = 'tmp\%d' \% self.next_temp
      self.next_temp += 1
      return tmp
  }
  
negative.code: }
  
  @members {
    VAR_PREFIX = 'v_'
    TEMP_PREFIX = 't_'
    
    indentLevel = 0
    was_indent = False
    was_newline = False
  