OSDN Git Service

SchemeLexerの実装により、字句解析部分の作成を完了。
[simplecms/utakata.git] / src / lexer / comment_lexer.h
old mode 100755 (executable)
new mode 100644 (file)
index e7c222c..673a629
@@ -4,7 +4,7 @@
 #ifndef _UTAKATA_SRC_LEXER_COMMENT_LEXER_H_
 #define _UTAKATA_SRC_LEXER_COMMENT_LEXER_H_
 
-#include "src/lexer/lexer_interface.h"
+#include "lib/smart_ptr.h"
 
 namespace utakata {
 namespace reader {
@@ -13,6 +13,7 @@ class EncodingReader;
 
 namespace lexer {
 
+class Token;
 namespace detail {
 
 // #| と |#に囲まれた領域をコメントとして読み飛ばします。
@@ -26,19 +27,20 @@ class NestedLexer {
 };
 }
 
-class Lexeme;
 // <comment>に一致する字句を解釈する機能を提供します。
-class CommentLexer : public IPartOfLexer {
+class CommentLexer {
  public:
 
   // readerの先頭から、<comment>に一致するかどうかを返却します。
   // <nested comment>、及び;より開始されるコメントについては、
-  // 当該部分が読み飛ばされた上で、NULLが返却されますが、
+  // 当該部分が読み飛ばされた上で、trueが返却されます。
+  // その場合、resultに対しては何も行いません。
   // #; <interlexeme space> <datum>、また#!<identifier>については、
-  // それぞれ個別のLexemeが返却されます。
-  // Parserは、受け取ったLexemeに対して処理を行うことができますが、
+  // それぞれ個別のTokenが返却されます。
+  // Parserは、受け取ったTokenに対して処理を行うことができますが、
   // コメントが必ず読み飛ばされることを保証しなければなりません。
-  lexer::Lexeme* Lex(reader::EncodingReader* reader);
+  bool Lex(reader::EncodingReader* reader,
+           akebono::smart_ptr<lexer::Token>& result);
 
  private: