OSDN Git Service

-lexeme_idを、private inherit Enum idiomで書き直した。なんかよくわからないエラーが出るけど気にしない。
authorderui <derui@users.sourceforge.jp>
Sun, 19 Jul 2009 05:45:05 +0000 (14:45 +0900)
committerderui <derui@users.sourceforge.jp>
Sun, 19 Jul 2009 05:45:05 +0000 (14:45 +0900)
-lexer_testにBoolean, ByteVector, Vectorをそれぞれ追加。
-sublexer_impl::BooleanLexerで先読みチェックの際にpeekではなくreadしていたのを修正。

20 files changed:
Makefile
Makefile.am
Makefile.in
config.log
config.status
lexeme.h
lexeme_id.h
lexeme_impl.cpp
lexeme_impl.h
parser.cpp
simpletest.cpp
simpletest.h
sublexer_impl.cpp
test/Makefile
test/Makefile.am
test/Makefile.in
test/lexer_test.cpp
test/textarrayformat_test
test/utf8_string_test
test/utf8_test

index f201273..ab82351 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -86,11 +86,11 @@ DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
 distuninstallcheck_listfiles = find . -type f -print
 distcleancheck_listfiles = find . -type f -print
-ACLOCAL = ${SHELL} /home/derui/develop/sdl/missing --run aclocal-1.10
-AMTAR = ${SHELL} /home/derui/develop/sdl/missing --run tar
-AUTOCONF = ${SHELL} /home/derui/develop/sdl/missing --run autoconf
-AUTOHEADER = ${SHELL} /home/derui/develop/sdl/missing --run autoheader
-AUTOMAKE = ${SHELL} /home/derui/develop/sdl/missing --run automake-1.10
+ACLOCAL = ${SHELL} /home/derui/develop/utakata/missing --run aclocal-1.10
+AMTAR = ${SHELL} /home/derui/develop/utakata/missing --run tar
+AUTOCONF = ${SHELL} /home/derui/develop/utakata/missing --run autoconf
+AUTOHEADER = ${SHELL} /home/derui/develop/utakata/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/derui/develop/utakata/missing --run automake-1.10
 AWK = gawk
 CC = gcc
 CCDEPMODE = depmode=gcc3
@@ -118,7 +118,7 @@ LDFLAGS =
 LIBOBJS = 
 LIBS = 
 LTLIBOBJS = 
-MAKEINFO = ${SHELL} /home/derui/develop/sdl/missing --run makeinfo
+MAKEINFO = ${SHELL} /home/derui/develop/utakata/missing --run makeinfo
 MKDIR_P = /bin/mkdir -p
 OBJEXT = o
 PACKAGE = utakata
@@ -132,10 +132,10 @@ SET_MAKE =
 SHELL = /bin/sh
 STRIP = 
 VERSION = 0.0.1
-abs_builddir = /home/derui/develop/sdl
-abs_srcdir = /home/derui/develop/sdl
-abs_top_builddir = /home/derui/develop/sdl
-abs_top_srcdir = /home/derui/develop/sdl
+abs_builddir = /home/derui/develop/utakata
+abs_srcdir = /home/derui/develop/utakata
+abs_top_builddir = /home/derui/develop/utakata
+abs_top_srcdir = /home/derui/develop/utakata
 ac_ct_CC = gcc
 ac_ct_CXX = g++
 am__include = include
@@ -155,7 +155,7 @@ host_alias =
 htmldir = ${docdir}
 includedir = ${prefix}/include
 infodir = ${datarootdir}/info
-install_sh = $(SHELL) /home/derui/develop/sdl/install-sh
+install_sh = $(SHELL) /home/derui/develop/utakata/install-sh
 libdir = ${exec_prefix}/lib
 libexecdir = ${exec_prefix}/libexec
 localedir = ${datarootdir}/locale
@@ -177,7 +177,6 @@ top_builddir = .
 top_srcdir = .
 AM_CPPFLAGS = -Wall
 SUBDIRS = . test
-INCLUDES = -l$(top_srcdir)
 utakata_SOURCES = main.cpp vm.cpp operand.cpp cpu.cpp utf8.cpp \
        textarrayformat.cpp utf8_string.cpp
 
index ae48a41..c8dcd31 100755 (executable)
@@ -1,6 +1,5 @@
 AM_CPPFLAGS = -Wall
 SUBDIRS = . test
-INCLUDES = -l$(top_srcdir)
 
 bin_PROGRAMS = utakata
 
index dc6a05e..958c2e6 100644 (file)
@@ -177,7 +177,6 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AM_CPPFLAGS = -Wall
 SUBDIRS = . test
-INCLUDES = -l$(top_srcdir)
 utakata_SOURCES = main.cpp vm.cpp operand.cpp cpu.cpp utf8.cpp \
        textarrayformat.cpp utf8_string.cpp
 
index 18c79d7..0a8dc6a 100644 (file)
@@ -12,11 +12,11 @@ generated by GNU Autoconf 2.63.  Invocation command line was
 
 hostname = localhost
 uname -m = i686
-uname -r = 2.6.29-gentoo-r5
+uname -r = 2.6.30
 uname -s = Linux
-uname -v = #7 SMP Sat Jun 13 01:18:50 JST 2009
+uname -v = #5 SMP PREEMPT Tue Jul 7 14:05:32 JST 2009
 
-/usr/bin/uname -p = Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
+/usr/bin/uname -p = Intel(R) Core(TM)2 Duo CPU P7350 @ 2.00GHz
 /bin/uname -X     = unknown
 
 /bin/arch              = unknown
@@ -27,16 +27,13 @@ uname -v = #7 SMP Sat Jun 13 01:18:50 JST 2009
 /usr/bin/oslevel       = unknown
 /bin/universe          = unknown
 
-PATH: /home/derui/bin
-PATH: /usr/local/bin
-PATH: /usr/local/sbin
-PATH: /usr/sbin
-PATH: /sbin
-PATH: /bin
 PATH: /usr/local/bin
 PATH: /usr/bin
-PATH: /usr/local/X11R6/bin
-PATH: /usr/X11R6/bin
+PATH: /bin
+PATH: /opt/bin
+PATH: /usr/i486-pc-linux-gnu/gcc-bin/4.1.2
+PATH: /usr/i686-pc-linux-gnu/gcc-bin/4.1.2
+PATH: /usr/qt/3/bin
 
 
 ## ----------- ##
@@ -50,7 +47,7 @@ configure:2005: result: yes
 configure:2030: checking for a thread-safe mkdir -p
 configure:2069: result: /bin/mkdir -p
 configure:2082: checking for gawk
-configure:2098: found /bin/gawk
+configure:2098: found /usr/bin/gawk
 configure:2109: result: gawk
 configure:2120: checking whether make sets $(MAKE)
 configure:2142: result: yes
@@ -59,8 +56,8 @@ configure:2393: found /usr/bin/g++
 configure:2404: result: g++
 configure:2431: checking for C++ compiler version
 configure:2439: g++ --version >&5
-g++ (Gentoo 4.3.2-r3 p1.6, pie-10.1.5) 4.3.2
-Copyright (C) 2008 Free Software Foundation, Inc.
+g++ (GCC) 4.1.2 (Gentoo 4.1.2 p1.0.2)
+Copyright (C) 2006 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
@@ -68,9 +65,9 @@ configure:2443: $? = 0
 configure:2450: g++ -v >&5
 Using built-in specs.
 Target: i686-pc-linux-gnu
-Configured with: /var/tmp/portage/sys-devel/gcc-4.3.2-r3/work/gcc-4.3.2/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.3.2 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.2 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.2/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --disable-fixed-point --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --disable-libgcj --with-arch=i686 --enable-languages=c,c++,treelang,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.2-r3 p1.6, pie-10.1.5'
+Configured with: /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.2 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-libunwind-exceptions --disable-multilib --enable-libmudflap --disable-libssp --disable-libgcj --with-arch=i686 --enable-languages=c,c++,treelang,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
 Thread model: posix
-gcc version 4.3.2 (Gentoo 4.3.2-r3 p1.6, pie-10.1.5) 
+gcc version 4.1.2 (Gentoo 4.1.2 p1.0.2)
 configure:2454: $? = 0
 configure:2461: g++ -V >&5
 g++: '-V' option must have argument
@@ -110,8 +107,8 @@ configure:3175: found /usr/bin/gcc
 configure:3186: result: gcc
 configure:3418: checking for C compiler version
 configure:3426: gcc --version >&5
-gcc (Gentoo 4.3.2-r3 p1.6, pie-10.1.5) 4.3.2
-Copyright (C) 2008 Free Software Foundation, Inc.
+gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.0.2)
+Copyright (C) 2006 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
@@ -119,9 +116,9 @@ configure:3430: $? = 0
 configure:3437: gcc -v >&5
 Using built-in specs.
 Target: i686-pc-linux-gnu
-Configured with: /var/tmp/portage/sys-devel/gcc-4.3.2-r3/work/gcc-4.3.2/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.3.2 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.2 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.2/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --disable-fixed-point --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --disable-libgcj --with-arch=i686 --enable-languages=c,c++,treelang,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.2-r3 p1.6, pie-10.1.5'
+Configured with: /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.2 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-libunwind-exceptions --disable-multilib --enable-libmudflap --disable-libssp --disable-libgcj --with-arch=i686 --enable-languages=c,c++,treelang,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
 Thread model: posix
-gcc version 4.3.2 (Gentoo 4.3.2-r3 p1.6, pie-10.1.5) 
+gcc version 4.1.2 (Gentoo 4.1.2 p1.0.2)
 configure:3441: $? = 0
 configure:3448: gcc -V >&5
 gcc: '-V' option must have argument
@@ -449,14 +446,14 @@ am_cv_CXX_dependencies_compiler_type=gcc3
 ## Output variables. ##
 ## ----------------- ##
 
-ACLOCAL='${SHELL} /home/derui/develop/sdl/missing --run aclocal-1.10'
+ACLOCAL='${SHELL} /home/derui/develop/utakata/missing --run aclocal-1.10'
 AMDEPBACKSLASH='\'
 AMDEP_FALSE='#'
 AMDEP_TRUE=''
-AMTAR='${SHELL} /home/derui/develop/sdl/missing --run tar'
-AUTOCONF='${SHELL} /home/derui/develop/sdl/missing --run autoconf'
-AUTOHEADER='${SHELL} /home/derui/develop/sdl/missing --run autoheader'
-AUTOMAKE='${SHELL} /home/derui/develop/sdl/missing --run automake-1.10'
+AMTAR='${SHELL} /home/derui/develop/utakata/missing --run tar'
+AUTOCONF='${SHELL} /home/derui/develop/utakata/missing --run autoconf'
+AUTOHEADER='${SHELL} /home/derui/develop/utakata/missing --run autoheader'
+AUTOMAKE='${SHELL} /home/derui/develop/utakata/missing --run automake-1.10'
 AWK='gawk'
 CC='gcc'
 CCDEPMODE='depmode=gcc3'
@@ -483,7 +480,7 @@ LDFLAGS=''
 LIBOBJS=''
 LIBS=''
 LTLIBOBJS=''
-MAKEINFO='${SHELL} /home/derui/develop/sdl/missing --run makeinfo'
+MAKEINFO='${SHELL} /home/derui/develop/utakata/missing --run makeinfo'
 MKDIR_P='/bin/mkdir -p'
 OBJEXT='o'
 PACKAGE='utakata'
@@ -520,7 +517,7 @@ host_alias=''
 htmldir='${docdir}'
 includedir='${prefix}/include'
 infodir='${datarootdir}/info'
-install_sh='$(SHELL) /home/derui/develop/sdl/install-sh'
+install_sh='$(SHELL) /home/derui/develop/utakata/install-sh'
 libdir='${exec_prefix}/lib'
 libexecdir='${exec_prefix}/libexec'
 localedir='${datarootdir}/locale'
@@ -596,147 +593,3 @@ on localhost
 
 config.status:776: creating test/Makefile
 config.status:1050: executing depfiles commands
-
-## ---------------------- ##
-## Running config.status. ##
-## ---------------------- ##
-
-This file was extended by utakata config.status 0.0.1, which was
-generated by GNU Autoconf 2.63.  Invocation command line was
-
-  CONFIG_FILES    = 
-  CONFIG_HEADERS  = 
-  CONFIG_LINKS    = 
-  CONFIG_COMMANDS = 
-  $ ./config.status test/Makefile depfiles
-
-on localhost
-
-config.status:776: creating test/Makefile
-config.status:1050: executing depfiles commands
-
-## ---------------------- ##
-## Running config.status. ##
-## ---------------------- ##
-
-This file was extended by utakata config.status 0.0.1, which was
-generated by GNU Autoconf 2.63.  Invocation command line was
-
-  CONFIG_FILES    = 
-  CONFIG_HEADERS  = 
-  CONFIG_LINKS    = 
-  CONFIG_COMMANDS = 
-  $ ./config.status Makefile depfiles
-
-on localhost
-
-config.status:776: creating Makefile
-config.status:1050: executing depfiles commands
-
-## ---------------------- ##
-## Running config.status. ##
-## ---------------------- ##
-
-This file was extended by utakata config.status 0.0.1, which was
-generated by GNU Autoconf 2.63.  Invocation command line was
-
-  CONFIG_FILES    = 
-  CONFIG_HEADERS  = 
-  CONFIG_LINKS    = 
-  CONFIG_COMMANDS = 
-  $ ./config.status Makefile depfiles
-
-on localhost
-
-config.status:776: creating Makefile
-config.status:1050: executing depfiles commands
-
-## ---------------------- ##
-## Running config.status. ##
-## ---------------------- ##
-
-This file was extended by utakata config.status 0.0.1, which was
-generated by GNU Autoconf 2.63.  Invocation command line was
-
-  CONFIG_FILES    = 
-  CONFIG_HEADERS  = 
-  CONFIG_LINKS    = 
-  CONFIG_COMMANDS = 
-  $ ./config.status test/Makefile depfiles
-
-on localhost
-
-config.status:776: creating test/Makefile
-config.status:1050: executing depfiles commands
-
-## ---------------------- ##
-## Running config.status. ##
-## ---------------------- ##
-
-This file was extended by utakata config.status 0.0.1, which was
-generated by GNU Autoconf 2.63.  Invocation command line was
-
-  CONFIG_FILES    = 
-  CONFIG_HEADERS  = 
-  CONFIG_LINKS    = 
-  CONFIG_COMMANDS = 
-  $ ./config.status test/Makefile depfiles
-
-on localhost
-
-config.status:776: creating test/Makefile
-config.status:1050: executing depfiles commands
-
-## ---------------------- ##
-## Running config.status. ##
-## ---------------------- ##
-
-This file was extended by utakata config.status 0.0.1, which was
-generated by GNU Autoconf 2.63.  Invocation command line was
-
-  CONFIG_FILES    = 
-  CONFIG_HEADERS  = 
-  CONFIG_LINKS    = 
-  CONFIG_COMMANDS = 
-  $ ./config.status test/Makefile depfiles
-
-on localhost
-
-config.status:776: creating test/Makefile
-config.status:1050: executing depfiles commands
-
-## ---------------------- ##
-## Running config.status. ##
-## ---------------------- ##
-
-This file was extended by utakata config.status 0.0.1, which was
-generated by GNU Autoconf 2.63.  Invocation command line was
-
-  CONFIG_FILES    = 
-  CONFIG_HEADERS  = 
-  CONFIG_LINKS    = 
-  CONFIG_COMMANDS = 
-  $ ./config.status Makefile depfiles
-
-on localhost
-
-config.status:776: creating Makefile
-config.status:1050: executing depfiles commands
-
-## ---------------------- ##
-## Running config.status. ##
-## ---------------------- ##
-
-This file was extended by utakata config.status 0.0.1, which was
-generated by GNU Autoconf 2.63.  Invocation command line was
-
-  CONFIG_FILES    = 
-  CONFIG_HEADERS  = 
-  CONFIG_LINKS    = 
-  CONFIG_COMMANDS = 
-  $ ./config.status test/Makefile depfiles
-
-on localhost
-
-config.status:776: creating test/Makefile
-config.status:1050: executing depfiles commands
index 9e6c64c..7c2c728 100755 (executable)
@@ -363,7 +363,7 @@ Copyright (C) 2008 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
-ac_pwd='/home/derui/develop/sdl'
+ac_pwd='/home/derui/develop/utakata'
 srcdir='.'
 INSTALL='/usr/bin/install -c'
 MKDIR_P='/bin/mkdir -p'
@@ -562,7 +562,7 @@ S["CXXFLAGS"]="-g -O2"
 S["CXX"]="g++"
 S["am__untar"]="${AMTAR} xf -"
 S["am__tar"]="${AMTAR} chof - \"$$tardir\""
-S["AMTAR"]="${SHELL} /home/derui/develop/sdl/missing --run tar"
+S["AMTAR"]="${SHELL} /home/derui/develop/utakata/missing --run tar"
 S["am__leading_dot"]="."
 S["SET_MAKE"]=""
 S["AWK"]="gawk"
@@ -570,12 +570,12 @@ S["mkdir_p"]="/bin/mkdir -p"
 S["MKDIR_P"]="/bin/mkdir -p"
 S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s"
 S["STRIP"]=""
-S["install_sh"]="$(SHELL) /home/derui/develop/sdl/install-sh"
-S["MAKEINFO"]="${SHELL} /home/derui/develop/sdl/missing --run makeinfo"
-S["AUTOHEADER"]="${SHELL} /home/derui/develop/sdl/missing --run autoheader"
-S["AUTOMAKE"]="${SHELL} /home/derui/develop/sdl/missing --run automake-1.10"
-S["AUTOCONF"]="${SHELL} /home/derui/develop/sdl/missing --run autoconf"
-S["ACLOCAL"]="${SHELL} /home/derui/develop/sdl/missing --run aclocal-1.10"
+S["install_sh"]="$(SHELL) /home/derui/develop/utakata/install-sh"
+S["MAKEINFO"]="${SHELL} /home/derui/develop/utakata/missing --run makeinfo"
+S["AUTOHEADER"]="${SHELL} /home/derui/develop/utakata/missing --run autoheader"
+S["AUTOMAKE"]="${SHELL} /home/derui/develop/utakata/missing --run automake-1.10"
+S["AUTOCONF"]="${SHELL} /home/derui/develop/utakata/missing --run autoconf"
+S["ACLOCAL"]="${SHELL} /home/derui/develop/utakata/missing --run aclocal-1.10"
 S["VERSION"]="0.0.1"
 S["PACKAGE"]="utakata"
 S["CYGPATH_W"]="echo"
index 095d534..40f7bf0 100644 (file)
--- a/lexeme.h
+++ b/lexeme.h
@@ -2,7 +2,6 @@
 #define _LEXEME_H_
 
 #include "smart_ptr.h"
-#include "lexeme_id.h"
 
 namespace utakata {
 
@@ -12,6 +11,7 @@ namespace utakata {
 
     namespace lexeme {
 
+        class LexemeID;
         class ILexeme
         {
             // 非終端記号、及び終端記号を表すクラス。
@@ -20,7 +20,7 @@ namespace utakata {
             virtual ~ILexeme(){}
 
             // 終端記号、非終端記号のIDを取得する。
-            virtual const lexeme::LexemeID getID() const = 0;
+            virtual const LexemeID getID() const = 0;
             
             // stringのデータ型において、文字列を取得する。
             virtual smart_ptr<utakata::utf8_string::UTF8String> toString() const = 0;
index 48e371a..972ffd6 100755 (executable)
@@ -13,24 +13,24 @@ namespace utakata {
         public:
             enum private_LEXEMEID_ {
                 EOS             = -1, // EOF
-                OPENPARENTHESIS ,      // ([
-                STRING          ,      // <STRING>
-                CLOSEPARENTHESIS,      // ])
-                BACKQUOTE       ,      // `
-                DOT             ,      // .
-                QUOTE           ,      // '
-                UNQUOTE         ,      // ,
-                UNQUOTESPLICING ,      // ,@
-                SYNTAX          ,      // #'
-                QUASISYNTAX     ,      // #`
-                UNSYNTAX        ,      // #,
-                UNSYNTAXSPLICING,      // #,@
-                IDENTIFIER      ,      // <IDENTIFIER>
-                NUMBER          ,      // <NUMBER>
-                CHARACTOR       ,      // <CHARACTOR>
-                BOOLEAN         ,      // <BOOLEAN>
-                BYTEVECTOR      ,      // #VU8
-                VECTOR          ,      // #(
+                OPENPARENTHESIS,      // ([
+                STRING,               // <STRING>
+                CLOSEPARENTHESIS,     // ])
+                BACKQUOTE,            // `
+                DOT,                  // .
+                QUOTE,                // '
+                UNQUOTE,              //,
+                UNQUOTESPLICING,      //,@
+                SYNTAX,               // #'
+                QUASISYNTAX,          // #`
+                UNSYNTAX,             // #,
+                UNSYNTAXSPLICING,     // #,@
+                IDENTIFIER,           // <IDENTIFIER>
+                NUMBER,               // <NUMBER>
+                CHARACTOR,            // <CHARACTOR>
+                BOOLEAN,              // <BOOLEAN>
+                BYTEVECTOR,           // #VU8
+                VECTOR,               // #(
             };
 
         private:
@@ -45,8 +45,10 @@ namespace utakata {
             template<LEXEMEID_ S>
             LexemeID(const Literal<S>&) : S_(S) {}
 
-            inline friend bool operator==(LexemeID s, LexemeID t) {return s.S_ == t.S_;}
-            inline friend bool operator!=(LexemeID s, LexemeID t) {return !(s == t);}
+            LEXEMEID_ toEnum() const {return S_;}
+
+            friend bool operator==(LexemeID s, LexemeID t) {return s.S_ == t.S_;}
+            friend bool operator!=(LexemeID s, LexemeID t) {return !(s == t);}
 
             static const Literal<OPENPARENTHESIS>  openParenthesis;
             static const Literal<STRING>           string;
@@ -82,6 +84,7 @@ namespace utakata {
             friend class LexemeID;
             // 暗黙的なコピーコンストラクタを利用する。
             Literal() : LexemeID(*this) {}
+            ~Literal() {}
 
             void* operator new(size_t);
             void operator delete(void*);
index 057b806..5315b33 100755 (executable)
@@ -1,9 +1,8 @@
 #include <vector>
 #include <string>
 
-#include "lexeme_impl.h"
 #include "lexeme_id.h"
-
+#include "lexeme_impl.h"
 
 using namespace utakata::lexeme;
 using namespace utakata::utf8_string;
@@ -134,9 +133,9 @@ smart_ptr<ILexeme> utakata::lexeme::makeNumber(const utakata::utf8_string::UTF8S
 // OpenParen //
 ///////////////
 
-const LexemeID OpenParen::getID() const
+const utakata::lexeme::LexemeID OpenParen::getID() const
 {
-    return LexemeID::openParenthesis;
+    return utakata::lexeme::LexemeID::openParenthesis;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> OpenParen::toString() const
@@ -150,9 +149,9 @@ smart_ptr<utakata::utf8_string::UTF8String> OpenParen::toString() const
 // EOF //
 /////////
 
-const LexemeID EOS::getID() const
+const utakata::lexeme::LexemeID EOS::getID() const
 {
-    return LexemeID::eos;
+    return utakata::lexeme::LexemeID::eos;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> EOS::toString() const
@@ -167,9 +166,9 @@ smart_ptr<utakata::utf8_string::UTF8String> EOS::toString() const
 // CloseParen //
 ////////////////
 
-const LexemeID CloseParen::getID() const
+const utakata::lexeme::LexemeID CloseParen::getID() const
 {
-    return LexemeID::closeParenthesis;
+    return utakata::lexeme::LexemeID::closeParenthesis;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> CloseParen::toString() const
@@ -183,9 +182,9 @@ smart_ptr<utakata::utf8_string::UTF8String> CloseParen::toString() const
 // BackQuote //
 ///////////////
 
-const LexemeID BackQuote::getID() const
+const utakata::lexeme::LexemeID BackQuote::getID() const
 {
-    return LexemeID::backquote;
+    return utakata::lexeme::LexemeID::backquote;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> BackQuote::toString() const
@@ -199,9 +198,9 @@ smart_ptr<utakata::utf8_string::UTF8String> BackQuote::toString() const
 // Quote //
 ///////////
 
-const LexemeID Quote::getID() const
+const utakata::lexeme::LexemeID Quote::getID() const
 {
-    return LexemeID::quote;
+    return utakata::lexeme::LexemeID::quote;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> Quote::toString() const
@@ -215,9 +214,9 @@ smart_ptr<utakata::utf8_string::UTF8String> Quote::toString() const
 // Dot //
 /////////
 
-const LexemeID Dot::getID() const
+const utakata::lexeme::LexemeID Dot::getID() const
 {
-    return LexemeID::dot;
+    return utakata::lexeme::LexemeID::dot;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> Dot::toString() const
@@ -231,9 +230,9 @@ smart_ptr<utakata::utf8_string::UTF8String> Dot::toString() const
 // UnquoteSplicing //
 /////////////////////
 
-const LexemeID UnquoteSplicing::getID() const
+const utakata::lexeme::LexemeID UnquoteSplicing::getID() const
 {
-    return LexemeID::unquoteSplicing;
+    return utakata::lexeme::LexemeID::unquoteSplicing;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> UnquoteSplicing::toString() const
@@ -247,9 +246,9 @@ smart_ptr<utakata::utf8_string::UTF8String> UnquoteSplicing::toString() const
 // ByteVector //
 ////////////////
 
-const LexemeID ByteVector::getID() const
+const utakata::lexeme::LexemeID ByteVector::getID() const
 {
-    return LexemeID::unquoteSplicing;
+    return utakata::lexeme::LexemeID::byteVector;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> ByteVector::toString() const
@@ -263,9 +262,9 @@ smart_ptr<utakata::utf8_string::UTF8String> ByteVector::toString() const
 // Vector //
 ////////////////
 
-const LexemeID Vector::getID() const
+const utakata::lexeme::LexemeID Vector::getID() const
 {
-    return LexemeID::unquoteSplicing;
+    return utakata::lexeme::LexemeID::vector;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> Vector::toString() const
@@ -279,9 +278,9 @@ smart_ptr<utakata::utf8_string::UTF8String> Vector::toString() const
 // Unquote //
 /////////////
 
-const LexemeID Unquote::getID() const
+const utakata::lexeme::LexemeID Unquote::getID() const
 {
-    return LexemeID::unquote;
+    return utakata::lexeme::LexemeID::unquote;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> Unquote::toString() const
@@ -295,9 +294,9 @@ smart_ptr<utakata::utf8_string::UTF8String> Unquote::toString() const
 // Syntax //
 ////////////
 
-const LexemeID Syntax::getID() const
+const utakata::lexeme::LexemeID Syntax::getID() const
 {
-    return LexemeID::syntax;
+    return utakata::lexeme::LexemeID::syntax;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> Syntax::toString() const
@@ -311,9 +310,9 @@ smart_ptr<utakata::utf8_string::UTF8String> Syntax::toString() const
 // QuasiSyntax //
 /////////////////
 
-const LexemeID QuasiSyntax::getID() const
+const utakata::lexeme::LexemeID QuasiSyntax::getID() const
 {
-    return LexemeID::quasiSyntax;
+    return utakata::lexeme::LexemeID::quasiSyntax;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> QuasiSyntax::toString() const
@@ -327,9 +326,9 @@ smart_ptr<utakata::utf8_string::UTF8String> QuasiSyntax::toString() const
 // Unsyntax //
 //////////////
 
-const LexemeID Unsyntax::getID() const
+const utakata::lexeme::LexemeID Unsyntax::getID() const
 {
-    return LexemeID::unsyntax;
+    return utakata::lexeme::LexemeID::unsyntax;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> Unsyntax::toString() const
@@ -343,9 +342,9 @@ smart_ptr<utakata::utf8_string::UTF8String> Unsyntax::toString() const
 // UnsyntaxSplicing //
 //////////////////////
 
-const LexemeID UnsyntaxSplicing::getID() const
+const utakata::lexeme::LexemeID UnsyntaxSplicing::getID() const
 {
-    return LexemeID::unsyntaxSplicing;
+    return utakata::lexeme::LexemeID::unsyntaxSplicing;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> UnsyntaxSplicing::toString() const
@@ -363,9 +362,9 @@ Identifier::Identifier(const utakata::utf8_string::UTF8String& str) :
     str_(new utakata::utf8_string::UTF8String(str))
 {}
 
-const LexemeID Identifier::getID() const
+const utakata::lexeme::LexemeID Identifier::getID() const
 {
-    return LexemeID::identifier;
+    return utakata::lexeme::LexemeID::identifier;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> Identifier::toString() const
@@ -381,9 +380,9 @@ String::String(const utakata::utf8_string::UTF8String& str) :
     str_(new utakata::utf8_string::UTF8String(str))
 {}
 
-const LexemeID String::getID() const
+const utakata::lexeme::LexemeID String::getID() const
 {
-    return LexemeID::string;
+    return utakata::lexeme::LexemeID::string;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> String::toString() const
@@ -397,15 +396,15 @@ smart_ptr<utakata::utf8_string::UTF8String> String::toString() const
 
 Number::Number(const UTF8String& real,
                const UTF8String& imagin,
-               bool exact, const LexemeID radix) :
+               bool exact, int radix) :
     real_(new UTF8String(real)), imagin_(new UTF8String(imagin)),
     exact_(exact), radix_(radix)
 {
 }
 
-const LexemeID Number::getID() const
+const utakata::lexeme::LexemeID Number::getID() const
 {
-    return LexemeID::number;
+    return utakata::lexeme::LexemeID::number;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> Number::toString() const
@@ -420,9 +419,9 @@ smart_ptr<utakata::utf8_string::UTF8String> Number::toString() const
 Charactor::Charactor(const UTF8String& ch) : ch_(new UTF8String(ch))
 {}
 
-const LexemeID Charactor::getID() const
+const utakata::lexeme::LexemeID Charactor::getID() const
 {
-    return LexemeID::charactor;
+    return utakata::lexeme::LexemeID::charactor;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> Charactor::toString() const
@@ -439,9 +438,9 @@ Boolean::Boolean(const smart_ptr<UTF8Char>& ch) : str_(new UTF8String())
     *str_ += *ch;
 }
 
-const LexemeID Boolean::getID() const
+const utakata::lexeme::LexemeID Boolean::getID() const
 {
-    return LexemeID::boolean;
+    return utakata::lexeme::LexemeID::boolean;
 }
 
 smart_ptr<utakata::utf8_string::UTF8String> Boolean::toString() const
index bbab412..79843c6 100755 (executable)
@@ -4,6 +4,7 @@
 #include "lexeme.h"
 #include "smart_ptr.h"
 #include "utf8_string.h"
+#include "lexeme_id.h"
 
 // lexemeの様々な実装を定義する。
 namespace utakata {
@@ -50,7 +51,7 @@ namespace utakata {
             OpenParen(){}
             virtual ~OpenParen() {}
 
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
         };
 
@@ -60,7 +61,7 @@ namespace utakata {
             EOS(){}
             virtual ~EOS() {}
 
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
         };
 
@@ -69,7 +70,7 @@ namespace utakata {
         public:
             CloseParen(){}
             virtual ~CloseParen() {}
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
 
         };
@@ -79,7 +80,7 @@ namespace utakata {
         public:
             BackQuote(){}
             virtual ~BackQuote(){}
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
         };
 
@@ -88,7 +89,7 @@ namespace utakata {
         public:
             Quote(){}
             virtual ~Quote(){}
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
 
         };
@@ -98,7 +99,7 @@ namespace utakata {
         public:
             Dot(){}
             virtual ~Dot(){}
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
         };
 
@@ -107,7 +108,7 @@ namespace utakata {
         public:
             UnquoteSplicing(){}
             virtual ~UnquoteSplicing(){}
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
 
         };
@@ -117,7 +118,7 @@ namespace utakata {
         public:
             Unquote(){}
             virtual ~Unquote(){}
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
         };
 
@@ -126,7 +127,7 @@ namespace utakata {
         public:
             Syntax() {}
             virtual ~Syntax() {}
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
         };
 
@@ -135,7 +136,7 @@ namespace utakata {
         public:
             QuasiSyntax(){}
             virtual ~QuasiSyntax(){}
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
 
         };
@@ -146,7 +147,7 @@ namespace utakata {
             UnsyntaxSplicing(){}
             virtual ~UnsyntaxSplicing(){}
 
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
 
         };
@@ -156,7 +157,7 @@ namespace utakata {
         public:
             Unsyntax(){}
             virtual ~Unsyntax(){}
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
 
         };
@@ -170,7 +171,7 @@ namespace utakata {
         public:
             Vector(){}
             virtual ~Vector(){}
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
 
         };
@@ -184,7 +185,7 @@ namespace utakata {
         public:
             ByteVector(){}
             virtual ~ByteVector(){}
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
 
         };
@@ -196,7 +197,7 @@ namespace utakata {
             
             String(const utakata::utf8_string::UTF8String& ident);
             virtual ~String(){}
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
 
         private:
@@ -210,7 +211,7 @@ namespace utakata {
             
             Identifier(const utakata::utf8_string::UTF8String& ident);
             virtual ~Identifier(){}
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
 
         private:
@@ -224,7 +225,7 @@ namespace utakata {
             Number(const utf8_string::UTF8String& real, const utf8_string::UTF8String& imagin,
                    bool exact, int radix);
             virtual ~Number(){}
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
 
         private:
@@ -241,7 +242,7 @@ namespace utakata {
             Charactor(const utf8_string::UTF8String& ch);
             virtual ~Charactor(){}
 
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
 
         private:
@@ -255,7 +256,7 @@ namespace utakata {
             Boolean(const smart_ptr<utf8_string::UTF8Char>& ch);
             virtual ~Boolean(){}
 
-            const LexemeID getID() const;
+            const lexeme::LexemeID getID() const;
             smart_ptr<utakata::utf8_string::UTF8String> toString() const;
 
         private:
index 177cf17..2f6c3b3 100755 (executable)
@@ -12,10 +12,9 @@ parser::Parser::Parser(const smart_ptr<lexer::Lexer>& l) : lexer_(l)
 bool parser::Parser::parse(smart_ptr<utf8::UTF8InputStream>& strm)
 {
     int status = INIT;
-    lexeme::IDProxy prox;
     smart_ptr<lexeme::ILexeme> lexm;
     // lexeme\82ªNull\82Å\82 \82é\8fó\91Ô\82É\82È\82é\82Ü\82Å\90i\82Þ\81B
-    while (lexm = lexer_->lex(strm)) {
+    while (!(lexm = lexer_->lex(strm)).isNull()) {
         if (lexm.isNull())
         {
             break;
@@ -26,21 +25,20 @@ bool parser::Parser::parse(smart_ptr<utf8::UTF8InputStream>& strm)
         // \8ae\92è\8b`\82Æ\82·\82é\82Ì\82Í\8aÈ\92P\82Å\82 \82é\81B
         if (status == INIT)
         {
-            if (lexm->getID() == prox->openParenthesis)
+            if (lexm->getID() == lexeme::LexemeID::openParenthesis)
             {
                 // \8aJ\82«\8a\87\8cÊ\82Å\82 \82é\8fê\8d\87
                 status = LIST_BEGIN;
             }
-            else if (lexm->getID() == prox->string ||
-                     lexm->getID() == prox->number ||
-                     lexm->getID() == prox->identifier ||
-                     lexm->getID() == prox->charactor ||
-                     lexm->getID() == prox->boolean)
+            else if (lexm->getID() == lexeme::LexemeID::string ||
+                     lexm->getID() == lexeme::LexemeID::number ||
+                     lexm->getID() == lexeme::LexemeID::identifier ||
+                     lexm->getID() == lexeme::LexemeID::charactor ||
+                     lexm->getID() == lexeme::LexemeID::boolean)
             {
                 // \82»\82ê\82¼\82ê\82Ì\8fê\8d\87\81Alexeme_datum\82Æ\82µ\82Ä\88µ\82í\82ê\82é\81B
                 status = LEXEME_DATUM;
             }
-            else if
         }
     }
     return true;
index d79e4c7..92093f9 100644 (file)
@@ -8,7 +8,7 @@
 using namespace simpletest;
 
 SimpleTestSuite::SimpleTestSuite(const std::string& name) :
-    name_("[" + name + "]"), prefix_(""), testers_(), strm_(std::cout),
+    name_("[" + name + "]"), prefix_("*"), testers_(), strm_(std::cout),
     runner_()
 {
     runner_.add(new SimpleTestRunner(strm_, prefix_));
@@ -16,7 +16,7 @@ SimpleTestSuite::SimpleTestSuite(const std::string& name) :
 
 SimpleTestSuite::SimpleTestSuite(const std::string& name,
                                    std::ostream& strm) :
-    name_("[" + name + "]"), prefix_(""), testers_(), strm_(strm)
+    name_("[" + name + "]"), prefix_("*"), testers_(), strm_(strm)
 {
     runner_.add(new SimpleTestRunner(strm_, prefix_));
 }
@@ -166,7 +166,7 @@ SimpleTestAsserter& simpletest::SimpleTestAsserter::operator=(const SimpleTestAs
 
 bool simpletest::SimpleTestAsserter::isOk() const
 {
-    // count_は、checkの比較関数が失敗する度にこれが実行されることに
+    // count_は、checkの比較関数が失敗する度にこれがインクリメントされることに
     // なっている。
     return count_ == 0 ? true : false;
 }
index 649499f..99ea8bc 100644 (file)
@@ -163,6 +163,7 @@ namespace simpletest {
         bool operator()(const T& f1, const S& f2) {
             return (f1 == f2);
         }
+
     };
 
     template<class T, class S>
@@ -193,7 +194,7 @@ namespace simpletest {
         // 作成することも当然許可されている。
         // binary_functionから派生する場合、返り値はboolにすること。
         template<class First, class Second, class Compare>
-        void check(const First& f, const Second& s, const std::string& mes, Compare c) {
+        void check_(const First& f, const Second& s, const std::string& mes, Compare c) {
             if (!c(f, s))
             {
                 // 失敗したら簡単なメッセージを設定することにする。
@@ -212,18 +213,18 @@ namespace simpletest {
         }
 
         template<class First, class Second, class Compare>
-        void check(const First& f, const Second& s, const std::string& mes, Compare c) {
+        void checkOnly_(const First& f, const Second& s, const std::string& mes, Compare c) {
             if (!c(f, s))
             {
                 // 値を表示せず、成功したか失敗したかだけを表示する。
                 if (!mes.empty())
                 {
-                    strm_ << prefix_ << "fail test number : " << count_ << std::endl;
+                    strm_ << prefix_ << "fail test number : " << count_ + 1 << std::endl;
                     strm_ << (prefix_ + prefix_) << "message is --> " << mes << std::endl;
                 }
                 else
                 {
-                    strm_ << prefix_ << "fail test number : " << count_ << std::endl;
+                    strm_ << prefix_ << "fail test number : " << count_ + 1 << std::endl;
                 }
                 ++count_;
             }
@@ -233,12 +234,12 @@ namespace simpletest {
         // 比較関数を渡す必要のない場合にはこれが利用される。
         template<class First, class Second>
         void check(const First& f, const Second& s, const std::string& mes = std::string()) {
-            check(f, s, mes, std::equal_to<First>());
+            check_(f, s, mes, equal<First,Second>());
         }
 
         template<class First, class Second>
         void checkOnly(const First& f, const Second& s, const std::string& mes = std::string()) {
-            checkOnly(f, s, mes, std::equal_to<First>());
+            checkOnly_(f, s, mes, equal<First, Second>());
         }
 
         // assertの結果が満足いくものかどうかを返す。
index 8c7dd91..e56952b 100755 (executable)
@@ -7,6 +7,7 @@
 #include "lexeme_impl.h"
 #include "delimiter.h"
 #include "number_lexer.h"
+#include "lexeme_id.h"
 
 using namespace utakata;
 using namespace utakata::utf8_string;
@@ -31,7 +32,7 @@ smart_ptr<lexeme::ILexeme> sublexer::FirstLexer::lex(smart_ptr<utf8::UTF8InputSt
 
     if (stream->isEOF())
     {
-        return smart_ptr<lexeme::ILexeme>(lexeme::makeEOF());
+        return smart_ptr<lexeme::ILexeme>(lexeme::makeEOS());
     }
 
     smart_ptr<lexeme::ILexeme> ret;
@@ -510,7 +511,7 @@ smart_ptr<lexeme::ILexeme> sublexer::BooleanLexer::lex(smart_ptr<utf8::UTF8Input
 
     if (!stream->isEOF())
     {
-        UTF8Char ch(stream->read());
+        UTF8Char ch(stream->peek());
 
         lexer_delimiter::Normal nor;
         if (!nor(ch))
@@ -539,11 +540,11 @@ smart_ptr<lexeme::ILexeme> sublexer::ByteVectorLexer::lex(smart_ptr<utf8::UTF8In
     // 調べる。
 
     UTF8String str(stream->read(3));
-    if (str.toStr() == "u8(")
+    if (str.toStr() != "u8(")
     {
         std::stringstream ss;
         ss << "バイトベクタとして認識できません";
-        throw sublexer::LexException(stream->pos(), "");
+        throw sublexer::LexException(stream->pos(), ss.str());
     }
 
     return lexeme::makeByteVector();
index 6cf21e0..e586b0d 100644 (file)
@@ -45,16 +45,16 @@ CONFIG_CLEAN_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)"
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS)
-am_lexer_test_OBJECTS = lexer_test.$(OBJEXT) lexer.$(OBJEXT) \
-       simpletest.$(OBJEXT) utf8_string.$(OBJEXT) utf8.$(OBJEXT) \
-       textarrayformat.$(OBJEXT) sublexer_impl.$(OBJEXT) \
-       lexeme_impl.$(OBJEXT) delimiter.$(OBJEXT)
+am_lexer_test_OBJECTS = lexer_test.$(OBJEXT) utf8_string.$(OBJEXT) \
+       simpletest.$(OBJEXT) utf8.$(OBJEXT) textarrayformat.$(OBJEXT) \
+       lexeme_impl.$(OBJEXT) delimiter.$(OBJEXT) \
+       sublexer_impl.$(OBJEXT) lexer.$(OBJEXT)
 lexer_test_OBJECTS = $(am_lexer_test_OBJECTS)
 lexer_test_LDADD = $(LDADD)
 am_parser_test_OBJECTS = parser_test.$(OBJEXT) sublexer_impl.$(OBJEXT) \
        simpletest.$(OBJEXT) utf8.$(OBJEXT) utf8_string.$(OBJEXT) \
        lexeme_impl.$(OBJEXT) parser.$(OBJEXT) delimiter.$(OBJEXT) \
-       textarrayformat.$(OBJEXT)
+       textarrayformat.$(OBJEXT) lexer.$(OBJEXT)
 parser_test_OBJECTS = $(am_parser_test_OBJECTS)
 parser_test_LDADD = $(LDADD)
 am_sublexer_test_OBJECTS = sublexer_test.$(OBJEXT) \
@@ -83,6 +83,10 @@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 CXXLD = $(CXX)
 CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
        -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(lexer_test_SOURCES) $(parser_test_SOURCES) \
        $(sublexer_test_SOURCES) $(textarrayformat_test_SOURCES) \
        $(utf8_string_test_SOURCES) $(utf8_test_SOURCES)
@@ -92,11 +96,11 @@ DIST_SOURCES = $(lexer_test_SOURCES) $(parser_test_SOURCES) \
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = ${SHELL} /home/derui/develop/sdl/missing --run aclocal-1.10
-AMTAR = ${SHELL} /home/derui/develop/sdl/missing --run tar
-AUTOCONF = ${SHELL} /home/derui/develop/sdl/missing --run autoconf
-AUTOHEADER = ${SHELL} /home/derui/develop/sdl/missing --run autoheader
-AUTOMAKE = ${SHELL} /home/derui/develop/sdl/missing --run automake-1.10
+ACLOCAL = ${SHELL} /home/derui/develop/utakata/missing --run aclocal-1.10
+AMTAR = ${SHELL} /home/derui/develop/utakata/missing --run tar
+AUTOCONF = ${SHELL} /home/derui/develop/utakata/missing --run autoconf
+AUTOHEADER = ${SHELL} /home/derui/develop/utakata/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/derui/develop/utakata/missing --run automake-1.10
 AWK = gawk
 CC = gcc
 CCDEPMODE = depmode=gcc3
@@ -124,7 +128,7 @@ LDFLAGS =
 LIBOBJS = 
 LIBS = 
 LTLIBOBJS = 
-MAKEINFO = ${SHELL} /home/derui/develop/sdl/missing --run makeinfo
+MAKEINFO = ${SHELL} /home/derui/develop/utakata/missing --run makeinfo
 MKDIR_P = /bin/mkdir -p
 OBJEXT = o
 PACKAGE = utakata
@@ -138,10 +142,10 @@ SET_MAKE =
 SHELL = /bin/sh
 STRIP = 
 VERSION = 0.0.1
-abs_builddir = /home/derui/develop/sdl/test
-abs_srcdir = /home/derui/develop/sdl/test
-abs_top_builddir = /home/derui/develop/sdl
-abs_top_srcdir = /home/derui/develop/sdl
+abs_builddir = /home/derui/develop/utakata/test
+abs_srcdir = /home/derui/develop/utakata/test
+abs_top_builddir = /home/derui/develop/utakata
+abs_top_srcdir = /home/derui/develop/utakata
 ac_ct_CC = gcc
 ac_ct_CXX = g++
 am__include = include
@@ -161,7 +165,7 @@ host_alias =
 htmldir = ${docdir}
 includedir = ${prefix}/include
 infodir = ${datarootdir}/info
-install_sh = $(SHELL) /home/derui/develop/sdl/install-sh
+install_sh = $(SHELL) /home/derui/develop/utakata/install-sh
 libdir = ${exec_prefix}/lib
 libexecdir = ${exec_prefix}/libexec
 localedir = ${datarootdir}/locale
@@ -183,19 +187,19 @@ top_builddir = ..
 top_srcdir = ..
 
 # 警告レベルを最大にする。
-AM_CPPFLAGS = -Wall
-INCLUDES = -l$(top_srcdir)
+AM_CPPFLAGS = -Wall -pg
+INCLUDES = -I$(top_srcdir)
 utf8_string_test_SOURCES = utf8_string_test.cpp ../utf8_string.cpp ../simpletest.cpp ../utf8.cpp
 utf8_test_SOURCES = utf8_test.cpp ../utf8.cpp ../simpletest.cpp
 textarrayformat_test_SOURCES = textarrayformat_test.cpp ../textarrayformat.cpp ../simpletest.cpp
-lexer_test_SOURCES = lexer_test.cpp ../lexer.cpp  ../simpletest.cpp ../utf8_string.cpp ../utf8.cpp \
../textarrayformat.cpp ../sublexer_impl.cpp ../lexeme_impl.cpp ../delimiter.cpp
+lexer_test_SOURCES = ../lexeme_id.h lexer_test.cpp ../utf8_string.cpp ../simpletest.cpp ../utf8.cpp ../textarrayformat.cpp ../lexeme_impl.cpp \
       ../delimiter.cpp  ../sublexer_impl.cpp  ../lexer.cpp
 
 sublexer_test_SOURCES = sublexer_test.cpp ../sublexer_impl.cpp ../simpletest.cpp ../utf8_string.cpp ../utf8.cpp \
- ../lexeme_impl.cpp ../delimiter.cpp
      ../lexeme_impl.cpp ../delimiter.cpp
 
 parser_test_SOURCES = parser_test.cpp ../sublexer_impl.cpp ../simpletest.cpp ../utf8.cpp ../utf8_string.cpp \
../lexeme_impl.cpp ../parser.cpp ../delimiter.cpp ../textarrayformat.cpp
      ../lexeme_impl.cpp ../parser.cpp ../delimiter.cpp ../textarrayformat.cpp ../lexer.cpp
 
 check_PROGRANS = $(bin_PROGRAMS)
 TESTS = $(bin_PROGRAMS)
@@ -310,19 +314,19 @@ include ./$(DEPDIR)/utf8_test.Po
 #      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
 #      $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
-lexer.o: ../lexer.cpp
-       $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lexer.o -MD -MP -MF $(DEPDIR)/lexer.Tpo -c -o lexer.o `test -f '../lexer.cpp' || echo '$(srcdir)/'`../lexer.cpp
-       mv -f $(DEPDIR)/lexer.Tpo $(DEPDIR)/lexer.Po
-#      source='../lexer.cpp' object='lexer.o' libtool=no \
+utf8_string.o: ../utf8_string.cpp
+       $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT utf8_string.o -MD -MP -MF $(DEPDIR)/utf8_string.Tpo -c -o utf8_string.o `test -f '../utf8_string.cpp' || echo '$(srcdir)/'`../utf8_string.cpp
+       mv -f $(DEPDIR)/utf8_string.Tpo $(DEPDIR)/utf8_string.Po
+#      source='../utf8_string.cpp' object='utf8_string.o' libtool=no \
 #      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
-#      $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lexer.o `test -f '../lexer.cpp' || echo '$(srcdir)/'`../lexer.cpp
+#      $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o utf8_string.o `test -f '../utf8_string.cpp' || echo '$(srcdir)/'`../utf8_string.cpp
 
-lexer.obj: ../lexer.cpp
-       $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lexer.obj -MD -MP -MF $(DEPDIR)/lexer.Tpo -c -o lexer.obj `if test -f '../lexer.cpp'; then $(CYGPATH_W) '../lexer.cpp'; else $(CYGPATH_W) '$(srcdir)/../lexer.cpp'; fi`
-       mv -f $(DEPDIR)/lexer.Tpo $(DEPDIR)/lexer.Po
-#      source='../lexer.cpp' object='lexer.obj' libtool=no \
+utf8_string.obj: ../utf8_string.cpp
+       $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT utf8_string.obj -MD -MP -MF $(DEPDIR)/utf8_string.Tpo -c -o utf8_string.obj `if test -f '../utf8_string.cpp'; then $(CYGPATH_W) '../utf8_string.cpp'; else $(CYGPATH_W) '$(srcdir)/../utf8_string.cpp'; fi`
+       mv -f $(DEPDIR)/utf8_string.Tpo $(DEPDIR)/utf8_string.Po
+#      source='../utf8_string.cpp' object='utf8_string.obj' libtool=no \
 #      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
-#      $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lexer.obj `if test -f '../lexer.cpp'; then $(CYGPATH_W) '../lexer.cpp'; else $(CYGPATH_W) '$(srcdir)/../lexer.cpp'; fi`
+#      $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o utf8_string.obj `if test -f '../utf8_string.cpp'; then $(CYGPATH_W) '../utf8_string.cpp'; else $(CYGPATH_W) '$(srcdir)/../utf8_string.cpp'; fi`
 
 simpletest.o: ../simpletest.cpp
        $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT simpletest.o -MD -MP -MF $(DEPDIR)/simpletest.Tpo -c -o simpletest.o `test -f '../simpletest.cpp' || echo '$(srcdir)/'`../simpletest.cpp
@@ -338,20 +342,6 @@ simpletest.obj: ../simpletest.cpp
 #      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
 #      $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o simpletest.obj `if test -f '../simpletest.cpp'; then $(CYGPATH_W) '../simpletest.cpp'; else $(CYGPATH_W) '$(srcdir)/../simpletest.cpp'; fi`
 
-utf8_string.o: ../utf8_string.cpp
-       $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT utf8_string.o -MD -MP -MF $(DEPDIR)/utf8_string.Tpo -c -o utf8_string.o `test -f '../utf8_string.cpp' || echo '$(srcdir)/'`../utf8_string.cpp
-       mv -f $(DEPDIR)/utf8_string.Tpo $(DEPDIR)/utf8_string.Po
-#      source='../utf8_string.cpp' object='utf8_string.o' libtool=no \
-#      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
-#      $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o utf8_string.o `test -f '../utf8_string.cpp' || echo '$(srcdir)/'`../utf8_string.cpp
-
-utf8_string.obj: ../utf8_string.cpp
-       $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT utf8_string.obj -MD -MP -MF $(DEPDIR)/utf8_string.Tpo -c -o utf8_string.obj `if test -f '../utf8_string.cpp'; then $(CYGPATH_W) '../utf8_string.cpp'; else $(CYGPATH_W) '$(srcdir)/../utf8_string.cpp'; fi`
-       mv -f $(DEPDIR)/utf8_string.Tpo $(DEPDIR)/utf8_string.Po
-#      source='../utf8_string.cpp' object='utf8_string.obj' libtool=no \
-#      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
-#      $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o utf8_string.obj `if test -f '../utf8_string.cpp'; then $(CYGPATH_W) '../utf8_string.cpp'; else $(CYGPATH_W) '$(srcdir)/../utf8_string.cpp'; fi`
-
 utf8.o: ../utf8.cpp
        $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT utf8.o -MD -MP -MF $(DEPDIR)/utf8.Tpo -c -o utf8.o `test -f '../utf8.cpp' || echo '$(srcdir)/'`../utf8.cpp
        mv -f $(DEPDIR)/utf8.Tpo $(DEPDIR)/utf8.Po
@@ -380,20 +370,6 @@ textarrayformat.obj: ../textarrayformat.cpp
 #      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
 #      $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o textarrayformat.obj `if test -f '../textarrayformat.cpp'; then $(CYGPATH_W) '../textarrayformat.cpp'; else $(CYGPATH_W) '$(srcdir)/../textarrayformat.cpp'; fi`
 
-sublexer_impl.o: ../sublexer_impl.cpp
-       $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sublexer_impl.o -MD -MP -MF $(DEPDIR)/sublexer_impl.Tpo -c -o sublexer_impl.o `test -f '../sublexer_impl.cpp' || echo '$(srcdir)/'`../sublexer_impl.cpp
-       mv -f $(DEPDIR)/sublexer_impl.Tpo $(DEPDIR)/sublexer_impl.Po
-#      source='../sublexer_impl.cpp' object='sublexer_impl.o' libtool=no \
-#      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
-#      $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sublexer_impl.o `test -f '../sublexer_impl.cpp' || echo '$(srcdir)/'`../sublexer_impl.cpp
-
-sublexer_impl.obj: ../sublexer_impl.cpp
-       $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sublexer_impl.obj -MD -MP -MF $(DEPDIR)/sublexer_impl.Tpo -c -o sublexer_impl.obj `if test -f '../sublexer_impl.cpp'; then $(CYGPATH_W) '../sublexer_impl.cpp'; else $(CYGPATH_W) '$(srcdir)/../sublexer_impl.cpp'; fi`
-       mv -f $(DEPDIR)/sublexer_impl.Tpo $(DEPDIR)/sublexer_impl.Po
-#      source='../sublexer_impl.cpp' object='sublexer_impl.obj' libtool=no \
-#      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
-#      $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sublexer_impl.obj `if test -f '../sublexer_impl.cpp'; then $(CYGPATH_W) '../sublexer_impl.cpp'; else $(CYGPATH_W) '$(srcdir)/../sublexer_impl.cpp'; fi`
-
 lexeme_impl.o: ../lexeme_impl.cpp
        $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lexeme_impl.o -MD -MP -MF $(DEPDIR)/lexeme_impl.Tpo -c -o lexeme_impl.o `test -f '../lexeme_impl.cpp' || echo '$(srcdir)/'`../lexeme_impl.cpp
        mv -f $(DEPDIR)/lexeme_impl.Tpo $(DEPDIR)/lexeme_impl.Po
@@ -422,6 +398,34 @@ delimiter.obj: ../delimiter.cpp
 #      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
 #      $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o delimiter.obj `if test -f '../delimiter.cpp'; then $(CYGPATH_W) '../delimiter.cpp'; else $(CYGPATH_W) '$(srcdir)/../delimiter.cpp'; fi`
 
+sublexer_impl.o: ../sublexer_impl.cpp
+       $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sublexer_impl.o -MD -MP -MF $(DEPDIR)/sublexer_impl.Tpo -c -o sublexer_impl.o `test -f '../sublexer_impl.cpp' || echo '$(srcdir)/'`../sublexer_impl.cpp
+       mv -f $(DEPDIR)/sublexer_impl.Tpo $(DEPDIR)/sublexer_impl.Po
+#      source='../sublexer_impl.cpp' object='sublexer_impl.o' libtool=no \
+#      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#      $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sublexer_impl.o `test -f '../sublexer_impl.cpp' || echo '$(srcdir)/'`../sublexer_impl.cpp
+
+sublexer_impl.obj: ../sublexer_impl.cpp
+       $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sublexer_impl.obj -MD -MP -MF $(DEPDIR)/sublexer_impl.Tpo -c -o sublexer_impl.obj `if test -f '../sublexer_impl.cpp'; then $(CYGPATH_W) '../sublexer_impl.cpp'; else $(CYGPATH_W) '$(srcdir)/../sublexer_impl.cpp'; fi`
+       mv -f $(DEPDIR)/sublexer_impl.Tpo $(DEPDIR)/sublexer_impl.Po
+#      source='../sublexer_impl.cpp' object='sublexer_impl.obj' libtool=no \
+#      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#      $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sublexer_impl.obj `if test -f '../sublexer_impl.cpp'; then $(CYGPATH_W) '../sublexer_impl.cpp'; else $(CYGPATH_W) '$(srcdir)/../sublexer_impl.cpp'; fi`
+
+lexer.o: ../lexer.cpp
+       $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lexer.o -MD -MP -MF $(DEPDIR)/lexer.Tpo -c -o lexer.o `test -f '../lexer.cpp' || echo '$(srcdir)/'`../lexer.cpp
+       mv -f $(DEPDIR)/lexer.Tpo $(DEPDIR)/lexer.Po
+#      source='../lexer.cpp' object='lexer.o' libtool=no \
+#      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#      $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lexer.o `test -f '../lexer.cpp' || echo '$(srcdir)/'`../lexer.cpp
+
+lexer.obj: ../lexer.cpp
+       $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lexer.obj -MD -MP -MF $(DEPDIR)/lexer.Tpo -c -o lexer.obj `if test -f '../lexer.cpp'; then $(CYGPATH_W) '../lexer.cpp'; else $(CYGPATH_W) '$(srcdir)/../lexer.cpp'; fi`
+       mv -f $(DEPDIR)/lexer.Tpo $(DEPDIR)/lexer.Po
+#      source='../lexer.cpp' object='lexer.obj' libtool=no \
+#      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#      $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lexer.obj `if test -f '../lexer.cpp'; then $(CYGPATH_W) '../lexer.cpp'; else $(CYGPATH_W) '$(srcdir)/../lexer.cpp'; fi`
+
 parser.o: ../parser.cpp
        $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT parser.o -MD -MP -MF $(DEPDIR)/parser.Tpo -c -o parser.o `test -f '../parser.cpp' || echo '$(srcdir)/'`../parser.cpp
        mv -f $(DEPDIR)/parser.Tpo $(DEPDIR)/parser.Po
index a5bf730..b90505d 100755 (executable)
@@ -1,18 +1,18 @@
 # 警告レベルを最大にする。
-AM_CPPFLAGS = -Wall
-INCLUDES = -l$(top_srcdir)
+AM_CPPFLAGS = -Wall -pg
+INCLUDES = -I$(top_srcdir)
 
 bin_PROGRAMS = utf8_test textarrayformat_test utf8_string_test lexer_test sublexer_test parser_test
 
 utf8_string_test_SOURCES = utf8_string_test.cpp ../utf8_string.cpp ../simpletest.cpp ../utf8.cpp
 utf8_test_SOURCES = utf8_test.cpp ../utf8.cpp ../simpletest.cpp
 textarrayformat_test_SOURCES = textarrayformat_test.cpp ../textarrayformat.cpp ../simpletest.cpp
-lexer_test_SOURCES = lexer_test.cpp ../lexer.cpp  ../simpletest.cpp ../utf8_string.cpp ../utf8.cpp \
../textarrayformat.cpp ../sublexer_impl.cpp ../lexeme_impl.cpp ../delimiter.cpp
+lexer_test_SOURCES = ../lexeme_id.h lexer_test.cpp ../utf8_string.cpp ../simpletest.cpp ../utf8.cpp ../textarrayformat.cpp ../lexeme_impl.cpp \
       ../delimiter.cpp  ../sublexer_impl.cpp  ../lexer.cpp
 sublexer_test_SOURCES = sublexer_test.cpp ../sublexer_impl.cpp ../simpletest.cpp ../utf8_string.cpp ../utf8.cpp \
- ../lexeme_impl.cpp ../delimiter.cpp
      ../lexeme_impl.cpp ../delimiter.cpp
 parser_test_SOURCES = parser_test.cpp ../sublexer_impl.cpp ../simpletest.cpp ../utf8.cpp ../utf8_string.cpp \
../lexeme_impl.cpp ../parser.cpp ../delimiter.cpp ../textarrayformat.cpp
      ../lexeme_impl.cpp ../parser.cpp ../delimiter.cpp ../textarrayformat.cpp ../lexer.cpp
 
 check_PROGRANS = $(bin_PROGRAMS)
 TESTS = $(bin_PROGRAMS)
index a31ae88..77cf2de 100644 (file)
@@ -45,16 +45,16 @@ CONFIG_CLEAN_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)"
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS)
-am_lexer_test_OBJECTS = lexer_test.$(OBJEXT) lexer.$(OBJEXT) \
-       simpletest.$(OBJEXT) utf8_string.$(OBJEXT) utf8.$(OBJEXT) \
-       textarrayformat.$(OBJEXT) sublexer_impl.$(OBJEXT) \
-       lexeme_impl.$(OBJEXT) delimiter.$(OBJEXT)
+am_lexer_test_OBJECTS = lexer_test.$(OBJEXT) utf8_string.$(OBJEXT) \
+       simpletest.$(OBJEXT) utf8.$(OBJEXT) textarrayformat.$(OBJEXT) \
+       lexeme_impl.$(OBJEXT) delimiter.$(OBJEXT) \
+       sublexer_impl.$(OBJEXT) lexer.$(OBJEXT)
 lexer_test_OBJECTS = $(am_lexer_test_OBJECTS)
 lexer_test_LDADD = $(LDADD)
 am_parser_test_OBJECTS = parser_test.$(OBJEXT) sublexer_impl.$(OBJEXT) \
        simpletest.$(OBJEXT) utf8.$(OBJEXT) utf8_string.$(OBJEXT) \
        lexeme_impl.$(OBJEXT) parser.$(OBJEXT) delimiter.$(OBJEXT) \
-       textarrayformat.$(OBJEXT)
+       textarrayformat.$(OBJEXT) lexer.$(OBJEXT)
 parser_test_OBJECTS = $(am_parser_test_OBJECTS)
 parser_test_LDADD = $(LDADD)
 am_sublexer_test_OBJECTS = sublexer_test.$(OBJEXT) \
@@ -83,6 +83,10 @@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 CXXLD = $(CXX)
 CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
        -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(lexer_test_SOURCES) $(parser_test_SOURCES) \
        $(sublexer_test_SOURCES) $(textarrayformat_test_SOURCES) \
        $(utf8_string_test_SOURCES) $(utf8_test_SOURCES)
@@ -183,19 +187,19 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 # 警告レベルを最大にする。
-AM_CPPFLAGS = -Wall
-INCLUDES = -l$(top_srcdir)
+AM_CPPFLAGS = -Wall -pg
+INCLUDES = -I$(top_srcdir)
 utf8_string_test_SOURCES = utf8_string_test.cpp ../utf8_string.cpp ../simpletest.cpp ../utf8.cpp
 utf8_test_SOURCES = utf8_test.cpp ../utf8.cpp ../simpletest.cpp
 textarrayformat_test_SOURCES = textarrayformat_test.cpp ../textarrayformat.cpp ../simpletest.cpp
-lexer_test_SOURCES = lexer_test.cpp ../lexer.cpp  ../simpletest.cpp ../utf8_string.cpp ../utf8.cpp \
../textarrayformat.cpp ../sublexer_impl.cpp ../lexeme_impl.cpp ../delimiter.cpp
+lexer_test_SOURCES = ../lexeme_id.h lexer_test.cpp ../utf8_string.cpp ../simpletest.cpp ../utf8.cpp ../textarrayformat.cpp ../lexeme_impl.cpp \
       ../delimiter.cpp  ../sublexer_impl.cpp  ../lexer.cpp
 
 sublexer_test_SOURCES = sublexer_test.cpp ../sublexer_impl.cpp ../simpletest.cpp ../utf8_string.cpp ../utf8.cpp \
- ../lexeme_impl.cpp ../delimiter.cpp
      ../lexeme_impl.cpp ../delimiter.cpp
 
 parser_test_SOURCES = parser_test.cpp ../sublexer_impl.cpp ../simpletest.cpp ../utf8.cpp ../utf8_string.cpp \
../lexeme_impl.cpp ../parser.cpp ../delimiter.cpp ../textarrayformat.cpp
      ../lexeme_impl.cpp ../parser.cpp ../delimiter.cpp ../textarrayformat.cpp ../lexer.cpp
 
 check_PROGRANS = $(bin_PROGRAMS)
 TESTS = $(bin_PROGRAMS)
@@ -310,19 +314,19 @@ distclean-compile:
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
-lexer.o: ../lexer.cpp
-@am__fastdepCXX_TRUE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lexer.o -MD -MP -MF $(DEPDIR)/lexer.Tpo -c -o lexer.o `test -f '../lexer.cpp' || echo '$(srcdir)/'`../lexer.cpp
-@am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/lexer.Tpo $(DEPDIR)/lexer.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='../lexer.cpp' object='lexer.o' libtool=no @AMDEPBACKSLASH@
+utf8_string.o: ../utf8_string.cpp
+@am__fastdepCXX_TRUE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT utf8_string.o -MD -MP -MF $(DEPDIR)/utf8_string.Tpo -c -o utf8_string.o `test -f '../utf8_string.cpp' || echo '$(srcdir)/'`../utf8_string.cpp
+@am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/utf8_string.Tpo $(DEPDIR)/utf8_string.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='../utf8_string.cpp' object='utf8_string.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lexer.o `test -f '../lexer.cpp' || echo '$(srcdir)/'`../lexer.cpp
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o utf8_string.o `test -f '../utf8_string.cpp' || echo '$(srcdir)/'`../utf8_string.cpp
 
-lexer.obj: ../lexer.cpp
-@am__fastdepCXX_TRUE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lexer.obj -MD -MP -MF $(DEPDIR)/lexer.Tpo -c -o lexer.obj `if test -f '../lexer.cpp'; then $(CYGPATH_W) '../lexer.cpp'; else $(CYGPATH_W) '$(srcdir)/../lexer.cpp'; fi`
-@am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/lexer.Tpo $(DEPDIR)/lexer.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='../lexer.cpp' object='lexer.obj' libtool=no @AMDEPBACKSLASH@
+utf8_string.obj: ../utf8_string.cpp
+@am__fastdepCXX_TRUE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT utf8_string.obj -MD -MP -MF $(DEPDIR)/utf8_string.Tpo -c -o utf8_string.obj `if test -f '../utf8_string.cpp'; then $(CYGPATH_W) '../utf8_string.cpp'; else $(CYGPATH_W) '$(srcdir)/../utf8_string.cpp'; fi`
+@am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/utf8_string.Tpo $(DEPDIR)/utf8_string.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='../utf8_string.cpp' object='utf8_string.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lexer.obj `if test -f '../lexer.cpp'; then $(CYGPATH_W) '../lexer.cpp'; else $(CYGPATH_W) '$(srcdir)/../lexer.cpp'; fi`
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o utf8_string.obj `if test -f '../utf8_string.cpp'; then $(CYGPATH_W) '../utf8_string.cpp'; else $(CYGPATH_W) '$(srcdir)/../utf8_string.cpp'; fi`
 
 simpletest.o: ../simpletest.cpp
 @am__fastdepCXX_TRUE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT simpletest.o -MD -MP -MF $(DEPDIR)/simpletest.Tpo -c -o simpletest.o `test -f '../simpletest.cpp' || echo '$(srcdir)/'`../simpletest.cpp
@@ -338,20 +342,6 @@ simpletest.obj: ../simpletest.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o simpletest.obj `if test -f '../simpletest.cpp'; then $(CYGPATH_W) '../simpletest.cpp'; else $(CYGPATH_W) '$(srcdir)/../simpletest.cpp'; fi`
 
-utf8_string.o: ../utf8_string.cpp
-@am__fastdepCXX_TRUE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT utf8_string.o -MD -MP -MF $(DEPDIR)/utf8_string.Tpo -c -o utf8_string.o `test -f '../utf8_string.cpp' || echo '$(srcdir)/'`../utf8_string.cpp
-@am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/utf8_string.Tpo $(DEPDIR)/utf8_string.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='../utf8_string.cpp' object='utf8_string.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o utf8_string.o `test -f '../utf8_string.cpp' || echo '$(srcdir)/'`../utf8_string.cpp
-
-utf8_string.obj: ../utf8_string.cpp
-@am__fastdepCXX_TRUE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT utf8_string.obj -MD -MP -MF $(DEPDIR)/utf8_string.Tpo -c -o utf8_string.obj `if test -f '../utf8_string.cpp'; then $(CYGPATH_W) '../utf8_string.cpp'; else $(CYGPATH_W) '$(srcdir)/../utf8_string.cpp'; fi`
-@am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/utf8_string.Tpo $(DEPDIR)/utf8_string.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='../utf8_string.cpp' object='utf8_string.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o utf8_string.obj `if test -f '../utf8_string.cpp'; then $(CYGPATH_W) '../utf8_string.cpp'; else $(CYGPATH_W) '$(srcdir)/../utf8_string.cpp'; fi`
-
 utf8.o: ../utf8.cpp
 @am__fastdepCXX_TRUE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT utf8.o -MD -MP -MF $(DEPDIR)/utf8.Tpo -c -o utf8.o `test -f '../utf8.cpp' || echo '$(srcdir)/'`../utf8.cpp
 @am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/utf8.Tpo $(DEPDIR)/utf8.Po
@@ -380,20 +370,6 @@ textarrayformat.obj: ../textarrayformat.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o textarrayformat.obj `if test -f '../textarrayformat.cpp'; then $(CYGPATH_W) '../textarrayformat.cpp'; else $(CYGPATH_W) '$(srcdir)/../textarrayformat.cpp'; fi`
 
-sublexer_impl.o: ../sublexer_impl.cpp
-@am__fastdepCXX_TRUE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sublexer_impl.o -MD -MP -MF $(DEPDIR)/sublexer_impl.Tpo -c -o sublexer_impl.o `test -f '../sublexer_impl.cpp' || echo '$(srcdir)/'`../sublexer_impl.cpp
-@am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/sublexer_impl.Tpo $(DEPDIR)/sublexer_impl.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='../sublexer_impl.cpp' object='sublexer_impl.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sublexer_impl.o `test -f '../sublexer_impl.cpp' || echo '$(srcdir)/'`../sublexer_impl.cpp
-
-sublexer_impl.obj: ../sublexer_impl.cpp
-@am__fastdepCXX_TRUE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sublexer_impl.obj -MD -MP -MF $(DEPDIR)/sublexer_impl.Tpo -c -o sublexer_impl.obj `if test -f '../sublexer_impl.cpp'; then $(CYGPATH_W) '../sublexer_impl.cpp'; else $(CYGPATH_W) '$(srcdir)/../sublexer_impl.cpp'; fi`
-@am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/sublexer_impl.Tpo $(DEPDIR)/sublexer_impl.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='../sublexer_impl.cpp' object='sublexer_impl.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sublexer_impl.obj `if test -f '../sublexer_impl.cpp'; then $(CYGPATH_W) '../sublexer_impl.cpp'; else $(CYGPATH_W) '$(srcdir)/../sublexer_impl.cpp'; fi`
-
 lexeme_impl.o: ../lexeme_impl.cpp
 @am__fastdepCXX_TRUE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lexeme_impl.o -MD -MP -MF $(DEPDIR)/lexeme_impl.Tpo -c -o lexeme_impl.o `test -f '../lexeme_impl.cpp' || echo '$(srcdir)/'`../lexeme_impl.cpp
 @am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/lexeme_impl.Tpo $(DEPDIR)/lexeme_impl.Po
@@ -422,6 +398,34 @@ delimiter.obj: ../delimiter.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o delimiter.obj `if test -f '../delimiter.cpp'; then $(CYGPATH_W) '../delimiter.cpp'; else $(CYGPATH_W) '$(srcdir)/../delimiter.cpp'; fi`
 
+sublexer_impl.o: ../sublexer_impl.cpp
+@am__fastdepCXX_TRUE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sublexer_impl.o -MD -MP -MF $(DEPDIR)/sublexer_impl.Tpo -c -o sublexer_impl.o `test -f '../sublexer_impl.cpp' || echo '$(srcdir)/'`../sublexer_impl.cpp
+@am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/sublexer_impl.Tpo $(DEPDIR)/sublexer_impl.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='../sublexer_impl.cpp' object='sublexer_impl.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sublexer_impl.o `test -f '../sublexer_impl.cpp' || echo '$(srcdir)/'`../sublexer_impl.cpp
+
+sublexer_impl.obj: ../sublexer_impl.cpp
+@am__fastdepCXX_TRUE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sublexer_impl.obj -MD -MP -MF $(DEPDIR)/sublexer_impl.Tpo -c -o sublexer_impl.obj `if test -f '../sublexer_impl.cpp'; then $(CYGPATH_W) '../sublexer_impl.cpp'; else $(CYGPATH_W) '$(srcdir)/../sublexer_impl.cpp'; fi`
+@am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/sublexer_impl.Tpo $(DEPDIR)/sublexer_impl.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='../sublexer_impl.cpp' object='sublexer_impl.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sublexer_impl.obj `if test -f '../sublexer_impl.cpp'; then $(CYGPATH_W) '../sublexer_impl.cpp'; else $(CYGPATH_W) '$(srcdir)/../sublexer_impl.cpp'; fi`
+
+lexer.o: ../lexer.cpp
+@am__fastdepCXX_TRUE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lexer.o -MD -MP -MF $(DEPDIR)/lexer.Tpo -c -o lexer.o `test -f '../lexer.cpp' || echo '$(srcdir)/'`../lexer.cpp
+@am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/lexer.Tpo $(DEPDIR)/lexer.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='../lexer.cpp' object='lexer.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lexer.o `test -f '../lexer.cpp' || echo '$(srcdir)/'`../lexer.cpp
+
+lexer.obj: ../lexer.cpp
+@am__fastdepCXX_TRUE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lexer.obj -MD -MP -MF $(DEPDIR)/lexer.Tpo -c -o lexer.obj `if test -f '../lexer.cpp'; then $(CYGPATH_W) '../lexer.cpp'; else $(CYGPATH_W) '$(srcdir)/../lexer.cpp'; fi`
+@am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/lexer.Tpo $(DEPDIR)/lexer.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='../lexer.cpp' object='lexer.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lexer.obj `if test -f '../lexer.cpp'; then $(CYGPATH_W) '../lexer.cpp'; else $(CYGPATH_W) '$(srcdir)/../lexer.cpp'; fi`
+
 parser.o: ../parser.cpp
 @am__fastdepCXX_TRUE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT parser.o -MD -MP -MF $(DEPDIR)/parser.Tpo -c -o parser.o `test -f '../parser.cpp' || echo '$(srcdir)/'`../parser.cpp
 @am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/parser.Tpo $(DEPDIR)/parser.Po
index d4ac231..d9cda88 100755 (executable)
@@ -6,10 +6,10 @@
 #include "../simpletest.h"
 
 #include "../textarrayformat.h"
+#include "../lexeme_id.h"
 #include "../utf8.h"
 #include "../lexer.h"
 #include "../lexeme.h"
-#include "../lexeme_id.h"
 
 using namespace std;
 using namespace utakata;
@@ -28,26 +28,25 @@ bool lexer_test(smart_ptr<simpletest::SimpleTestAsserter> asserter)
     utakata::lexer::Lexer lexer;
 
     smart_ptr<lexeme::ILexeme> m(lexer.lex(st));
-    asserter->check(m->toString()->toStr(), "(");
-
-    asserter->check(m->getID(), lexeme::LexemeID::openParenthesis, "open paren");
+    asserter->checkOnly(m->toString()->toStr(), "(");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::openParenthesis, "open paren");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::identifier, "identifier");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::identifier, "identifier");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::number, "number");
+    asserter->checkOnly(m->getID().toEnum(), lexeme::LexemeID::number.toEnum(), "number");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::string, "string");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::string, "string");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::closeParenthesis, "close");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::closeParenthesis, "close");
 
     // ここで終了しているはず。EOFの状態から実行されると、EOFのIDを持った
     // lexemeが返される。
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::eos, "eos");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::eos, "eos");
     
     return asserter->isOk();
 }
@@ -66,48 +65,48 @@ bool lexer_test2(smart_ptr<simpletest::SimpleTestAsserter> asserter)
     utakata::lexer::Lexer lexer;
 
     smart_ptr<lexeme::ILexeme> m(lexer.lex(st));
-    asserter->check(m->toString()->toStr(), ",@");
+    asserter->checkOnly(m->toString()->toStr(), ",@");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::openParenthesis, "open paren");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::openParenthesis, "open paren");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::identifier, "identifier");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::identifier, "identifier");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::number, "number");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::number, "number");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::backquote, "back quote");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::backquote, "back quote");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::openParenthesis, "open paren2");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::openParenthesis, "open paren2");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::identifier, "identifier2");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::identifier, "identifier2");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::closeParenthesis, "close");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::closeParenthesis, "close");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::quote, "quote");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::quote, "quote");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::identifier, "identifier2");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::identifier, "identifier2");
 
     // booleanの解析が行えるかどうか。
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::quote, "boolean:false");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::boolean, "boolean:false");
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::identifier, "boolean:true");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::boolean, "boolean:true");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::closeParenthesis, "close");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::closeParenthesis, "close");
 
     // ここで終了しているはず。EOFの状態から実行されると、EOFのIDを持った
     // lexemeが返される。
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::eos, "eos");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::eos, "eos");
     
     return asserter->isOk();
 }
@@ -127,65 +126,65 @@ bool lexer_test3(smart_ptr<simpletest::SimpleTestAsserter> asserter)
     utakata::lexer::Lexer lexer;
 
     smart_ptr<lexeme::ILexeme> m(lexer.lex(st));
-    asserter->check(m->toString()->toStr(), "#'");
+    asserter->checkOnly(m->toString()->toStr(), "#'");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::openParenthesis, "open paren");
+    asserter->checkOnly(lexeme::LexemeID::openParenthesis, m->getID(), "open paren");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::identifier, "identifier");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::identifier, "identifier");
 
     m = lexer.lex(st);
-    asserter->check(m->toString()->toStr(), "#,");
-    asserter->check(m->getID(), lexeme::LexemeID::unsyntax, "unsyntax");
+    asserter->checkOnly(m->toString()->toStr(), "#,");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::unsyntax, "unsyntax");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::number, "number");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::number, "number");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::quasiSyntax, "quasi syntax");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::quasiSyntax, "quasi syntax");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::openParenthesis, "open paren2");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::openParenthesis, "open paren2");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::identifier, "identifier2");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::identifier, "identifier2");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::closeParenthesis, "close");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::closeParenthesis, "close");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::quote, "quote");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::quote, "quote");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::identifier, "identifier2");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::identifier, "identifier2");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::closeParenthesis, "close");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::closeParenthesis, "close");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::identifier, "identifier3");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::identifier, "identifier3");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::byteVector, "byteVector");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::byteVector, "byteVector");
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::number, "byteVector:number1");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::number, "byteVector:number1");
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::number, "byteVector:number2");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::number, "byteVector:number2");
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::closeParenthesis, "close");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::closeParenthesis, "close");
 
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::vector, "vector");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::vector, "vector");
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::identifier, "vector:identifier");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::identifier, "vector:identifier");
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::closeParenthesis, "close");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::closeParenthesis, "close");
     
     // ここで終了しているはず。EOFの状態から実行されると、EOFのIDを持った
     // lexemeが返される。
     m = lexer.lex(st);
-    asserter->check(m->getID(), lexeme::LexemeID::eos, "eos");
+    asserter->checkOnly(m->getID(), lexeme::LexemeID::eos, "eos");
     
     return asserter->isOk();
 }
index b0a8a3c..5cc10e3 100755 (executable)
Binary files a/test/textarrayformat_test and b/test/textarrayformat_test differ
index 2158fdc..97149ab 100755 (executable)
Binary files a/test/utf8_string_test and b/test/utf8_string_test differ
index 367fbb6..c309c41 100755 (executable)
Binary files a/test/utf8_test and b/test/utf8_test differ