home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume3 / texchk / part1 / texchk.h < prev   
Encoding:
C/C++ Source or Header  |  1986-11-30  |  1.5 KB  |  61 lines

  1. /* these are the types of tokens we look for in the input text */
  2.  
  3. typedef enum { 
  4.         
  5.         ESCAPE_BEGIN, ESCAPE_END, ESCAPE_ANY,
  6.         LEFT_SQUARE_BRACKET, RIGHT_SQUARE_BRACKET,
  7.         LEFT_CURLY_BRACKET, RIGHT_CURLY_BRACKET,
  8.         MATH, DOUBLE_MATH, ESCAPE_SINGLE_CHAR
  9.  
  10.     } envtype;
  11.  
  12. /* some of the input tokens cause the LaTeX environment to be 'pushed' */
  13. /* following is the definition of the stack on which these tokens are stored */
  14.     
  15. typedef struct {
  16.    envtype etype;
  17.    char *keyword;
  18.    int linenum;
  19.  } Stack_Entry, *Ptr_Stack_Entry;
  20.  
  21. #define MAX_ENTRIES 10000
  22. #define MAX_KEYWORD_LENGTH 100
  23.  
  24. extern Stack_Entry Lex_Stack[];
  25. extern int Lex_TOS;
  26.  
  27. #define Stack_Empty (Lex_TOS < 0)
  28.  
  29. #define LCB '{'
  30. #define RCB '}'
  31. #define LSB '['
  32. #define RSB ']'
  33. #define MATH_CHAR '$'
  34. #define ESCAPE '\\'
  35. #define COMMENT '%'
  36.  
  37. #define ENDSTRING "end"
  38. #define BEGINSTRING "begin"
  39.  
  40. /* these are the possible actions we can take when we see a token. */
  41. /* the 'CHECK' action has not been implemented. */
  42.  
  43. typedef enum {POP,PUSH,CHECK_SINGLE,DOLLAR,DOLLAR_DOLLAR,CHECK} Actions;
  44.  
  45. /* we keep track of where we are in the text so we can print out nice */
  46. /* error messages */
  47.  
  48. extern long Current_Line, Current_Char;
  49. extern char Line_Buffer[];
  50. #define MAXLL 1024
  51.  
  52. extern Indent_Level;                    /* for verbose pretty print */
  53.  
  54. extern FILE *fp;
  55.  
  56. /* this is LaTeX's definition of whitespace */
  57.  
  58. #define ISWHITE(x) ((x) == ' ' || (x) == '\t')
  59.  
  60. #define SPACES_PER_INDENT_LEVEL 2
  61.