OSDN Git Service

smart_ptrの使いかたを、const 〜&ではなく値渡しで渡すように全体を変更。
[simplecms/utakata.git] / lexeme.h
1 #ifndef _LEXEME_H_
2 #define _LEXEME_H_
3
4 #include "smart_ptr.h"
5
6 namespace utakata {
7
8     namespace utf8_string {
9         class UTF8String;
10     };
11
12     namespace literal {
13     
14         struct LiteralData;
15     
16     };
17
18     namespace lexeme {
19
20         class LexemeID;
21         class ILexeme
22         {
23             // 非終端記号、及び終端記号を表すクラス。
24             // それぞれを取得するためのインターフェースはこれから派生して作成される。
25         public:
26             virtual ~ILexeme(){}
27
28             // 終端記号、非終端記号のIDを取得する。
29             virtual const LexemeID getID() const = 0;
30             
31             // stringのデータ型において、文字列を取得する。
32             virtual smart_ptr<utakata::utf8_string::UTF8String> toString() const = 0;
33   
34             // リテラルとして扱うためのデータを取得する。各リテラルのうち、
35             // lexeme Datumとして扱うことができるデータについてはこれらとなる。
36             virtual smart_ptr<literal::LiteralData> getData() const = 0;
37
38         };
39     };
40
41 };
42
43 #endif /* _LEXEME_H_ */