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.

105 lines
3.3 KiB

  1. /*++
  2. // Copyright (c) 1995-2001 Microsoft Corporation, All Rights Reserved
  3. Module Name:
  4. UMIPATHLEX.CPP
  5. Abstract:
  6. Object Path Lexer Map (for use with GENLEX.CPP).
  7. History:
  8. 3-Mar-00 Created.
  9. --*/
  10. #include "precomp.h"
  11. #include <stdio.h>
  12. #include <genlex.h>
  13. #include <umipathlex.h>
  14. #define ST_IDENT 17
  15. #define ST_IDENT_ESC 22
  16. #define ST_SERVER 28
  17. // DFA State Table for Object Path tokens.
  18. // =======================================
  19. LexEl UMIPath_LexTable[] =
  20. {
  21. // State First Last New state, Return tok, Instructions
  22. // =======================================================================
  23. /* 0 */ L',', GLEX_EMPTY, 0, UMIPATH_TOK_COMMA, GLEX_ACCEPT,
  24. /* 1 */ L'.', GLEX_EMPTY, 0, UMIPATH_TOK_DOT, GLEX_ACCEPT,
  25. /* 2 */ L'=', GLEX_EMPTY, 0, UMIPATH_TOK_EQ, GLEX_ACCEPT,
  26. /* 3 */ L'/', GLEX_EMPTY, 0, UMIPATH_TOK_FORWARDSLASH, GLEX_ACCEPT,
  27. // White space characters
  28. /* 4 */ L' ', GLEX_EMPTY, 0, UMIPATH_TOK_ERROR, GLEX_ACCEPT|GLEX_RETURN,
  29. /* 5 */ L'\t', GLEX_EMPTY, 0, UMIPATH_TOK_ERROR, GLEX_ACCEPT|GLEX_RETURN,
  30. /* 6 */ L'\n', GLEX_EMPTY, 0, UMIPATH_TOK_ERROR, GLEX_ACCEPT|GLEX_RETURN,
  31. /* 7 */ L'\r', GLEX_EMPTY, 0, UMIPATH_TOK_ERROR, GLEX_ACCEPT|GLEX_RETURN,
  32. /* 8 */ L'[', GLEX_EMPTY, ST_SERVER, 0, GLEX_ACCEPT,
  33. /* 9 */ L'@', GLEX_EMPTY, 0, UMIPATH_TOK_SINGLETON_SYM, GLEX_ACCEPT,
  34. // -------------------------------------------------------------
  35. // Identifiers
  36. /* 10 */ L'!', 0xfffd, ST_IDENT, 0, GLEX_ACCEPT,
  37. /* 11*/ 0x80, 0xfffd, ST_IDENT, 0, GLEX_ACCEPT,
  38. /* 12 */ L'_', GLEX_EMPTY, ST_IDENT, 0, GLEX_ACCEPT,
  39. /* 13 */ L'0', L'9', ST_IDENT, 0, GLEX_ACCEPT,
  40. /* 14 */ L'-', GLEX_EMPTY, ST_IDENT, 0, GLEX_ACCEPT,
  41. /* 15 */ 0, GLEX_EMPTY, 0, UMIPATH_TOK_EOF, GLEX_CONSUME|GLEX_RETURN, // Note forced return
  42. // anything else is an error
  43. /* 16 */ GLEX_ANY, GLEX_EMPTY, 0, UMIPATH_TOK_ERROR, GLEX_ACCEPT|GLEX_RETURN,
  44. // -------------------------------------------------------------
  45. // ST_IDENT
  46. // Accepts C/C++ identifiers, plus any char >= U+0080. Note that
  47. // we bail out if ,=/or .
  48. /* 17 */ L' ', L'+', ST_IDENT, 0, GLEX_ACCEPT,
  49. /* 18 */ L'-', GLEX_EMPTY, ST_IDENT, 0, GLEX_ACCEPT,
  50. /* 19 */ L'0', L'<', ST_IDENT, 0, GLEX_ACCEPT,
  51. /* 20 */ L'>', 0xfffd, ST_IDENT, 0, GLEX_ACCEPT,
  52. /* 21 */ GLEX_ANY, GLEX_EMPTY, 0, UMIPATH_TOK_IDENT, GLEX_PUSHBACK|GLEX_RETURN,
  53. /* 22 */ L'\\', GLEX_EMPTY, ST_IDENT, 0, GLEX_ACCEPT,
  54. /* 23 */ L'.', GLEX_EMPTY, ST_IDENT, 0, GLEX_ACCEPT,
  55. /* 24 */ L'/', GLEX_EMPTY, ST_IDENT, 0, GLEX_ACCEPT,
  56. /* 25 */ L'=', GLEX_EMPTY, ST_IDENT, 0, GLEX_ACCEPT,
  57. /* 26 */ L',', GLEX_EMPTY, ST_IDENT, 0, GLEX_ACCEPT,
  58. /* 27 */ GLEX_ANY, GLEX_EMPTY, 0, UMIPATH_TOK_ERROR, GLEX_ACCEPT|GLEX_RETURN,
  59. // -------------------------------------------------------------
  60. // ST_DQ_SERVER
  61. //
  62. // A server begins with '[' and ends with ']'.
  63. /* 28*/ L']', GLEX_EMPTY, 0, UMIPATH_TOK_SERVERNAME, GLEX_ACCEPT,
  64. /* 29*/ L']', GLEX_EMPTY, ST_SERVER, 0, GLEX_ACCEPT|GLEX_NOT,
  65. };