home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / p / p2c.zip / P2C.H < prev    next >
C/C++ Source or Header  |  1987-03-27  |  1KB  |  37 lines

  1. /*---- p2c.h ------------------------------------------------------
  2. Defines and Global Variable for the Pascal to C translator
  3. 3/25/87 Daniel Kegel (seismo!rochester!srs!dan)
  4. -------------------------------------------------------------------*/
  5.  
  6. #define MAXTOKLEN 2048    /* maximum token length */
  7.     /* Note: even comments are jammed into a token; that's why this is big. */
  8.  
  9. typedef struct {    /* holds keywords, operators, etc. */
  10.     char str[MAXTOKLEN];
  11.     int kind;        /* code from table of wnodes */
  12. } token;
  13.  
  14. typedef struct {
  15.   int  ktype;        /* the meaning of the keyword */
  16.   char *pname;        /* the Pascal name of the keyword */
  17.   char *cname;        /* the C      name of the keyword */
  18. } wnode;
  19.  
  20.     /* Allocate or Reallocate n 'type' items */
  21. #define MALLOC(type, n) \
  22.     ((type *) DoMalloc((unsigned) sizeof(type) * (n)))
  23. #define REALLOC(ptr, type, n) \
  24.     ((type *) DoRealloc((char *)ptr, (unsigned) sizeof(type) * (n)))
  25.  
  26. #ifndef TRUE
  27. #define TRUE 1
  28. #define FALSE 0
  29. #endif
  30. #ifndef boolean
  31. #define boolean int
  32. #endif
  33.  
  34. /*--- The Global Variable ---------*/
  35. token cTok;        /* current token from scanner */
  36.  
  37.