DCL 3.7.4
Loading...
Searching...
No Matches
DocSyntax.h
Go to the documentation of this file.
1#ifndef __DOC_SYNTAX_H__
2#define __DOC_SYNTAX_H__ 20031212
3
4#ifndef __DCL_OBJECT_H__
5#include <dcl/Object.h>
6#endif
7#ifndef __DCL_STRING_H__
8#include <dcl/String.h>
9#endif
10#ifndef __DCL_ARRAY_H__
11#include <dcl/Array.h>
12#endif
13
14__DCL_BEGIN_NAMESPACE
15
16class DocParser;
17
18class DocSyntax : public Object
19{
20protected:
23
33
34 friend class DocParser;
35public:
36 DocSyntax(const String& strLanguageTitle, const String& strExtensions);
37 virtual ~DocSyntax();
38
39 bool load(const wchar_t* pszFileName);
40
41 bool isValidLanguage(const wchar_t* pszLanguageTitle);
42 bool isValidExtension(const wchar_t* pszFileExt) const; // 유효한 파일 확장자 ?
43
44 bool isDelimeter(wchar_t c) const;
45 bool isQuotation(wchar_t c) const;
46 bool isEscapeChar(wchar_t c) const;
47 bool isLineComment(const wchar_t* pch, size_t nLength) const;
48 bool isCommentOn(const wchar_t* pch, size_t nLength) const;
49 bool isCommentChar(wchar_t c) const;
50 bool isCommentOff(const wchar_t* pch, size_t nLength) const;
51 bool isReservedWord(const wchar_t* pch, size_t nLength) const;
52
53 const String& languageTitle() const;
54 int tabWidth() const;
55};
56
57inline bool DocSyntax::isDelimeter(wchar_t c) const
58{
59 return __strDelimeters.indexOf(c) != (size_t)-1;
60}
61
62inline bool DocSyntax::isQuotation(wchar_t c) const
63{
64 return __strQuotations.indexOf(c) != (size_t)-1;
65}
66
67inline bool DocSyntax::isCommentChar(wchar_t c) const
68{
69 return __strLineComment.indexOf(c) != (size_t)-1
70 || __strCommentOn.indexOf(c) != (size_t)-1
71 || __strCommentOff.indexOf(c) != (size_t)-1;
72}
73
74inline bool DocSyntax::isEscapeChar(wchar_t c) const
75{
76 return __strEscapeChars.indexOf(c) != (size_t)-1;
77}
78
79inline const String& DocSyntax::languageTitle() const
80{
81 return __strLanguageTitle;
82}
83
84inline bool DocSyntax::isValidLanguage(const wchar_t* pszLanguageTitle)
85{
86 return __strLanguageTitle.compareNoCase(pszLanguageTitle) == 0;
87}
88
89inline int DocSyntax::tabWidth() const
90{
91 return __nTabWidth;
92}
93
94__DCL_END_NAMESPACE
95
96#endif // __DOC_SYNTAX_H__
bool isReservedWord(const wchar_t *pch, size_t nLength) const
int __nTabWidth
Definition DocSyntax.h:31
StringArray __listReservedWords
Definition DocSyntax.h:32
String __strEscapeChars
Definition DocSyntax.h:29
bool isCommentChar(wchar_t c) const
Definition DocSyntax.h:67
friend class DocParser
Definition DocSyntax.h:34
int tabWidth() const
Definition DocSyntax.h:89
bool isCommentOff(const wchar_t *pch, size_t nLength) const
Definition DocSyntax.cpp:94
bool load(const wchar_t *pszFileName)
Definition DocSyntax.cpp:36
virtual ~DocSyntax()
Definition DocSyntax.cpp:24
const String & languageTitle() const
Definition DocSyntax.h:79
bool isValidExtension(const wchar_t *pszFileExt) const
Definition DocSyntax.cpp:67
bool isQuotation(wchar_t c) const
Definition DocSyntax.h:62
bool isValidLanguage(const wchar_t *pszLanguageTitle)
Definition DocSyntax.h:84
bool isLineComment(const wchar_t *pch, size_t nLength) const
Definition DocSyntax.cpp:78
bool __bCaseSensitive
Definition DocSyntax.h:30
DocSyntax(const String &strLanguageTitle, const String &strExtensions)
Definition DocSyntax.cpp:18
String __strLineComment
Definition DocSyntax.h:26
bool isEscapeChar(wchar_t c) const
Definition DocSyntax.h:74
String __strCommentOff
Definition DocSyntax.h:28
bool isCommentOn(const wchar_t *pch, size_t nLength) const
Definition DocSyntax.cpp:86
String __strLanguageTitle
Definition DocSyntax.h:21
String __strDelimeters
Definition DocSyntax.h:24
StringArray __listFileExtensions
Definition DocSyntax.h:22
String __strQuotations
Definition DocSyntax.h:25
String __strCommentOn
Definition DocSyntax.h:27
bool isDelimeter(wchar_t c) const
Definition DocSyntax.h:57
Object()
Definition Object.cpp:183