blob: 21ec28d7c9ecd51ccbe4e5d2aba8a00aa070bbfa (
plain)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
|
Description from Serge Steer
Date:
Fri, 28 Jul 2006 12:14:14 +0200
To:
raffaele.nutricato@tiscali.it
CC:
Fabio.Bovenga@ba.infn.it, Claude.Gomez@Inria.fr, Didier.Halgand@Inria.fr, Serge.Steer@Inria.fr
>> Let me to ask you one more question: I read in the Scilab2C.doc
>> document that among the tasks related to the Scilab team/ INRIA
>> there is the "*_FORTRAN to C code translation"_* task. Is it
>> possible to have more details about this activity?
I am not able to answer this question, please ask it to Claude Gomez
who wrote this document.
>> Could you please send us a preliminary version of the output that
>> will be generated by the Scilab2tree tool starting from the
>> testscilab.sci code?
If you have Scilab-4.0 installed you can play with it. The
preliminary version of Scilab2tree is named macr2tree.
here is very simple example of use
-->function y=foo(x)
--> y=x+1
-->endfunction
-->t=macr2tree(foo)
It returns the full abstract syntax tree coded by a hierarchical
structure of tlists and lists Scilab objects. To get a more readable
display and also to illustrate how Scilab can deal with such a
structure, I give you below a file of scilab functions for display
overloading. If this file is loaded into Scilab
--> exec %program_p.sci;
The display of the t structure above become
-->t
t =
Program
Name : foo
Outputs: y
Inputs : x
Statements
<EOL>
Equal
Expression:
Operation
Operands:
x
1
Operator: +
EndOperation
Lhs :
y
EndEqual
<EOL>
Funcall : return
#lhs : 0
Rhs :
<empty>
EndFuncall
<EOL>
EndProgram
These functions work with your testscilab function too (but select
case constructs are not yet handled). Just try it and look at the
comment for the structure explanation
Serge Steer
Scilab Team
|