home *** CD-ROM | disk | FTP | other *** search
/ Amiga Times / AmigaTimes.iso / programme / GoldED / developer / syntax / include / scanlib.h
Encoding:
C/C++ Source or Header  |  1998-10-06  |  3.4 KB  |  96 lines

  1. #ifndef GOLDED_SYNTAX_H
  2. #define GOLDED_SYNTAX_H
  3. /*
  4. **      $Filename: fd/Syntax.h
  5. **      $Release: 4
  6. **
  7. **      GoldED syntax scanner definitions.
  8. **
  9. **      (C) Copyright 1995-1996 Dietmar Eilert
  10. **          All Rights Reserved
  11. */
  12.  
  13. #ifndef GOLDED_API_H
  14. #include "golded:developer/golded/include/golded.h"
  15. #endif
  16.  
  17. #ifndef MAKE_ID
  18. #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
  19. #endif
  20.  
  21. #define PARSER_MAGIC MAKE_ID('G','E','D','4')
  22.  
  23. /* library base */
  24.  
  25. struct ParserBase {
  26.  
  27.     struct Library  Libary;                          /* standard library */
  28.     UWORD           pad;                             /* we are now longwod aligned */
  29.     ULONG           Magic;                           /* used to recognize scanner libraries */
  30. };
  31.  
  32. /* description of parser abilities */
  33.  
  34. struct ParserData {
  35.  
  36.     ULONG           pd_Release;                      /* version code of scanner interface (SCANLIBVERSION) */
  37.     ULONG           pd_Version;                      /* private release code of parser (optional) */
  38.     ULONG           pd_Serial;                       /* private serial code of parser  (optional) */
  39.     UBYTE          *pd_Info;                         /* short description */
  40.     UWORD           pd_Levels;                       /* syntax levels */
  41.     UBYTE         **pd_Names;                        /* syntax level descriptions (NULL terminated) */
  42.     ULONG          *pd_Colors;                       /* suggested colors (RGB 4 bits per gun right justified) */
  43.     BOOL            pd_Flags;                        /* ability flags (see below) */
  44.     UBYTE         **pd_Example;                      /* example text array (required) */
  45. };
  46.  
  47. #define MAKE_RGB4(r,g,b) ((ULONG) ((r) & 15)<<8 | (ULONG) ((g) & 15)<<4 | (ULONG) ((b) & 15))
  48.  
  49. /* ability flags */
  50.  
  51. #define SCPRB_CONFIGWIN     1L                       /* user configuration supported ? */
  52. #define SCPRF_CONFIGWIN    (1L<<SCPRB_CONFIGWIN)
  53.  
  54. #define SCPRB_SYNTAXCACHE   2L                       /* syntax cache used */
  55. #define SCPRF_SYNTAXCACHE  (1L<<SCPRB_SYNTAXCACHE)
  56.  
  57. #define SCPRB_CONTEXT       3L                       /* context scanner */
  58. #define SCPRF_CONTEXT      (1L<<SCPRB_CONTEXT)
  59.  
  60. #define SCANLIBVERSION 4                             /* GoldED 4+ required */
  61.  
  62. /* syntax chunk created by scanner */
  63.  
  64. struct SyntaxChunk {
  65.  
  66.     UWORD           sc_Start;                        /* column: start */
  67.     UWORD           sc_End;                          /* column: end   */
  68.     UWORD           sc_Level;                        /* syntax level  */
  69. };
  70.  
  71. /* scanner notification message passed to scanner */
  72.  
  73. struct ScannerNotify {
  74.  
  75.     ULONG           sn_Class;                        /* action class */
  76.     ULONG           sn_Code;                         /* action code */
  77.     ULONG           sn_Line;                         /* line of operation */
  78.     LONG            sn_Lines;                        /* lines affected by operation */
  79.     LONG            sn_Removed;                      /* lines removed during operation */
  80.     APTR            sn_Reserved;                     /* reserved (set to NULL) */
  81. };
  82.  
  83. /* action classes */
  84.  
  85. #define SCANNER_NOTIFY_MODIFIED 1L                   /* lines have been inserted, deleted or modified */
  86.  
  87. /* display refresh request issued by scanner */
  88.  
  89. struct RefreshRequest {
  90.  
  91.     ULONG           rr_Line;                         /* first line to be refreshed */
  92.     ULONG           rr_Lines;                        /* lines to be refreshed */
  93. };
  94.  
  95. #endif
  96.