home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / X_PROLOG.LZH / X_PROLOG / SOURCES / GLOBAL.H < prev    next >
C/C++ Source or Header  |  1990-08-13  |  3KB  |  114 lines

  1. /*
  2.  *        X PROLOG  Vers. 2.0
  3.  *
  4.  *
  5.  *    Written by :     Andreas Toenne
  6.  *            CS Dept. , IRB
  7.  *            University of Dortmund, W-Germany
  8.  *            <at@unido.uucp>
  9.  *            <....!seismo!unido!at>
  10.  *            <at@unido.bitnet>
  11.  *
  12.  *    Copyright :    This software is copyrighted by Andreas Toenne.
  13.  *            Permission is granted hereby to copy the entire
  14.  *            package including this copyright notice without fee.
  15.  *
  16.  */
  17.  
  18. /* global stack (env, backlog, frame) */
  19.  
  20. char *stack;            /* pointer to the stack */
  21. char *stacktop;
  22. char *stackfull;        /* hightide */
  23.  
  24. /* backtrack stack */
  25.  
  26. backlog    *Backpoint;        /* the topmost backtrack point */
  27.  
  28. /* enviroment stack */
  29.  
  30. env    *Topenv;        /* the topmost enviroment */
  31. env    *Preenv;        /* the previous enviroment */
  32.  
  33. /* prototyp stack(area) */
  34.  
  35. char     *protostack;        /* the prototypes stack */
  36. term     *prototop;        /* the current top element */
  37. term    *protonext;        /* the next to be used element */
  38. char     *protofull;        /* the highest element */
  39. term    *protofree[MAXARGS+1];    /* list of free terms */
  40.  
  41. /* copyterm stack */
  42.  
  43. char     *copystack;        /* the copystack */
  44. term     *copytop;        /* the current top element */
  45. term    *copynext;        /* the next to be used element */
  46. char     *copyfull;        /* the highest element */
  47.  
  48. /* trail stack */
  49.  
  50. term    **trailstack;        /* the stack base */
  51. long    trailtop;        /* the index of the next free element */
  52. long    trailfull;        /* the highest possible index */
  53.  
  54. /* clause area */
  55.  
  56. clause    *clausesp;        /* room for clauses */
  57. clause    *clausefree;        /* pointer to next free clause */
  58. long    clausefull;        /* max. count of clauses */
  59. clause     *clausenext;
  60.  
  61. /* functor area */
  62.  
  63. char  *functorsp;        /* room for functors */
  64. char  *functorfull;
  65. char  *functornext;        /* next functor */
  66.  
  67. functor *functors = (functor *)NULL;    /* the root of the AVL tree */
  68.  
  69. /* io data */
  70.  
  71. stream     streams[MAXSTREAMS];    /* list of open streams */
  72. stream    *in;            /* current input stream */
  73. stream    *out;            /* current output stream */
  74.  
  75. /* standard data */
  76.  
  77. functor    *stdfunctor[STDFUNCTORS];    /* list of standard functors */
  78.  
  79. /* error values */
  80.  
  81. short c_errno = 0;        /* the number of the last soft error */
  82. short io_errors = 1;        /* signal io errors ? */
  83.  
  84. /* enviroment data (from executing shell) */
  85.  
  86. char *shell;            /* the path of the default shell */
  87. char **enviroment;        /* the program's enviroment */
  88.  
  89. /* reader data */
  90.  
  91. lookup    l_table[MAXVARS];    /* the lookup table */
  92. short     tide;            /* end-of-table */
  93. char     line[MAXLINE];        /* buffer for the current line */
  94. char     name[MAXNAME];        /* temp. name space */
  95. char    *p;            /* pointer to current character */
  96. char     c;            /* the current character */
  97. char     lastc;            /* low io */
  98. short    c_type;            /* the type of the current character */
  99. char    *token;            /* the currently read token */
  100. short    token_type;        /* it's type */
  101. short    valid_token;        /* token is unused */
  102.  
  103. term *prompt;            /* the prompt */
  104.  
  105. /* misc data */
  106.  
  107. short dodebug;
  108. #ifdef ATARI
  109. long s_time;            /* timer tic at prolog's start */
  110. #endif
  111. long  abortpoint[3];        /* save point of abort */
  112. short booting;            /* true while booting */
  113. long lastconsult;        /* last consulted clause */
  114.