OpenCores
URL https://opencores.org/ocsvn/raptor64/raptor64/trunk

Subversion Repositories raptor64

[/] [raptor64/] [trunk/] [software/] [c64/] [source/] [C.h] - Blame information for rev 51

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 37 robfinch
/*
2
 *      68000 C compiler
3
 *
4
 *      Copyright 1984, 1985, 1986 Matthew Brandt.
5
 *  all commercial rights reserved.
6
 *
7
 *      This compiler is intended as an instructive tool for personal use. Any
8
 *      use for profit without the written consent of the author is prohibited.
9
 *
10
 *      This compiler may be distributed freely for non-commercial use as long
11
 *      as this notice stays intact. Please forward any enhancements or questions
12
 *      to:
13
 *
14
 *              Matthew Brandt
15
 *              Box 920337
16
 *              Norcross, Ga 30092
17
 */
18
 
19
/*      compiler header file    */
20
 
21
enum e_sym {
22
        id, cconst, iconst, lconst, sconst, rconst, plus, minus,
23
        star, divide, lshift, rshift, modop, eq, neq, lt, leq, gt,
24
        geq, assign, asplus, asminus, astimes, asdivide, asmodop,
25
                aslshift, asrshift, asand, asor, autoinc, autodec, hook, compl,
26
        comma, colon, semicolon, uparrow, openbr, closebr, begin, end,
27
        openpa, closepa, pointsto, dot, lor, land, not, or, and,
28
                ellipsis,
29
 
30
                kw_int, kw_byte, kw_icache, kw_dcache,
31
        kw_void, kw_char, kw_float, kw_double, kw_struct, kw_union,
32
        kw_long, kw_short, kw_unsigned, kw_auto, kw_extern,
33
        kw_register, kw_typedef, kw_static, kw_goto, kw_return,
34
        kw_sizeof, kw_break, kw_continue, kw_if, kw_else, kw_elsif,
35
                kw_for, kw_forever, kw_signed,
36
                kw_firstcall, kw_asm, kw_fallthru, kw_until, kw_loop,
37
                kw_try, kw_catch, kw_throw, kw_typenum,
38
        kw_do, kw_while, kw_switch, kw_case, kw_default, kw_enum,
39
                kw_interrupt, kw_vortex, kw_pascal, kw_oscall, kw_nocall, kw_intoff, kw_inton, kw_then,
40
                kw_private,kw_public,kw_stop,kw_critical,kw_spinlock,kw_spinunlock,kw_lockfail,
41
        eof };
42
 
43
enum e_sc {
44
        sc_static, sc_auto, sc_global, sc_external, sc_type, sc_const,
45
        sc_member, sc_label, sc_ulabel, sc_typedef };
46
 
47
enum e_bt {
48
                bt_byte,
49
        bt_char, bt_short, bt_long, bt_float, bt_double, bt_pointer,
50
                bt_uchar, bt_ushort, bt_ulong,
51
        bt_unsigned, bt_struct, bt_union, bt_enum, bt_void, bt_func, bt_ifunc,
52
                bt_interrupt, bt_oscall, bt_pascal, bt_bitfield, bt_ubitfield, bt_last};
53
 
54
struct slit {
55
    struct slit     *next;
56
    int             label;
57
    char            *str;
58
};
59
 
60
struct typ;
61
 
62
struct sym {
63
    struct sym *next;
64
    char *name;
65
    __int8 storage_class;
66
        // Function attributes
67
        __int8 NumParms;
68
        struct sym *parms;
69
        struct sym *nextparm;
70
        unsigned int IsPrototype : 1;
71
        unsigned int IsInterrupt : 1;
72
        unsigned int IsNocall : 1;
73
        unsigned int IsPascal : 1;
74
        unsigned int IsLeaf : 1;
75
        unsigned int DoesThrow : 1;
76
    union {
77
        __int64 i;
78
        unsigned __int64 u;
79
        double f;
80
        char *s;
81
    } value;
82
    struct typ *tp;
83
};
84
 
85
typedef struct typ {
86
    __int8 type;
87
        __int16 typeno;                 // number of the type
88
        unsigned int val_flag : 1;       /* is it a value type */
89
        unsigned int isUnsigned : 1;
90
        unsigned int isShort : 1;
91
        unsigned int isVolatile : 1;
92
        __int8          bit_width;
93
        __int8          bit_offset;
94
    long        size;
95
    struct stab {
96
            struct sym *head, *tail;
97
            }       lst;
98
    struct typ      *btp;
99
    char            *sname;
100
} TYP;
101
 
102
#define SYM     struct sym
103
//#define TYP     struct typ
104
#define TABLE   struct stab
105
 
106
#define MAX_STRLEN      120
107
#define MAX_STLP1       121
108
#define ERR_SYNTAX      0
109
#define ERR_ILLCHAR     1
110
#define ERR_FPCON       2
111
#define ERR_ILLTYPE     3
112
#define ERR_UNDEFINED   4
113
#define ERR_DUPSYM      5
114
#define ERR_PUNCT       6
115
#define ERR_IDEXPECT    7
116
#define ERR_NOINIT      8
117
#define ERR_INCOMPLETE  9
118
#define ERR_ILLINIT     10
119
#define ERR_INITSIZE    11
120
#define ERR_ILLCLASS    12
121
#define ERR_BLOCK       13
122
#define ERR_NOPOINTER   14
123
#define ERR_NOFUNC      15
124
#define ERR_NOMEMBER    16
125
#define ERR_LVALUE      17
126
#define ERR_DEREF       18
127
#define ERR_MISMATCH    19
128
#define ERR_EXPREXPECT  20
129
#define ERR_WHILEXPECT  21
130
#define ERR_NOCASE      22
131
#define ERR_DUPCASE     23
132
#define ERR_LABEL       24
133
#define ERR_PREPROC     25
134
#define ERR_INCLFILE    26
135
#define ERR_CANTOPEN    27
136
#define ERR_DEFINE      28
137
#define ERR_CATCHEXPECT 29
138
#define ERR_BITFIELD_WIDTH      30
139
#define ERR_EXPRTOOCOMPLEX      31
140
#define ERR_ASMTOOLONG  32
141
#define ERR_TOOMANYCASECONSTANTS        33
142
#define ERR_CATCHSTRUCT         34
143 51 robfinch
#define ERR_SEMA_INCR   35
144
#define ERR_SEMA_ADDR   36
145 37 robfinch
 
146
/*      alignment sizes         */
147
 
148
#define AL_BYTE                 1
149
#define AL_CHAR         2
150
#define AL_SHORT        4
151
#define AL_LONG         8
152
#define AL_POINTER      8
153
#define AL_FLOAT        4
154
#define AL_DOUBLE       8
155
#define AL_STRUCT       8
156
 
157
#define TRUE    1
158
#define FALSE   0
159
#define NULL    ((void *)0)
160
 
161


powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.