home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Tex / Tex29 / StTeXsrc.zoo / src / token.h < prev    next >
C/C++ Source or Header  |  1988-03-13  |  2KB  |  83 lines

  1.  
  2. /*
  3.  * @(#)token.h 2.6 EPA
  4.  *
  5.  * Copyright 1987,1988 Pat J Monardo
  6.  *
  7.  * Redistribution of this file is permitted through
  8.  * the specifications in the file COPYING.
  9.  *
  10.  * 
  11.  */
  12.  
  13. global  tok     cur_tok;
  14. global  hword   cur_cmd;
  15. global  hword   cur_chr;
  16. global  ptr     cur_cs;
  17.  
  18. #define LEFT_BRACE_TOKEN    0400
  19. #define LEFT_BRACE_LIMIT    01000
  20. #define RIGHT_BRACE_TOKEN   01000
  21. #define RIGHT_BRACE_LIMIT   01400
  22. #define MATH_SHIFT_TOKEN    01400
  23. #define TAB_TOKEN           02000
  24. #define OUT_PARAM_TOKEN     02400
  25. #define SPACE_TOKEN         05040
  26. #define LETTER_TOKEN        05400
  27. #define OTHER_TOKEN         06000
  28. #define MATCH_TOKEN         06400
  29. #define END_MATCH_TOKEN     07000
  30. #define CS_TOKEN_FLAG       010000
  31. #define END_TEMPLATE_TOKEN  (CS_TOKEN_FLAG + FROZEN_END_TEMPLATE)
  32.  
  33. #define NO_EXPAND_FLAG      257
  34.  
  35. global  ptr     par_loc;
  36. global  tok     par_token;
  37. global  bool    force_eof;
  38.  
  39. #define token(T)        tok_mem[T]
  40. #define token_link(T)   tok_link[T]
  41.  
  42. global  tok     tok_mem[];
  43. global  ptr     tok_link[];
  44. global  ptr     tok_head;
  45. global  ptr     tok_low;
  46. global  ptr     tok_end;
  47. global  int     tok_used;
  48.  
  49. #define temp_toks       TOK_TOP
  50. #define align_tokens    (TOK_TOP - 1)
  51. #define omit_template   (TOK_TOP - 2)
  52. #define null_list       (TOK_TOP - 3)
  53. #define backup_tokens   (TOK_TOP - 4)
  54. #define tok_high        (TOK_TOP - 4)
  55. #define tok_usage       5
  56.  
  57. #ifdef  STAT
  58. #define fast_new_token(T) \
  59.     {T = tok_head; \
  60.     if (T == NULL) T = new_token(); \
  61.     else {tok_head = token_link(T); token_link(T) = NULL; incr(tok_used);}}
  62. #else
  63. #define fast_new_token(T) \
  64.     {T = tok_head; \
  65.     if (T == NULL) T = new_token(); \
  66.     else {tok_head = token_link(T); token_link(T) = NULL;}}
  67. #endif
  68.  
  69. int     get_token();
  70. int     get_next();
  71. ptr     new_token();
  72.  
  73. #ifdef STAT
  74. #define free_token(T) \
  75.     {token_link(T) = tok_head; tok_head = T; decr(tok_used);}
  76. #else
  77. #define free_token(T) \
  78.     {token_link(T) = tok_head; tok_head = T;}
  79. #endif
  80.  
  81. int     check_outer_validity();
  82. int     firm_up_the_line();
  83.