File: compil.f

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 (131 lines) | stat: -rw-r--r-- 3,301 bytes parent folder | download
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
      logical function compil(code,val1,val2,val3,val4)
c
c     add  compiled instruction in compiled macro structure
c
c     Copyright INRIA
      integer val1(*),val2,val3,val4,l
      include '../stack.h'
      external getendian
      integer getendian
      integer code,sadr

c
      sadr(l)=(l/2)+1
c
      compil=.false.
      if (comp(1).eq.0) return
      compil=.true.
      l=comp(1)
      if(code.eq.1) then
c     put in stack  <1,nom>
         err=sadr(l+(nsiz+1))-lstk(bot)
         if(err.gt.0) goto 90
         istk(l)=code
         call putid(istk(l+1),val1)
         comp(1)=l+1+nsiz
      elseif(code.eq.2) then
c     get from stack  <2 nom fin rhs>
         err=sadr(l+(nsiz+3))-lstk(bot)
         if(err.gt.0) goto 90
         istk(l)=code
         call putid(istk(l+1),val1)
         istk(l+1+nsiz)=val2
         istk(l+2+nsiz)=val3
         comp(1)=l+3+nsiz
      elseif(code.eq.5) then
c     allops 
         err=sadr(l+4)-lstk(bot)
         if(err.gt.0) goto 90
         istk(l)=code
         istk(l+1)=val1(1)
         istk(l+2)=val2
         istk(l+3)=val3
         comp(1)=l+4
      elseif(code.eq.6) then
c     set num <6 ix(1),ix(2)>
         err=sadr(l+3)-lstk(bot)
         if(err.gt.0) goto 90
         istk(l)=code  
         if(getendian().eq.1) then
            istk(l+1)=val1(1)
            istk(l+2)=val1(2)
         else
            istk(l+1)=val1(2)
            istk(l+2)=val1(1)
         endif
         comp(1)=l+3
      elseif(code.eq.16) then
c     set line number
         err=sadr(l+1)-lstk(bot)
         if(err.gt.0) goto 90
         istk(l)=code  
         istk(l+1)=val1(1)
         comp(1)=l+2
      elseif(code.eq.18) then
c     mark named argument
         err=sadr(l+nsiz+1)-lstk(bot)
         if(err.gt.0) goto 90
         istk(l)=code  
         call putid(istk(l+1),val1)
         comp(1)=l+nsiz+1
      elseif(code.eq.19) then
c     form recursive extraction list
         err=sadr(l+3)-lstk(bot)
         if(err.gt.0) goto 90
         istk(l)=code  
         istk(l+1)=val1(1)
         istk(l+2)=val2
         comp(1)=l+3
      elseif(code.eq.22) then
c     set print mode
         err=sadr(l+1)-lstk(bot)
         if(err.gt.0) goto 90
         istk(l)=code  
         istk(l+1)=val1(1)
         comp(1)=l+2
      elseif(code.eq.23) then
c     name2var
         err=sadr(l+nsiz+1)-lstk(bot)
         if(err.gt.0) goto 90
         istk(l)=code  
         call putid(istk(l+1),val1)
         comp(1)=l+nsiz+1
      elseif(code.eq.25) then
c     profile
         err=sadr(l+3)-lstk(bot)
         if(err.gt.0) goto 90
         istk(l)=code  
         istk(l+1)=val1(1)
         istk(l+2)=0
         comp(1)=l+3
      elseif(code.ge.100) then
c     appel des fonctions <100*fun rhs lhs fin>
         err=sadr(l+(nsiz+3))-lstk(bot)
         if(err.gt.0) goto 90
         istk(l)=code
         istk(l+1)=val1(1)
         istk(l+2)=val2
         istk(l+3)=val3
         comp(1)=l+4
      else
c     defmat:<4>
c     pause :<12>
c     break :<13>
c     abort :<14>
c     seteol:<15>
c     quit  :<17>
c     exit  :<20>
c     begrhs:<21>
c     deffnull:<24>
c     return:<99>
         err=sadr(l+2)-lstk(bot)
         if(err.gt.0) goto 90
         istk(l)=code
         comp(1)=l+1
      endif

      return
 90   call error(17)
      return
      end