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.

71 lines
1.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1999.
  5. //
  6. // File: YYBase.hxx
  7. //
  8. // Contents: Custom base class for YYPARSER
  9. //
  10. // History: 30-Nov-1999 KyleP Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #pragma once
  14. #include "mssql.h"
  15. class CImpIParserSession;
  16. class CImpIParserTreeProperties;
  17. class YYLEXER;
  18. //+---------------------------------------------------------------------------
  19. //
  20. // Class: CYYBase
  21. //
  22. // Purpose: Custom base class for BYACC-based parser. Encapsulates
  23. // Tripoli-specific features and data members.
  24. //
  25. // History: 30-Nov-1999 KyleP Created
  26. //
  27. //----------------------------------------------------------------------------
  28. class CYYBase
  29. {
  30. public:
  31. CYYBase( CImpIParserSession* pParserSession,
  32. CImpIParserTreeProperties* pParserTreeProperties,
  33. YYLEXER & yylex );
  34. ~CYYBase();
  35. //
  36. // Members used in YYPARSER
  37. //
  38. HRESULT CoerceScalar(DBTYPE dbTypeExpected, DBCOMMANDTREE** ppct);
  39. //
  40. // Lexer pass-through
  41. //
  42. void yyprimebuffer(YY_CHAR *pszBuffer);
  43. void yyprimelexer(int eToken);
  44. protected:
  45. void yyerror( char const * szError );
  46. YYLEXER & m_yylex;
  47. CImpIParserSession* m_pIPSession;
  48. CImpIParserTreeProperties * m_pIPTProperties;
  49. void Trace(TCHAR *message);
  50. void Trace(TCHAR *message, const TCHAR *tokname, short state = 0);
  51. void Trace(TCHAR *message, int state, short tostate = 0, short token = 0);
  52. friend class YYLEXER;
  53. };