summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/web2c/web2c.h
blob: 408d6430a44a1bc003c98ebba25e8c3e52b3ebdd (plain)
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
/* web2c.h: general includes for the Web2c program itself.  Public domain.  */

#include <w2c/config.h>

#define ex_32 2
#define ex_real 3

#undef max
#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 var_list[200];
extern char field_list[200];
extern char last_id[80];
extern char z_id[80];
extern char next_temp[];

extern long last_i_num;
extern int ii, l_s;
extern long lower_bound, upper_bound;
extern FILE *out;
extern int pf_count;

/* A symbol table entry.  */
struct sym_entry {
  char *id;	/* points to the identifier */
  int typ;	/* token type */
  int next;	/* next symbol entry */
  long val;	/* constant : value
		   subrange type : lower bound */
  long upper; 	/* subrange type : upper bound
		   variable, function, type or field : type length */
  int val_sym, upper_sym;	/* Sym table entries of symbols for lower
				   and upper bounds
				 */
  boolean var_formal;	/* Is this a formal parameter by reference? */
  boolean var_not_needed;
  		      /* True if VAR token should be ignored for this type */
};

extern char strings[];
extern int hash_list[];
extern short global;
extern struct sym_entry sym_table[];
extern int next_sym_free, next_string_free;
extern int mark_sym_free, mark_string_free;

extern void find_next_temp (void);
extern void normal (void);
extern void new_line (void);
extern void my_output (const_string);
extern void semicolon (void);
extern void remove_locals (void);
extern void mark (void);
extern void initialize (void);
extern int add_to_table (string);
extern int search_table (const_string);
extern int yyerror (const_string);

extern void get_string_literal (char*);
extern void get_single_char (char*);
extern void get_result_type (char*);
extern void get_return_type (char*);

extern int yylex(void), yyparse(void);