Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.3 KiB

  1. // re2fsa.h
  2. // Angshuman Guha
  3. // aguha
  4. // Nov 30, 2000
  5. #ifndef __INC_RE2FSA_H
  6. #define __INC_RE2FSA_H
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. #define MAXLINE 1024
  11. #define MIN_TERMINAL 0
  12. #define MAX_TERMINAL 65535
  13. // the private use area of Unicode 3.0 is 0xE000 to 0xF8FF
  14. #define MIN_FACTOID_TERMINAL 0xE000
  15. #define TOKEN_EMPTY_STRING 0
  16. #define TOKEN_END_MARKER 1
  17. #define TOKEN_UNDEFINED 2
  18. #define TOKEN_NONE 3
  19. #define MIN_OPERATOR 65536
  20. #define MAX_OPERATOR 65600
  21. #define OPERATOR_EQUALS (MIN_OPERATOR)
  22. #define OPERATOR_CAT (MIN_OPERATOR+1)
  23. #define OPERATOR_OR (MIN_OPERATOR+2)
  24. #define OPERATOR_ZERO (MIN_OPERATOR+3)
  25. #define OPERATOR_OPTIONAL (MIN_OPERATOR+4)
  26. #define OPERATOR_ONE (MIN_OPERATOR+5)
  27. #define OPERATOR_LPAREN (MIN_OPERATOR+6)
  28. #define OPERATOR_RPAREN (MIN_OPERATOR+7)
  29. #define OPERATOR_LBRACKET (MIN_OPERATOR+8)
  30. #define OPERATOR_RBRACKET (MIN_OPERATOR+9)
  31. #define OPERATOR_STOP (MIN_OPERATOR+10)
  32. #define MIN_NONTERMINAL 65601
  33. #define MAX_NONTERMINAL 0x7FFFFFFF
  34. #define WCHAR2Terminal(wch) ((int)wch)
  35. #define IsOperator(x) (((x) >= MIN_OPERATOR) && ((x) <= MAX_OPERATOR))
  36. #define IsUnaryOperator(x) (((x)==OPERATOR_ZERO)||((x)==OPERATOR_ONE)||((x)==OPERATOR_OPTIONAL))
  37. #define IsBinaryOperator(x) (((x)==OPERATOR_CAT)||((x)==OPERATOR_OR))
  38. #define IsNonterminal(x) (((x) >= MIN_NONTERMINAL) && ((x) <= MAX_NONTERMINAL))
  39. #define IsTerminal(x) (((x) >= MIN_TERMINAL) && ((x) <= MAX_TERMINAL))
  40. #define CHARCONST_EQUALS L'='
  41. #define CHARCONST_CAT L'.'
  42. #define CHARCONST_OR L'|'
  43. #define CHARCONST_ZERO L'*'
  44. #define CHARCONST_OPTIONAL L'?'
  45. #define CHARCONST_ONE L'+'
  46. #define CHARCONST_LPAREN L'('
  47. #define CHARCONST_RPAREN L')'
  48. #define CHARCONST_LBRACKET L'['
  49. #define CHARCONST_RBRACKET L']'
  50. #define CHARCONST_COMMENT L'#'
  51. #define CHARCONST_STOP L';'
  52. #define CHARCONST_STRING L'"'
  53. #define CHARCONST_UNDERSCORE L'_'
  54. #define CHARCONST_ESCAPE L'\\'
  55. void SetErrorMsgS(char *sz);
  56. void SetErrorMsgSD(char *sz, int x);
  57. void SetErrorMsgSS(char *sz, char *sz1);
  58. void SetErrorMsgSDD(char *sz, int x, int y);
  59. BOOL IsErrorMsgSet(void);
  60. #if defined(DEBUG_OUTPUT) && defined(_CONSOLE)
  61. #define DebugOutput1(x) fprintf(stderr, x)
  62. #define DebugOutput2(x, y) fprintf(stderr, x, y)
  63. #else
  64. #define DebugOutput1(x)
  65. #define DebugOutput2(x, y)
  66. #endif
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. #endif