~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to macros/sci2for/func2f.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function [stk,nwrk,t1,top]=func2f(op,stk,nwrk)
 
2
// genere la traduction de l'ensemble des primitives 
 
3
//!
 
4
// Copyright INRIA
 
5
lhs=evstr(op(4))
 
6
rhs=abs(evstr(op(3)))
 
7
t1=[]
 
8
if exists('f_'+op(2)) then
 
9
  execstr('[stkr,nwrk,t1,top]=f_'+op(2)+'(nwrk)')
 
10
  for k=rhs-lhs:-1:1, stk(top+k)=null(),end
 
11
  if lhs>1 then
 
12
    top=top-1
 
13
    for k=1:lhs
 
14
      top=top+1
 
15
      stk(top)=stkr(k)
 
16
    end
 
17
  else
 
18
    stk(top)=stkr
 
19
  end
 
20
else
 
21
  args=[]
 
22
  for k=1:rhs
 
23
    s=stk(top)
 
24
    args=[s(1),args]
 
25
    top=top-1
 
26
  end
 
27
  typ='?',typ=typ(ones(1,lhs))'
 
28
  rsiz='1';rsiz=rsiz(ones(1,lhs))'
 
29
  csiz=rsiz;
 
30
  [o,nwrk,t1]=outname(nwrk,typ,rsiz,csiz)
 
31
  for k=1:lhs, args=[args,o(k)],end
 
32
  txt=['c TRANSLATION OF '+op(2)+' FUNCTION CALL NOT PROPERLY DONE';
 
33
       t1
 
34
       gencall([op(2),args])]
 
35
  stkr=list()
 
36
  for k=1:lhs
 
37
    top=top+1
 
38
    stk(top)=list(o(k),'-1',typ(k),rsiz(k),csiz(k))
 
39
  end
 
40
end
 
41