File: code.h

package info (click to toggle)
graphviz 2.8-3%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 20,480 kB
  • ctags: 22,071
  • sloc: ansic: 163,260; cpp: 36,565; sh: 25,024; yacc: 2,358; tcl: 1,808; makefile: 1,745; cs: 805; perl: 801; ml: 649; awk: 160; lex: 153; python: 105; ruby: 32; php: 6
file content (108 lines) | stat: -rw-r--r-- 2,666 bytes parent folder | download | duplicates (3)
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
/* $Id: code.h,v 1.2 2005/04/08 20:45:33 erg Exp $ $Revision: 1.2 $ */
/* vim:set shiftwidth=4 ts=8: */

/**********************************************************
*      This software is part of the graphviz package      *
*                http://www.graphviz.org/                 *
*                                                         *
*            Copyright (c) 1994-2004 AT&T Corp.           *
*                and is licensed under the                *
*            Common Public License, Version 1.0           *
*                      by AT&T Corp.                      *
*                                                         *
*        Information and Software Systems Research        *
*              AT&T Research, Florham Park NJ             *
**********************************************************/

#ifdef __cplusplus
extern "C" {
#endif

/* Lefteris Koutsofios - AT&T Labs Research */

#ifndef _CODE_H
#define _CODE_H
#define C_NULL -1

#define C_ISSTMT(ct) (ct >= C_STMT && ct <= C_RETURN)

#define C_CODE      0
#define C_ASSIGN    1
#define C_INTEGER   2
#define C_REAL      3
#define C_STRING    4
#define C_OR        5
#define C_AND       6
#define C_EQ        7
#define C_NE        8
#define C_LT        9
#define C_LE       10
#define C_GT       11
#define C_GE       12
#define C_PLUS     13
#define C_MINUS    14
#define C_MUL      15
#define C_DIV      16
#define C_MOD      17
#define C_UMINUS   18
#define C_NOT      19
#define C_PEXPR    20
#define C_FCALL    21
#define C_GVAR     22
#define C_LVAR     23
#define C_PVAR     24
#define C_FUNCTION 25
#define C_TCONS    26
#define C_DECL     27
#define C_STMT     28
#define C_IF       29
#define C_WHILE    30
#define C_FOR      31
#define C_FORIN    32
#define C_BREAK    33
#define C_CONTINUE 34
#define C_RETURN   35
#define C_INTERNAL 36
#define C_ARGS     37
#define C_NOP      38
#define C_SIZE     39

typedef struct Code_t {
    int ctype;
    int next;
    union {
        char s[1];
        double d;
        long i;
        int fp;
        void *o;
    } u;
} Code_t;
#define C_CODESIZE sizeof (Code_t)

#define Cgetstring(i) (char *) &cbufp[i].u.s[0]
#define Cgetindex() cbufi

#define Csettype(a, b) cbufp[a].ctype = b
#define Csetfp(a, b) cbufp[a].u.fp = b
#define Csetnext(a, b) cbufp[a].next = b
#define Csetinteger(a, b) cbufp[a].u.i = b
#define Csetobject(a, b) cbufp[a].u.o = b
#define Csetreal(a, b) cbufp[a].u.d = b

extern Code_t *cbufp;
extern int cbufn, cbufi;

void Cinit (void);
void Cterm (void);
void Creset (void);
int Cnew (int);
int Cinteger (long);
int Creal (double);
int Cstring (char *);
#endif /* _CODE_H */

#ifdef __cplusplus
}
#endif