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
109
110
111
112
113
114
115
116
117
|
#include <stdio.h>
#include "site.h"
#define TRUE 1
#define FALSE 0
#ifndef BSD
#include <string.h>
#define rindex strrchr
#define index strchr
#else
#include <strings.h>
#endif
#ifndef ANSI
#ifdef SYSV
extern sprintf();
#else
extern char *sprintf();
#endif
#endif
#define max_line_length (78)
#define max_strings (20000)
#define hash_prime (101)
#define sym_table_size (3000)
#define unused (271828)
#define ex_32 (2)
#define ex_real (3)
#define max(a,b) ((a>b)?a:b)
extern int indent;
extern int line_pos;
extern int last_brace;
extern int block_level;
extern int ii;
extern int last_tok;
extern char safe_string[80];
extern char field_list[200];
extern char last_id[80];
extern char next_temp[];
extern long last_i_num;
/*l_s is assigned by LEX to point to any non-reserved id*/
extern int ii, l_s;
extern long lower_bound, upper_bound;
extern FILE *fopen();
extern FILE *std;
extern int pf_count;
#include "w2c-symtab.h"
extern char strings[max_strings];
extern int hash_list[hash_prime];
extern short global;
#ifdef MS_DOS
extern struct sym_entry huge sym_table[sym_table_size];
#else
extern struct sym_entry sym_table[sym_table_size];
#endif
extern int last_sym_used, next_string_free;
#ifdef FLEX
extern char *yytext;
#else /* LEX */
#ifdef HP
extern unsigned char yytext[];
#else /* Not HP */
extern char yytext[];
#endif /* HP */
#endif /* LEX */
/* These macros describe various types of variables. Any distinct small
numbers will do*/
#define is_char 1
#define is_file 2
#define is_array 3
#define is_record 4
#define is_int 5
#define is_real 6
#define is_point 7
#define is_string 8
static int uses_mem, uses_eqtb ;
char my_routine[100]; /* Name of routine being parsed, if any */
#ifdef ANSI
extern void exit(int);
extern int yyparse(void);
void find_next_temp(void);
void normal(void);
void silent(void);
void mark(void);
void forward(int);
void un_forward(int);
void to_string(char *);
void new_line(void);
void indent_line(void);
void my_output(char *);
void semicolon(void);
void yyerror(char *);
int hash(char *);
int search_table(char *);
int add_to_table(char *);
void pop_stack(void);
void push_stack(void);
void initialize(void);
void main(int,char * *);
#else
void find_next_temp(), normal(), new_line(), indent_line(), mark(),
my_output(), silent(), forward(), un_forward(), to_string(),
semicolon(), yyerror(), pop_stack(), push_stack(), initialize();
#endif
|