source: tags/initial/AISC/aisc.h

Last change on this file was 2, checked in by oldcode, 24 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
Line 
1#define OPENFILES   16
2#define HASHSIZE   1024
3#define STACKSIZE   10
4enum aisc_commands {
5        no_command,
6        IF,
7        ENDIF,
8        ELSE,
9        FOR,
10        NEXT,
11        ENDFOR,
12        ELSEIF,
13        FUNCTION,
14        LABEL,
15        MAX_COM };
16
17struct hash_entry {
18        char *key;
19        char *val;
20        struct hash_entry *next;
21};
22typedef struct hash_struct {
23        int size;
24        struct hash_entry **entries;
25        } hash;
26
27
28typedef struct acm_data {
29        struct acm_data *next_item;
30        struct acm_data *next_line;
31        struct acm_data *first_item;
32        struct acm_data *first_line;
33        struct acm_data *father;
34        const char *key;
35        struct acm_data *sub;
36        char *val;
37} AD;
38
39typedef struct header_struct {
40        struct header_struct *next;
41        char *key;
42} HS;
43       
44struct for_data_struct {
45        char            *forstr;
46        AD              *forcursor;
47        long            forval;
48        long            forend;
49        struct for_data_struct *next;
50        };
51
52       
53
54typedef struct command_lines {
55        struct command_lines *next;
56        char            *str;
57        int             linenr;
58        char            *path;
59        enum aisc_commands      command;
60        struct for_data_struct  *fd;
61        struct command_lines *IF;
62        struct command_lines *ELSE;
63        struct command_lines *ENDIF;
64        struct command_lines *FOR;
65        struct command_lines *NEXT;
66        struct command_lines *ENDFOR;
67        } CL;
68
69struct stack_struct {
70        AD *cursor;
71        CL *pc;
72        hash    *hs;
73        struct stack_struct *next;
74        };
75
76struct param_struct {
77        char *param;
78        struct param_struct *next;
79        };
80
81struct global_struct {
82        int      error_flag;
83        char     b_tab[256];
84        char     s_tab[256];
85        char     s2_tab[256];
86        char     s3_tab[256];
87        char     c_tab[256];
88        char     outtab[256];
89        AD *cursor;
90        AD *root;
91        CL *prg;
92        CL *pc;
93        CL *nextpc;
94        struct stack_struct     *st;
95        int             sp;
96        int      line_cnt;
97        char    *line_path;
98        int      lastchar;
99        char *linebuf;
100        int     bufsize;
101        int     s_pos;
102        FILE    *out;
103        FILE    *outs[OPENFILES];
104        char    *fouts[OPENFILES];
105        int     tabstop;
106        int     tabs[10];
107        hash    *fns;
108        int     tabpos;
109};
110
111extern struct global_struct *gl;
112extern char error_buf[256];
113#define READ_SPACES(var)        while(gl->s3_tab[(unsigned)(*var)]) var++;
114#define READ_RSPACES(var)       while(gl->s3_tab[(unsigned)(*(--var))]);
115
116#define EOSTR 0
117#define BEG_STR1 '('
118#define BEG_STR2 '~'
119#define END_STR1 '~'
120#define END_STR2 ')'
121
122
123
Note: See TracBrowser for help on using the repository browser.