home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / lr.zip / VOID.INC < prev    next >
Text File  |  1993-05-15  |  2KB  |  57 lines

  1. /*
  2. _____________________________________________________________
  3. Void language structures
  4. Philip R Brenan,  Transcendental Automation,  1992,  800-FOR-PHIL
  5. _____________________________________________________________
  6. */
  7. #ifndef VOID_INC
  8. #define VOID_INC
  9.  
  10. #include <stdio.h>
  11. #include "x.inc"
  12. #include "m.inc"
  13.  
  14. #define void_print_width 80
  15. /*
  16. _____________________________________________________________
  17. Void language structures
  18. _____________________________________________________________
  19. */
  20. typedef struct VOID_PARSE
  21.  {XL     ITEM;           // List of items generated by this parse
  22.   M     *m;              // Memory used by this parse
  23.   char  *s;              // String to be parsed
  24.   struct VOID_ITEM *top; //Top most item
  25.   XT     INDEX;          // Items index
  26.   long   lines;          // Number of lines in source
  27.  
  28.   struct VOID_ERRORS     // Errors
  29.    {int  count;          // Number of errors detected
  30.     int  required;       // Closing parentheses required
  31.     int  ignored;        // Closing parenthesis ignored
  32.     char*ignored_text;   // First closing parenthesis ignored position
  33.     int  quote;          // Number of closing quotes assummed
  34.     char*quote_text;     // First closing quote assumed text position
  35.    } errors;
  36.  } VOID_PARSE;
  37.  
  38. typedef struct VOID_ITEM
  39.  {XL ITEM;          // Sub items associated with this item
  40.   Xl item;          // This item
  41.   char *s, *e, *f;  // Start, end, and finish of text associated with this item
  42.   char *k;          // Key of this item after editting
  43.   long line_number; // Source line number for this item
  44.   VOID_PARSE *V;    // Parse containing this item
  45.  } VOID_ITEM;
  46. /*
  47. _____________________________________________________________
  48. Void language procedures
  49. _____________________________________________________________
  50. */
  51. VOID_PARSE *void_parse      (char *c);
  52. void        void_free       (VOID_PARSE *V);
  53. VOID_ITEM  *void_find       (VOID_ITEM  *v, char *k);
  54. VOID_PARSE *void_print      (VOID_PARSE *V, FILE *f);
  55. void        void_test       (void);
  56.  
  57. #endif