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.

75 lines
1.3 KiB

  1. // IParser.h: interface for the CIParser class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_IPARSER_H__9B59D69E_2002_40CC_B4CE_0EC32DE6F0E8__INCLUDED_)
  5. #define AFX_IPARSER_H__9B59D69E_2002_40CC_B4CE_0EC32DE6F0E8__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. class CIParser
  10. {
  11. public:
  12. CIParser(CString& Source);
  13. virtual ~CIParser();
  14. private:
  15. CString m_Source;
  16. public:
  17. CString TemplateBitmapName;
  18. private:
  19. void LexAnalyse();
  20. bool isNameOrNumber(TCHAR c)
  21. {
  22. return isName(c) || isNumber(c);
  23. }
  24. bool isName(TCHAR c)
  25. {
  26. return (c >= _T('a') && c <= _T('z'))
  27. || (c >= _T('A') && c <= _T('Z'))
  28. || (c == _T('_'));
  29. }
  30. bool isNumber(TCHAR c)
  31. {
  32. return c >= _T('0') && c <= _T('9');
  33. }
  34. bool isWhiteSpace(TCHAR c)
  35. {
  36. return c == L' ' || c == L'\t';
  37. }
  38. bool isEndl(TCHAR c)
  39. {
  40. return c == L'\n' || c == L'\r';
  41. }
  42. bool isSeparator(TCHAR c)
  43. {
  44. return c == _T(',');
  45. }
  46. bool isHochKomma(TCHAR c)
  47. {
  48. return c == _T('\'') || c == _T('\"');
  49. }
  50. bool isHTMLopenBracket(TCHAR c)
  51. {
  52. return c == _T('<');
  53. }
  54. bool isHTMLclosingBracket(TCHAR c)
  55. {
  56. return c == _T('>');
  57. }
  58. };
  59. #endif // !defined(AFX_IPARSER_H__9B59D69E_2002_40CC_B4CE_0EC32DE6F0E8__INCLUDED_)