home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / oxcc1433.zip / SRC / OXCC.H < prev    next >
C/C++ Source or Header  |  1995-06-30  |  5KB  |  156 lines

  1. /* 
  2.     oxcc.h -- header file for Oxbow C compiler
  3.  
  4.     Copyright (c) 1995
  5.     Norman D. Culver dba
  6.     Oxbow Software
  7.     1323 S.E. 17th Street #662
  8.     Ft. Lauderdale, FL 33316
  9.     (305) 527-1663 Voice
  10.     (305) 760-7584 Fax
  11.     (305) 760-4679 Data
  12.     ndc@fhd486.harvard.edu
  13.     norman.culver@channel1.com
  14.     All rights reserved.
  15.  
  16.  * Redistribution and use in source and binary forms are permitted
  17.  * provided that: (1) source distributions retain this entire copyright
  18.  * notice and comment, and (2) distributions including binaries display
  19.  * the following acknowledgement:  ``This product includes software
  20.  * developed by Norman D. Culver dba Oxbow Software''
  21.  * in the documentation or other materials provided with the distribution
  22.  * and in all advertising materials mentioning features or use of this
  23.  * software.
  24.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  25.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  26.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  27.  
  28. */
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33. /* debug bits */
  34. #define dA    (0x00000001)    /* DEBUG_STRUCT_ELEMS */
  35. #define dB    (0x00000002)    /* DEBUG_ASSIGNMENT */
  36. #define dC    (0x00000004)    /* DEBUG_GETVAL */
  37. #define dD    (0x00000008)    /* DEBUG_ABSOLUTE_ADDR */
  38. #define dE    (0x00000010)    /* DEBUG_POINTER_BUMPS */
  39. #define dF    (0x00000020)    /* DEBUG_INITTED */
  40. #define dG    (0x00000040)    /* DEBUG_SHADOW */
  41. #define dH    (0x00000080)    /* DEBUG_CAST */
  42. #define dI    (0x00000100)    /* DEBUG_CMS */
  43. #define dJ    (0x00000200)    /* DEBUG_DEREF */
  44. #define dK    (0x00000400)    /* DEBUG_SETJMP */
  45. #define dL    (0x00000800)    /* DEBUG_CALLBACKS */
  46. #define dM    (0x00001000)    /* DEBUG_GROSS */
  47. #define dN    (0x00002000)    /* DEBUG_BLOB */
  48. #define dO    (0x00004000)    /* DEBUG_RINITS */
  49. #define dP    (0x00008000)    /* DEBUG_RUNSTACK */
  50. #define dQ    (0x00010000)    /* DEBUG_STMT_TRACE */
  51. #define dR    (0x00020000)    /* DEBUG_RUNCALLS */
  52. #define dS    (0x00040000)    /* DEBUG_PURGE */
  53. #define dT    (0x00080000)
  54. #define dU    (0x00100000)
  55. #define dV    (0x00200000)
  56. #define dW    (0x00400000)
  57. #define dX    (0x00800000)
  58. #define dY    (0x01000000)
  59. #define dZ    (0x02000000)
  60.  
  61. /* NAME SPACES -- in the main symbol table */
  62. #define DATASPACE 0
  63. #define TAGSPACE 1
  64. #define MEMBERSPACE 2
  65. #define GOTOSPACE 3
  66. #define USEDSPACE 4
  67. #define LOCALSPACE 5
  68. #define KEEPERSPACE 6
  69. #define SUSPACE0 7
  70. #define SUSPACE1 8
  71. #define BSSPACE 9
  72. #define INITSPACE 10
  73. #define SEGSPACE 11
  74.  
  75. /* STRUCTURE FOR OPTIONS SETTING -- 16 bytes */
  76. typedef struct _oxccopts {
  77.     char code_format;
  78.     char target_hardware;
  79.     char target_debugger;
  80.     char target_os;
  81.     char memory_model;
  82.     char obj_format;
  83.     char target_assembler;
  84.     char runcode;
  85.     char fastmode;
  86.     char quiet;
  87.     char warn_addr;
  88.     char ansi_mode;
  89.     char shroud;
  90.     char listing_wanted;
  91.     char unused[2];
  92.     char asciz;        /* should be zero to imitate a string */
  93. } OXCCOPTS;
  94.  
  95. /* callable functions */
  96. #ifndef __OXCCFUNCSH__
  97. #define __OXCCFUNCSH__
  98. extern void oxcc_proc_syms(void *iv, unsigned namespace, void (*func)());
  99. /* func(AsTP node, int symb, void *container) */
  100.  
  101. extern void oxcc_proc_ptr_info(void *iv, void (*func)());
  102. /* func(void *addr, void *mino, void *maxo) */
  103.  
  104. extern void oxcc_proc_mallocs(void *iv, void (*func)());
  105. /* func(void *loc, int size, DATUM *ip) */
  106.  
  107. extern int oxcc(int argc, char **argv);
  108. extern void *oxcc_get_pg(void *iv);
  109. extern void oxcc_debug(void *iv, int flags);
  110. extern void oxcc_enable_trace(void *iv);
  111. extern void oxcc_disable_trace(void *iv);
  112.  
  113. extern void *oxcc_open_instance(void);
  114. extern void oxcc_set_options(void *iv, char *opts);
  115. extern int oxcc_preproc_file(void *iv, void *is, void *os, void *es,
  116.                                 int argc, char **argv);
  117. extern int oxcc_parse_file(void *iv, void *is, void *es, char *filename);
  118. extern void oxcc_print_parse_errors(void *iv, void *es);
  119. extern int oxcc_check_ast_tree(void *iv, void *es, char *filename);
  120. extern int oxcc_init_outers(void *iv, void *es);
  121. extern int oxcc_run_tree(void *iv, void *es, char *filename, 
  122.                                 char *argstring, char *startfunc);
  123. extern int oxcc_gen_code(void *iv, void *es, char *filename, void *os);
  124. extern void oxcc_cleanup_parse(void *iv);
  125. extern void oxcc_close_codefile(void *iv);
  126. extern void oxcc_close_instance(void *iv);
  127.  
  128. extern void oxcc_print_ast(void *iv, void *os, int flag);
  129. extern void *oxcc_get_ast_root(void *iv);
  130. extern int oxcc_eval_expr(void *iv, void *buf, double *result, void *es);
  131. extern void *__builtin_iv(void);
  132. extern void *__builtin_pg(void);
  133. #endif /* __OXCCFUNCSH__ */
  134.  
  135. #ifndef __OXCCCLASS__
  136. #define __OXCCCLASS__
  137. extern void gSetup(void *self, void *str);
  138. extern int gPreProc(void *self, void *is, void *os, void *es, int argc, char **argv);
  139. extern int gParse(void *self, void *is, void *es, char *filename);
  140. extern void gPerror(void *self, void *es);
  141. extern int gCheckTree(void *self, void *es, char *filename);
  142. extern int gInitOuters(void *self, void *es);
  143. extern int gRunCode(void *self, void *es, char *filename, char *args);
  144. extern int gGenCode(void *self, void *es, void *os, char *filename);
  145. extern void gCleanup(void *self);
  146. extern void gCloseCode(void *self);
  147. extern void gPrtAst(void *self, void *es, int flag);
  148. extern void *gGetRoot(void *self);
  149. extern int gEval(void *self, void *buf, double *result, void *es);
  150. #endif /* __OXCCCLASS__
  151.  
  152. #ifdef __cplusplus
  153. }
  154. #endif
  155.  
  156.