#include "smart_ptr.h"
#include "utf8.h"
#include "lexeme.h"
-#include "utf8_string.h"
+#include "unicode.h"
namespace utakata {
private:
// lex関数中で利用される、雑多になった字句解析関数の分割
- smart_ptr<lexeme::ILexeme> lex_(const utakata::utf8_string::UTF8String& str,
+ smart_ptr<lexeme::ILexeme> lex_(const utakata::unicode::UniString& str,
smart_ptr<utakata::utf8::UTF8InputStream> stream,
smart_ptr<ISubLexer>& next);
private:
// 渡された文字列のspecを判定する。
- std::vector<unsigned char> parseCharSpec(const utf8_string::UTF8String& s);
+ std::vector<unsigned char> parseCharSpec(const unicode::UniString& s);
};
const unsigned char HEX;
public:
- NumberLexer(const utakata::utf8_string::UTF8String& str);
+ NumberLexer(const utakata::unicode::UniString& str);
virtual ~NumberLexer(){}
smart_ptr<lexeme::ILexeme> lex(smart_ptr<utakata::utf8::UTF8InputStream> stream,
smart_ptr<lexeme::ILexeme> innerLex_(smart_ptr<utakata::utf8::UTF8InputStream> stream,
smart_ptr<ISubLexer>& next,
- const utakata::utf8_string::UTF8String& str);
+ const utakata::unicode::UniString& str);
// 渡した文字列からprefixを抽出して返す。
- unsigned char getPrefix_(const utakata::utf8_string::UTF8String& str);
+ unsigned char getPrefix_(const utakata::unicode::UniString& str);
// 正確性を抽出して返す。
- void checkExactness_(const utakata::utf8_string::UTF8String& str);
+ void checkExactness_(const utakata::unicode::UniString& str);
private:
- smart_ptr<utakata::utf8_string::UTF8String> str_;
+ smart_ptr<utakata::unicode::UniString> str_;
bool exact_; // 正確性を設定する。
unsigned char prefix_; // prefixを設定する。
// を保存する必要すらない。
public:
- IdentifierLexer(const utakata::utf8_string::UTF8String& str);
+ IdentifierLexer(const utakata::unicode::UniString& str);
virtual ~IdentifierLexer(){}
smart_ptr<lexeme::ILexeme> lex(smart_ptr<utakata::utf8::UTF8InputStream> stream,
private:
- smart_ptr<utakata::utf8_string::UTF8String> str_;
+ smart_ptr<utakata::unicode::UniString> str_;
};
class BooleanLexer : public ISubLexer
// いずれかの次には、必ず区切り文字がなければならない。
public:
- BooleanLexer(const utakata::utf8_string::UTF8Char& ch);
+ BooleanLexer(const utakata::unicode::UniChar& ch);
virtual ~BooleanLexer(){}
smart_ptr<lexeme::ILexeme> lex(smart_ptr<utakata::utf8::UTF8InputStream> stream,
private:
- smart_ptr<utakata::utf8_string::UTF8Char> ch_;
+ smart_ptr<utakata::unicode::UniChar> ch_;
};
class ByteVectorLexer : public ISubLexer
// vu8ではない場合には、エラーとなる。
public:
- ByteVectorLexer(const utakata::utf8_string::UTF8Char& ch);
+ ByteVectorLexer(const utakata::unicode::UniChar& ch);
virtual ~ByteVectorLexer(){}
smart_ptr<lexeme::ILexeme> lex(smart_ptr<utakata::utf8::UTF8InputStream> stream,
private:
- smart_ptr<utakata::utf8_string::UTF8Char> ch_;
+ smart_ptr<utakata::unicode::UniChar> ch_;
};
};