1 //-----------------------------------------------------------------------------
3 // Scan expr for vars, return in vector
5 // Input: Expression on stack
9 //-----------------------------------------------------------------------------
13 static void scan(U
*);
14 static int __cmp(const void *, const void *);
27 qsort(stack
+ h
, n
, sizeof (U
*), __cmp
);
29 p1
->u
.tensor
->ndim
= 1;
30 p1
->u
.tensor
->dim
[0] = n
;
31 for (i
= 0; i
< n
; i
++)
32 p1
->u
.tensor
->elem
[i
] = stack
[i
];
48 } else if (issymbol(p
) && p
!= symbol(E
)) {
49 for (i
= h
; i
< tos
; i
++)
57 __cmp(const void *p1
, const void *p2
)
59 return cmp_expr(*((U
**) p1
), *((U
**) p2
));