]> git.sesse.net Git - vlc/blob - modules/visualization/galaktos/expr_types.h
a5563f093687a61ca0b5341e36552dbfaa170a6a
[vlc] / modules / visualization / galaktos / expr_types.h
1 #ifndef EXPR_TYPES_H
2 #define EXPR_TYPES_H
3 #include "param_types.h"
4
5 #define CONST_STACK_ELEMENT 0
6 #define EXPR_STACK_ELEMENT 1
7
8 /* General Expression Type */
9 typedef struct GEN_EXPR_T {
10   int type;
11   void * item;
12 } gen_expr_t;
13
14 typedef union TERM_T {
15   double constant; /* static variable */
16   struct PARAM_T * param; /* pointer to a changing variable */
17 } term_t;
18
19 /* Value expression, contains a term union */
20 typedef struct VAL_EXPR_T {
21   int type;
22   term_t term;
23 } val_expr_t;
24
25 /* Infix Operator Function */
26 typedef struct INFIX_OP_T {
27   int type;
28   int precedence;  
29 } infix_op_t;
30
31 /* A binary expression tree ordered by operator precedence */
32 typedef struct TREE_EXPR_T {
33   infix_op_t * infix_op; /* null if leaf */
34   gen_expr_t * gen_expr;
35   struct TREE_EXPR_T * left, * right;
36 } tree_expr_t;
37
38 /* A function expression in prefix form */
39 typedef struct PREFUN_EXPR_T {
40   double (*func_ptr)();
41   int num_args;
42   gen_expr_t ** expr_list;
43 } prefun_expr_t;
44
45
46
47
48 #endif