OSDN Git Service

全体の環境を表すenvironmentの追加。
[simplecms/utakata.git] / delimiter.h
1 #ifndef _DELIMITER_H_
2 #define _DELIMITER_H_
3
4 #include "utf8_string.h"
5 #include "smart_ptr.h"
6 #include "utf8.h"
7
8 namespace utakata {
9
10     namespace lexer_delimiter {
11     
12         //================================================================================
13         // 各デリミタを判別するための関数オブジェクト。
14         //================================================================================
15         
16         class Normal
17         {
18             // 通常のデリミタとして処理するべきデリミタ一覧を返す。
19         public:
20             bool operator()(const utakata::utf8_string::UTF8Char& ch);
21
22         };
23
24         class Whitespace
25         {
26             // 空白として認識される文字であるかどうかを返す。
27         public:
28             bool operator()(const utakata::utf8_string::UTF8Char& ch);
29         };
30
31         class LineEnding
32         {
33             // 改行と認識される文字であるかどうかを返す。
34             // 但し、次の文字も含め改行である場合があるため、
35             // まとめて調べるため、streamを必要とする。
36         public:
37             bool operator()(const utakata::utf8_string::UTF8Char& ch,
38                             smart_ptr<utf8::UTF8InputStream>& strm);
39         };
40
41         class String
42         {
43             // 文字列を分割するためのデリミタを定義する。
44         public:
45             bool operator()(const utakata::utf8_string::UTF8Char& ch);
46         };
47
48         class Prefix
49         {
50             // <number>のプレフィックスを調査する。
51         public:
52             bool operator()(const utakata::utf8_string::UTF8String& str);
53         };
54
55         class Exactness
56         {
57             // <number>の正確性を調査する。
58         public:
59             bool operator()(const utakata::utf8_string::UTF8String& str);
60         };
61
62         class HexValue
63         {
64             // 16進数で利用可能な文字の範囲であるかどうかを返す。
65         public:
66             bool operator()(const utakata::utf8_string::UTF8Char& ch);
67         };
68     };
69
70 };
71
72 #endif /* _DELIMITER_H_ */