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.

157 lines
6.2 KiB

  1. /*++
  2. Copyright (C) 1995-2001 Microsoft Corporation
  3. Module Name:
  4. QLLEX.CPP
  5. Abstract:
  6. QL Level 1 DFA Table
  7. History:
  8. raymcc 24-Jun-95 Created.
  9. --*/
  10. #include "precomp.h"
  11. #include <stdio.h>
  12. #include <genlex.h>
  13. #include <qllex.h>
  14. #define ST_STRING 24
  15. #define ST_IDENT 29
  16. #define ST_GE 35
  17. #define ST_LE 37
  18. #define ST_NE 40
  19. #define ST_NUMERIC 42
  20. #define ST_REAL 47
  21. #define ST_STRING2 53
  22. #define ST_STRING_ESC 58
  23. #define ST_STRING2_ESC 61
  24. #define ST_DOT 64
  25. #define ST_NEGATIVE_NUM 66
  26. #define ST_POSITIVE_NUM 69
  27. // DFA State Table for QL Level 1 lexical symbols.
  28. // ================================================
  29. LexEl Ql_1_LexTable[] =
  30. {
  31. // State First Last New state, Return tok, Instructions
  32. // =======================================================================
  33. /* 0 */ L'A', L'Z', ST_IDENT, 0, GLEX_ACCEPT,
  34. /* 1 */ L'a', L'z', ST_IDENT, 0, GLEX_ACCEPT,
  35. /* 2 */ L'_', GLEX_EMPTY, ST_IDENT, 0, GLEX_ACCEPT,
  36. /* 3 */ 0x80, 0xfffd, ST_IDENT, 0, GLEX_ACCEPT,
  37. /* 4 */ L'(', GLEX_EMPTY, 0, QL_1_TOK_OPEN_PAREN, GLEX_ACCEPT,
  38. /* 5 */ L')', GLEX_EMPTY, 0, QL_1_TOK_CLOSE_PAREN, GLEX_ACCEPT,
  39. /* 6 */ L'.', GLEX_EMPTY, ST_DOT, 0, GLEX_ACCEPT,
  40. /* 7 */ L'*', GLEX_EMPTY, 0, QL_1_TOK_ASTERISK, GLEX_ACCEPT,
  41. /* 8 */ L'=', GLEX_EMPTY, 0, QL_1_TOK_EQ, GLEX_ACCEPT,
  42. /* 9 */ L'>', GLEX_EMPTY, ST_GE, 0, GLEX_ACCEPT,
  43. /* 10 */ L'<', GLEX_EMPTY, ST_LE, 0, GLEX_ACCEPT,
  44. /* 11 */ L'0', L'9', ST_NUMERIC, 0, GLEX_ACCEPT,
  45. /* 12 */ L'"', GLEX_EMPTY, ST_STRING, 0, GLEX_CONSUME,
  46. /* 13 */ L'\'', GLEX_EMPTY, ST_STRING2, 0, GLEX_CONSUME,
  47. /* 14 */ L'!', GLEX_EMPTY, ST_NE, 0, GLEX_ACCEPT,
  48. /* 15 */ L'-', GLEX_EMPTY, ST_NEGATIVE_NUM, 0, GLEX_ACCEPT,
  49. // Whitespace, newlines, etc.
  50. /* 16 */ L' ', GLEX_EMPTY, 0, 0, GLEX_CONSUME,
  51. /* 17 */ L'\t', GLEX_EMPTY, 0, 0, GLEX_CONSUME,
  52. /* 18 */ L'\n', GLEX_EMPTY, 0, 0, GLEX_CONSUME|GLEX_LINEFEED,
  53. /* 19 */ L'\r', GLEX_EMPTY, 0, 0, GLEX_CONSUME,
  54. /* 20 */ 0, GLEX_EMPTY, 0, QL_1_TOK_EOF, GLEX_CONSUME|GLEX_RETURN, // Note forced return
  55. /* 21 */ L',', GLEX_EMPTY, 0, QL_1_TOK_COMMA, GLEX_ACCEPT,
  56. /* 22 */ L'+', GLEX_EMPTY, ST_POSITIVE_NUM, 0, GLEX_CONSUME,
  57. // Unknown characters
  58. /* 23 */ GLEX_ANY, GLEX_EMPTY, 0, QL_1_TOK_ERROR, GLEX_ACCEPT|GLEX_RETURN,
  59. // ST_STRING
  60. /* 24 */ L'\n', GLEX_EMPTY, 0, QL_1_TOK_ERROR, GLEX_ACCEPT|GLEX_LINEFEED,
  61. /* 25 */ L'\r', GLEX_EMPTY, 0, QL_1_TOK_ERROR, GLEX_ACCEPT|GLEX_LINEFEED,
  62. /* 26 */ L'"', GLEX_EMPTY, 0, QL_1_TOK_QSTRING, GLEX_CONSUME,
  63. /* 27 */ L'\\', GLEX_EMPTY, ST_STRING_ESC, 0, GLEX_CONSUME,
  64. /* 28 */ GLEX_ANY, GLEX_EMPTY, ST_STRING, 0, GLEX_ACCEPT,
  65. // ST_IDENT
  66. /* 29 */ L'a', L'z', ST_IDENT, 0, GLEX_ACCEPT,
  67. /* 30 */ L'A', L'Z', ST_IDENT, 0, GLEX_ACCEPT,
  68. /* 31 */ L'_', GLEX_EMPTY, ST_IDENT, 0, GLEX_ACCEPT,
  69. /* 32 */ L'0', L'9', ST_IDENT, 0, GLEX_ACCEPT,
  70. /* 33 */ 0x80, 0xfffd, ST_IDENT, 0, GLEX_ACCEPT,
  71. /* 34 */ GLEX_ANY, GLEX_EMPTY, 0, QL_1_TOK_IDENT, GLEX_PUSHBACK|GLEX_RETURN,
  72. // ST_GE
  73. /* 35 */ L'=', GLEX_EMPTY, 0, QL_1_TOK_GE, GLEX_ACCEPT,
  74. /* 36 */ GLEX_ANY, GLEX_EMPTY, 0, QL_1_TOK_GT, GLEX_PUSHBACK|GLEX_RETURN,
  75. // ST_LE
  76. /* 37 */ L'=', GLEX_EMPTY, 0, QL_1_TOK_LE, GLEX_ACCEPT,
  77. /* 38 */ L'>', GLEX_EMPTY, 0, QL_1_TOK_NE, GLEX_ACCEPT,
  78. /* 39 */ GLEX_ANY, GLEX_EMPTY, 0, QL_1_TOK_LT, GLEX_PUSHBACK|GLEX_RETURN,
  79. // ST_NE
  80. /* 40 */ L'=', GLEX_EMPTY, 0, QL_1_TOK_NE, GLEX_ACCEPT,
  81. /* 41 */ GLEX_ANY, GLEX_EMPTY, 0, QL_1_TOK_ERROR, GLEX_ACCEPT|GLEX_RETURN,
  82. // ST_NUMERIC
  83. /* 42 */ L'0', L'9', ST_NUMERIC, 0, GLEX_ACCEPT,
  84. /* 43 */ L'.', GLEX_EMPTY, ST_REAL, 0, GLEX_ACCEPT,
  85. /* 44 */ L'E', GLEX_EMPTY, ST_REAL, 0, GLEX_ACCEPT,
  86. /* 45 */ L'e', GLEX_EMPTY, ST_REAL, 0, GLEX_ACCEPT,
  87. /* 46 */ GLEX_ANY, GLEX_EMPTY, 0, QL_1_TOK_INT, GLEX_PUSHBACK|GLEX_RETURN,
  88. // ST_REAL
  89. /* 47 */ L'0', L'9', ST_REAL, 0, GLEX_ACCEPT,
  90. /* 48 */ L'E', GLEX_EMPTY, ST_REAL, 0, GLEX_ACCEPT,
  91. /* 49 */ L'e', GLEX_EMPTY, ST_REAL, 0, GLEX_ACCEPT,
  92. /* 50 */ L'+', GLEX_EMPTY, ST_REAL, 0, GLEX_ACCEPT,
  93. /* 51 */ L'-', GLEX_EMPTY, ST_REAL, 0, GLEX_ACCEPT,
  94. /* 52 */ GLEX_ANY, GLEX_EMPTY, 0, QL_1_TOK_REAL, GLEX_PUSHBACK|GLEX_RETURN,
  95. // ST_STRING2
  96. /* 53 */ L'\n', GLEX_EMPTY, 0, QL_1_TOK_ERROR, GLEX_ACCEPT|GLEX_LINEFEED,
  97. /* 54 */ L'\r', GLEX_EMPTY, 0, QL_1_TOK_ERROR, GLEX_ACCEPT|GLEX_LINEFEED,
  98. /* 55 */ L'\'', GLEX_EMPTY, 0, QL_1_TOK_QSTRING, GLEX_CONSUME,
  99. /* 56 */ L'\\', GLEX_EMPTY, ST_STRING2_ESC, 0, GLEX_CONSUME,
  100. /* 57 */ GLEX_ANY, GLEX_EMPTY, ST_STRING2, 0, GLEX_ACCEPT,
  101. // ST_STRING_ESC
  102. /* 58 */ L'"', GLEX_EMPTY, ST_STRING, 0, GLEX_ACCEPT,
  103. /* 59 */ L'\\', GLEX_EMPTY, ST_STRING, 0, GLEX_ACCEPT,
  104. /* 60 */ GLEX_ANY, GLEX_EMPTY, 0, QL_1_TOK_ERROR, GLEX_ACCEPT|GLEX_RETURN,
  105. // ST_STRING2_ESC
  106. /* 61 */ L'\'', GLEX_EMPTY, ST_STRING2, 0, GLEX_ACCEPT,
  107. /* 62 */ L'\\', GLEX_EMPTY, ST_STRING2, 0, GLEX_ACCEPT,
  108. /* 63 */ GLEX_ANY, GLEX_EMPTY, 0, QL_1_TOK_ERROR, GLEX_ACCEPT|GLEX_RETURN,
  109. // ST_DOT
  110. /* 64 */ L'0', L'9', ST_REAL, 0, GLEX_ACCEPT,
  111. /* 65 */ GLEX_ANY, GLEX_EMPTY, 0, QL_1_TOK_DOT, GLEX_PUSHBACK|GLEX_RETURN,
  112. // ST_NEGATIVE_NUM - Strips whitespace after '-'
  113. /* 66 */ L' ', GLEX_EMPTY, ST_NEGATIVE_NUM, 0, GLEX_CONSUME,
  114. /* 67 */ L'0', L'9', ST_NUMERIC, 0, GLEX_ACCEPT,
  115. /* 68 */ GLEX_ANY, GLEX_EMPTY, 0, QL_1_TOK_ERROR, GLEX_ACCEPT|GLEX_RETURN,
  116. // ST_POSITIVE_NUM - Strips whitespace after '+'
  117. /* 69 */ L' ', GLEX_EMPTY, ST_POSITIVE_NUM, 0, GLEX_CONSUME,
  118. /* 70 */ L'0', L'9', ST_NUMERIC, 0, GLEX_ACCEPT,
  119. /* 71 */ GLEX_ANY, GLEX_EMPTY, 0, QL_1_TOK_ERROR, GLEX_ACCEPT|GLEX_RETURN,
  120. };