Leaked source code of windows server 2003
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.

81 lines
1.4 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. sqlparse.hxx
  5. Abstract:
  6. Author:
  7. Felix Wong [t-FelixW] 05-Nov-1996
  8. ++*/
  9. #ifndef _SQLPARSE_HXX
  10. #define _SQLPARSE_HXX
  11. #define MAXVAL 200
  12. typedef struct _sql_list {
  13. LPWSTR szSelect;
  14. struct _sql_list *pNext;
  15. } SQL_LIST, *LPSQL_LIST;
  16. class CSyntaxNode
  17. {
  18. public:
  19. CSyntaxNode();
  20. ~CSyntaxNode();
  21. void SetNode(CSQLNode *pNode);
  22. void SetNode(LPWSTR szValue);
  23. void SetNode(DWORD dwFilterType);
  24. DWORD _dwToken;
  25. DWORD _dwState;
  26. DWORD _dwType;
  27. union {
  28. CSQLNode *_pSQLNode; // Put in after reduction
  29. LPWSTR _szValue; // dwToken == ATTRTYPE|ATTRVAL
  30. DWORD _dwFilterType; // reduction of FT
  31. };
  32. };
  33. enum snodetypes {
  34. SNODE_SZ,
  35. SNODE_SQLNODE,
  36. SNODE_FILTER,
  37. SNODE_NULL
  38. };
  39. class CStack
  40. {
  41. public:
  42. CStack();
  43. ~CStack();
  44. HRESULT Push(CSyntaxNode*);
  45. HRESULT Pop(CSyntaxNode**);
  46. HRESULT Pop();
  47. HRESULT Current(CSyntaxNode**);
  48. void Dump();
  49. private:
  50. DWORD _dwStackIndex;
  51. CSyntaxNode* _Stack[MAXVAL];
  52. };
  53. HRESULT SQLParse(
  54. LPWSTR szQuery,
  55. LPWSTR *pszLocation,
  56. LPWSTR *pszLDAPQuery,
  57. LPWSTR *pszSelect,
  58. LPWSTR *ppszOrderList
  59. );
  60. #endif