Annotation of OpenXM_contrib2/asir2000/parse/cpp.h, Revision 1.1
1.1 ! noro 1: /* $OpenXM: OpenXM/src/asir99/parse/cpp.h,v 1.1.1.1 1999/11/10 08:12:34 noro Exp $ */
! 2: #ifndef _ACCUM_
! 3: #define _ACCUM_
! 4:
! 5: #include <string.h>
! 6:
! 7: typedef struct {
! 8: int have;
! 9: int used;
! 10: char *buf; } ACCUM;
! 11:
! 12: char *init_accum(void);
! 13: char *accum_result(char *A);
! 14: char accum_regret(char *A);
! 15: char *accum_buf(char *A);
! 16:
! 17: #endif
! 18: #ifndef _EXPR_
! 19: #define _EXPR_
! 20:
! 21: typedef struct _node {
! 22: int leaf;
! 23: char *name;
! 24: struct _node *left;
! 25: struct _node *right;
! 26: int op; } NODE;
! 27:
! 28: NODE *read_expr();
! 29: NODE *read_expr_p(void);
! 30:
! 31: extern int expr_sharp;
! 32:
! 33: #endif
! 34: #ifndef _IF_
! 35: #define _IF_
! 36:
! 37: typedef struct _if {
! 38: struct _if *next;
! 39: int condstate; } IF;
! 40: #define IFSTATE_TRUE 0
! 41: #define IFSTATE_FALSE 1
! 42: #define IFSTATE_STAYFALSE 2
! 43:
! 44: extern IF *ifstack;
! 45: extern int n_skipped_ifs;
! 46:
! 47: #endif
! 48: #ifndef _IO_
! 49: #define _IO_
! 50:
! 51: #include <stdio.h>
! 52:
! 53: #if 0
! 54: #define MAX_PUSHBACK 8192
! 55: #define MAXFILES 20
! 56: #endif
! 57: #define MAX_PUSHBACK 512
! 58: #define MAXFILES 4
! 59:
! 60: extern int linefirst;
! 61: extern int willbefirst;
! 62:
! 63: #define outfile cpp_outfile
! 64: extern FILE *outfile;
! 65:
! 66: /*
! 67: extern int fstackdepth;
! 68: extern char pushback[_NFILE][MAX_PUSHBACK];
! 69: extern int npushed[_NFILE];
! 70: extern FILE *fstack[_NFILE];
! 71: extern char *fn[_NFILE];
! 72: extern char *incldir[_NFILE];
! 73: extern int lineno[_NFILE];
! 74: */
! 75:
! 76: char Get(void);
! 77: char getnonspace(void);
! 78: char getnonhspace(void);
! 79: char getnhsexpand(void);
! 80: char getexpand(void);
! 81: char *curfile(void);
! 82: char **Curfile(void);
! 83: int curline(void);
! 84: int *Curline(void);
! 85: char *curdir(void);
! 86: char **Curdir(void);
! 87: char *read_ctrl(void);
! 88: char *read_ident(void);
! 89:
! 90: #endif
! 91: #ifndef _IS_
! 92: #define _IS_
! 93:
! 94: #include <ctype.h>
! 95:
! 96: int ishspace(char c);
! 97: int isbsymchar(char c);
! 98: int issymchar(char c);
! 99:
! 100: #endif
! 101: #ifndef _MALLOC_
! 102: #define _MALLOC_
! 103:
! 104: #if 0
! 105: #define malloc check0_malloc
! 106: #define realloc check0_realloc
! 107: #endif
! 108:
! 109: #if defined(THINK_C)
! 110: char *malloc(int);
! 111: char *realloc(void *,int);
! 112: #else
! 113: char *malloc(size_t);
! 114: char *realloc(void *, size_t);
! 115: #endif
! 116: char *copyofstr(char *str);
! 117: char *copyofblk(char *blk, int len);
! 118: #define NEW(type) ((type *) malloc((int)sizeof(type)))
! 119: #define OLD(x) free((char *) x)
! 120: #define check_malloc(ptr) Check_malloc((char *)(ptr))
! 121:
! 122: #endif
! 123: #ifndef _STATS_H_9617d11a_
! 124: #define _STATS_H_9617d11a_
! 125:
! 126: extern int n_defines;
! 127: extern int n_undefines;
! 128: extern int n_hits;
! 129: extern int n_misses;
! 130:
! 131: #endif
! 132: #ifndef _SYMTBL_
! 133: #define _SYMTBL_
! 134:
! 135: typedef struct _def {
! 136: struct _def *link;
! 137: char *name;
! 138: int nargs;
! 139: unsigned char *repl;
! 140: int how;
! 141: #define DEF_PREDEF 0
! 142: #define DEF_CMDLINE 1
! 143: #define DEF_DEFINE 2
! 144: } DEF;
! 145:
! 146: extern DEF **symtbl;
! 147: extern int symtbl_size;
! 148: extern int n_in_table;
! 149:
! 150: DEF *find_def(char *name);
! 151:
! 152: #endif
! 153: #ifndef unctrl
! 154: #define unctrl(c) _unctrl[0xff&(int)(c)]
! 155: #define Unctrl(c) _Unctrl[0xff&(int)(c)]
! 156: extern char *_unctrl[];
! 157: extern char *_Unctrl[];
! 158: #endif
! 159:
! 160: void dump_single(DEF *);
! 161: void dump_expr(NODE *);
! 162: void do_at(void);
! 163: void do_debug(void);
! 164: void read_formals(void);
! 165: void do_dump(void);
! 166: void err_head(void);
! 167: void do_eval(void);
! 168: int get_quote_char(void);
! 169: NODE *read_expr_11(void);
! 170: NODE *read_expr_10(void);
! 171: NODE *read_expr_9(void);
! 172: NODE *read_expr_8(void);
! 173: NODE *read_expr_7(void);
! 174: NODE *read_expr_6(void);
! 175: NODE *read_expr_5(void);
! 176: NODE *read_expr_4(void);
! 177: NODE *read_expr_3(void);
! 178: NODE *read_expr_2(void);
! 179: NODE *read_expr_1(void);
! 180: NODE *read_expr_0(void);
! 181: NODE *read_expr_(void);
! 182: NODE *read_expr_p(void);
! 183: void iftrue(void);
! 184: void iffalse(void);
! 185: void init_include(void);
! 186: void flush_final_nl(void);
! 187: void input_mark(void);
! 188: void input_unmark(void);
! 189: void input_recover(void);
! 190: void mark_file_beginning(void);
! 191: void mark_file_ending(void);
! 192: void mark_charpushed(void);
! 193: void mark_get_line(void);
! 194: void do_line(void);
! 195: void do_pragma(void);
! 196: void do_set(void);
! 197: void do_sharp(void);
! 198: void flush_sharp_line(void);
! 199: void init_stats(void);
! 200: void save_stats(void);
! 201: void init_symtbl(void);
! 202: void undef_predefs(void);
! 203: void do_while(void);
! 204: void do_endwhile(void);
! 205: void Check_malloc(char * ptr);
! 206:
! 207: void output_ifstate(int state);
! 208: void out_at(int line, char *file);
! 209: void outputc(char c);
! 210: void outputs(char *s);
! 211: void outputd(int n);
! 212:
! 213: void do_at(void);
! 214: void do_debug(void);
! 215: void do_define(int sharp, int redef);
! 216: void do_dump(void);
! 217: void do_eval(void);
! 218: void do_if(int expr_sharp);
! 219: void do_ifdef(int expr_sharp);
! 220: void do_ifndef(int expr_sharp);
! 221: void do_else(int expr_sharp);
! 222: void do_elif(int expr_sharp);
! 223: void do_endif(int expr_sharp);
! 224: void do_include(int expr_sharp);
! 225: void do_line(void);
! 226: void do_pragma(void);
! 227: void do_set(void);
! 228: void do_sharp(void);
! 229: void do_undef(int expr_sharp);
! 230: void do_while(void);
! 231: void do_endwhile(void);
! 232: int free(char *);
! 233: void Push(char);
! 234: void putx(int);
! 235: void Bcopy(char *from, char *to, int len);
! 236: void maybe_print(char);
! 237: void read_include_file(char *,int,int);
! 238: void mark_got_from_pushback(char);
! 239: void mark_got_from_file(char);
! 240: void mark_got(char);
! 241: void define(char *,int,unsigned char *,int);
! 242: int undef(char *);
! 243: void push_new_file(char *,FILE *);
! 244: void defd(char *,int);
! 245: void free_expr(NODE *n);
! 246: int in_false_if(void);
! 247: int eval_expr(int,int);
! 248: void abort();
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>