source: dev/trunk/ab5.0/abdev/abdev/include/WindowComponents/CodeEditor/Syntax.h @ 681

Last change on this file since 681 was 681, checked in by dai_9181, 15 years ago

・TinyXMLをabdevプロジェクトで使えるようにした。
・コードハイライターを汎用的に実装しなおした。syntaxファイルを読み込む仕様とした。

File size: 1.2 KB
Line 
1#pragma once
2
3namespace ActiveBasic{ namespace IDE{ namespace WindowComponents{ namespace CodeEditor{
4
5
6struct ReservedKeywordWithQuickHelp
7{
8    std::string keyword;
9    std::string quickHelp;
10};
11typedef std::vector<ReservedKeywordWithQuickHelp> ReservedKeywordsWithQuickHelp;
12struct Syntax
13{
14    std::string commentSingle;
15    std::string commentMultiBegin;
16    std::string commentMultiEnd;
17    Jenga::Common::Strings quoteMarks;
18    Jenga::Common::Strings reservedSimpleKeywords;
19    ReservedKeywordsWithQuickHelp reservedKeywordsWithQuickHelp;
20};
21class Language
22{
23    std::string name;
24    Syntax syntax;
25public:
26    const std::string &GetName() const
27    {
28        return name;
29    }
30    const Syntax &GetSyntax() const
31    {
32        return syntax;
33    }
34
35    void Load( const TiXmlDocument &doc );
36    bool IsExistKeyword( const std::string &keyword ) const;
37    bool IsExistReservedKeywordWithQuickHelp( const std::string &keyword ) const;
38    const std::string &GetReservedKeywordWithQuickHelp( const std::string &keyword ) const;
39    bool IsQuoteMark( char c ) const;
40};
41class Languages
42    : public std::map<std::string, Language>
43{
44    void Add( const std::string &xmlPath );
45public:
46    void LoadFiles( const std::string &dirPath );
47};
48
49
50}}}}
Note: See TracBrowser for help on using the repository browser.