Syntax.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. // Syntax.h
  2. enum {
  3. COLORINDEX_COMMENT,
  4. COLORINDEX_SYNTAX,
  5. COLORINDEX_NORMAL,
  6. COLORINDEX_NUMBER,
  7. COLORINDEX_STRING,
  8. COLORINDEX_CHAR,
  9. COLORINDEX_BK,
  10. COLORINDEX_UNDERLINE,
  11. COLORINDEX_LINEEND,
  12. COLORINDEX_BKCURLINE,
  13. COLORINDEX_LINNUMBERBKCOLOR,
  14. COLORINDEX_LINNUMBERNORMAL,
  15. COLORINDEX_CURLINNUMBER,
  16. COLORINDEX_LINNUMBERSEP,
  17. COLORINDEX_CROSS,
  18. COLORINDEX_TAB,
  19. COLORINDEX_SPACE,
  20. COLORINDEX_BKSELTEXT,
  21. };
  22. enum {
  23. _ADA,
  24. _AML,
  25. _ASM,
  26. _BASIC,
  27. _BATCH,
  28. _BLUE,
  29. _CLIPPER,
  30. _COBOL,
  31. _CPP,
  32. _CSHAPE,
  33. _DATAFLEX,
  34. _EIFFEL,
  35. _FORTRAN,
  36. _HLBL,
  37. _HTML,
  38. _INI,
  39. _JAVA,
  40. _JSP,
  41. _LIMBO,
  42. _LISP,
  43. _MODULA2,
  44. _OBJECTPASCAL,
  45. _PARADOX,
  46. _PERL,
  47. _PHP,
  48. _PL1,
  49. _PROGRESS,
  50. _PYTHON,
  51. _REBOL,
  52. _REXX,
  53. _RUBY,
  54. _SMALLTALK,
  55. _SQL,
  56. _VHDL,
  57. _XML
  58. };
  59. #define COOKIE_COMMENT 0x0002
  60. #define COOKIE_EXT_COMMENT 0x0004
  61. #define COOKIE_STRING 0x0010
  62. #define COOKIE_CHAR 0x0020
  63. #define COOKIE_SCRIPT 0x0040 //For Html Parser
  64. #define COOKIE_TAG 0x0080 //For Html Parser
  65. //¶¨ÒåÑÕÉ«¿éºê
  66. #define DEFINE_BLOCK(pos, color) \
  67. ASSERT((pos) >= 0 && (pos) <= nLength);\
  68. if (ColorInfo != NULL)\
  69. {\
  70. if (nActualItems == 0 || ColorInfo[nActualItems - 1].Pos <= (pos)) {\
  71. ColorInfo[nActualItems].Pos = (pos);\
  72. ColorInfo[nActualItems].Color = (color);\
  73. nActualItems ++;\
  74. }\
  75. }
  76. struct COLORINFO {
  77. int Pos;
  78. int Color;
  79. };
  80. void SetCurLanguage(int nLanguage);
  81. void LoadSynWord(CStringArray &m_strArrayKeyWords, int nLanguage);
  82. BOOL IsSynWord(CStringArray &m_strArrayKeyWords, CString &strReadyToTest);
  83. BOOL IsNumber(CString &strReadyToTest);
  84. void SortSynWordArray(CStringArray &m_strArrayKeyWords);
  85. DWORD ParseLine(CStringArray &m_strArrayKeyWords, DWORD dwCookie, CString &strLine, COLORINFO *ColorInfo, int &nActualItems);
  86. DWORD ParseLineForHtml(CStringArray &m_strArrayKeyWords, DWORD dwCookie, CString &strLine, COLORINFO *ColorInfo, int &nActualItems);
  87. void LoadParseRule(int nlanguage);
  88. CString GetLanguageString(int nlanguage);
  89. void DeleteAllocString();
  90. CString GetLineCommentString(int nlanguage);
  91. int GetLanguageByStringShow(CString strlanguage);
  92. CString GetStringShowByLanguage(int nlanguage);