view mc-parse.h @ 464:d88f08d81bba

inline continue.... const type lvar offset for inline local will be add
author kono
date Tue, 07 Dec 2004 12:30:18 +0900
parents 214272c8f2da
children b4d9809d6ee2
line wrap: on
line source

/* for mc-parse.c */

extern int sym;             /* next symbol */
extern int type;            /* current type */
extern int mode;            /* grammer mode (STAT,ADECL) */
extern int stmode;          /* storage mode (STATIC,EXTRN) */
extern int ctmode;          /* constant mode */
extern int inmode;          /* inline mode */
extern int labelno;         /* label number */
extern int gpc;             /* global variable size (unused?) */
extern int disp;            /* local variable offset */
extern int args;            /* function arguments */
extern int init_vars;       /* variable initialize list in local decl */
extern int cslabel;         /* case label */
extern int cslist;          /* case list */
extern int clabel;          /* continue label */
extern int control;         /* control is reached */
extern NMTBL *nptr;         /* current name table */
extern NMTBL *gnptr;        /* currrent global name table (unsed?) */
extern NMTBL *fnptr;        /* current function name table */
extern int gtypedefed;      /* global typedef list */
extern int retlabel;        /* return label */
extern int retpending;      /* jump to return label suspended */
extern int retcont;         /* continuation label */
extern int pending_jmp;     /* suspended jump label */
extern int chk;             /* no code generation */
extern int bit_field_disp;  /* bit field bit offset */
extern int fields;          /* struct field */
extern int struct_return;   /* temporal return structure variable */
extern int lastexp;         /* last expression in statement expressoin */
extern int debug;           /* debug flag */
extern int decl_str_init;   /* partial structure initializer */
extern int inline_funcs;    /* inline function list */

extern int parse;   /* parse tree */

/*
          STRING         nptr
          MACRO          nptr
          FMACRO         nptr
          RESERVE        nptr
          TAG            nptr
          FIELD          nptr
          TYPE           nptr
 */

/* memory pool structure */
/*    extendable         */
typedef struct cheap
{
    char *ptr;			/* current pointer */
    char *last;
    char *first;
    struct cheap *next; 	/* previous cheap  */
} CHEAP;


/* used in mc-macro.c */

extern int asmf;             /* assembler generating mode (old) */
extern int ch;               /* current character */
extern int chptrsave;        /* nested character pointer */
extern int chsave;           /* saved current character */
extern char linebuf[LBUFSIZE];   /* line buffer */
extern char *chptr;          /* current character pointer */
extern int glineno;          /* total lineno */
extern int in_comment;       /* tokenizer mode */
extern int in_quote;         /* tokenizer mode */
extern int lfree;            /* local free heap top */
extern int lineno;           /* lineno in current file */
extern int lsrc;             /* source listing flag */
extern char *include_path[MAX_INCLUDE_PATH_COUNT];

/* used in mc-code-* */

extern  NMTBL null_nptr;

extern char * make_filename_with_extension(char *filename,char *ext);

/* used in mc-switch */

extern void free_glist3(int e1);
extern void free_glist3_a(int e1);
extern int csvalue1;	     /* current switch variable */
extern int blabel;           /* break label in switch */
extern int dlabel;           /* default label in switch */

/* used in mc-tree.c */

extern int typedefed;        /* accumlated typedef name */

/* global variable end */

extern void free_glist2(int e1);

/* used in mc-codegen.c */

extern NMTBL * anonymous_nptr();;
extern int append4(int p,int a1,int a2,int a3);
extern void display_ntable(NMTBL *n, char *s);
extern NMTBL * lsearch(char *name,int sc);
#if FLOAT_CODE
extern int dlist2(int e1, double d1);
#endif
extern void error(int n);
extern int glist2(int e1,int e2);
extern int glist3(int e1,int e2,int e3);

extern int insert_ascend(int p,int e,int eq());
extern int length(int list);
extern int list2(int e1, int e2);
extern int list3(int e1, int e2, int e3);
extern int list4(int e1, int e2, int e3, int e4);
extern void extern_define(char *s,int d,int type,int use);
extern void set_lfree(int save);

extern int has_attr(NMTBL *n,int attr);
extern int attr_value(NMTBL *n,int attr);
extern void set_attr(NMTBL *n,int attr,int value);

#if LONGLONG_CODE
extern int llist2(int e1, long long d1);
#endif
extern int neqname(char *p,char *q);
extern NMTBL *new_static_name(char *name,int delimit);
extern int reverse0(int t1);
extern int size(int t);

/* used in mc-macro.c */

extern struct cheap *cheap;

extern NMTBL *get_name(char *name,int *i,int mode);
#define DEF 1
#define NONDEF 2

extern NMTBL * get_name_from_chptr();
extern NMTBL *name_space_search(NMTBL *ns,int sc);

extern int getsym(int sc);
extern int getch(void);
extern int skipspc(void);
extern void copy_current_file_dir(char *name);
extern int expr(int noconv);

extern int alpha(int c);
extern int digit(int c);
extern void enter_scope();
extern void leave_scope();
extern NMTBL *make_local_scope();

extern struct cheap * increment_cheap(struct cheap *cheap,char **save);
extern void save_cheap(struct cheap *scheap,struct cheap *cheap);
extern struct cheap * reset_cheap(struct cheap *scheap);
extern void pfdecl(NMTBL *nptr);
#if CASE_CODE
extern int docase_eq();
#endif
extern NMTBL *l_top_search(char *name,int sc);

/* end */