File: printspecs.sci

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (69 lines) | stat: -rw-r--r-- 1,750 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
function []=printspecs(mac,type_desc)
//displays description of a macro to translate into fortran
//!

// Copyright INRIA
blk='                                 ';
typs=['entier','double precision','?','?']
n=size(type_desc)
[lhs,rhs]=argn(0)

[out,in,cod]=string(mac)
txt=['['+makeargs(out)+']='+nam+'('+makeargs(in)+')';cod]

desc='| variable number | fortran type    |# rows  |# columns  |'
dd=[20,17,11,13]
for k=1:n,
  tk=type_desc(k)
  num=string(k);num=num+part(blk,1:dd(1)-length(num))
  ftyp=typs(evstr(tk(1))+1);ftyp=ftyp+part(blk,1:dd(2)-length(ftyp))
  nl=tk(2);nl=nl+part(blk,1:dd(3)-length(nl))
  nc=tk(3);nc=nc+part(blk,1:dd(4)-length(nc))
  desc=[desc;'|'+num+'|'+ftyp+'|'+nl+'|'+nc+'|']
end

x_message(['       source code of Scilab function';..
         '-----------------------------';' ';txt;..
         ' ';' ';..
         'type and dimension of input parameters';..
         '---------------------------------------';..
         ' ';desc])

write(%io(2),[' ';'Now translation is made...';' '])

function [txt]=gendesc(mac,type_desc,fnam)
// For intersci...
//!
[out,in]=string(mac)
n=size(type_desc)
first=fnam;
ret='sequence '
for l=1:prod(size(out)), ret=ret+' '+out(l);end
txt=[]
for k=1:n
  tk=type_desc(k)
  first=first+' '+in(k)
  desck=in(k)
  if tk(2:3)== ['1','1'] then 
    desck=desck+'  scalar'
  elseif tk(2)=='1' then
    desck=desck+'  column '+tk(3)
  elseif tk(3)=='1' then
    desck=desck+'  row '+tk(2)
  else
    desck=desck+'  matrix '+tk(2)+' '+tk(3)
  end
  txt=[txt;desck]
end
txt=[first;txt;' ';'fortran args']
for k=1:n
  tk=type_desc(k)
  first=first+' '+in(k)
  desck=in(k)
  if tk(1)== '0' then 
    desck=desck+'  int'
  elseif tk(2)=='1' then
    desck=desck+'  double'
  end
  txt=[txt;desck]
end