CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CPP = gcc -E
-CPPFLAGS = -Wall
+CPPFLAGS =
CXX = g++
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2
top_build_prefix =
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
+utakata_SOURCES = main.cpp vm.cpp operand.cpp cpu.cpp utf8.cpp \
+ TextArrayFormat.cpp utf8_string.cpp
+
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
+AM_CPPFLAGS = -Wall
SUBDIRS = . test
INCLUDES = -l$(top_srcdir)
bin_PROGRAMS = utakata
-utakata_SOURCES = main.cpp vm.cpp operand.cpp cpu.cpp utf8.cpp TextArrayFormat.cpp utf8_string.cpp
+utakata_SOURCES = main.cpp vm.cpp operand.cpp cpu.cpp utf8.cpp \
+ TextArrayFormat.cpp utf8_string.cpp
top_build_prefix = @top_build_prefix@
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
+utakata_SOURCES = main.cpp vm.cpp operand.cpp cpu.cpp utf8.cpp \
+ TextArrayFormat.cpp utf8_string.cpp
+
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
hostname = localhost
uname -m = i686
-uname -r = 2.6.28-gentoo-r5
+uname -r = 2.6.29-gentoo-r5
uname -s = Linux
-uname -v = #2 SMP Sun May 24 20:35:46 JST 2009
+uname -v = #5 SMP Sat Jun 6 17:06:52 JST 2009
/usr/bin/uname -p = Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
/bin/uname -X = unknown
/bin/universe = unknown
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.3.2
+PATH: /usr/qt/3/bin
## ----------- ##
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
configure:2404: result: g++
configure:2431: checking for C++ compiler version
configure:2439: g++ --version >&5
-g++ (GCC) 4.1.2 (Gentoo 4.1.2 p1.0.2)
-Copyright (C) 2006 Free Software Foundation, Inc.
+g++ (Gentoo 4.3.2-r3 p1.6, pie-10.1.5) 4.3.2
+Copyright (C) 2008 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.
configure:2450: g++ -v >&5
Using built-in specs.
Target: i686-pc-linux-gnu
-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
+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'
Thread model: posix
-gcc version 4.1.2 (Gentoo 4.1.2 p1.0.2)
+gcc version 4.3.2 (Gentoo 4.3.2-r3 p1.6, pie-10.1.5)
configure:2454: $? = 0
configure:2461: g++ -V >&5
g++: '-V' option must have argument
configure:3186: result: gcc
configure:3418: checking for C compiler version
configure:3426: gcc --version >&5
-gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.0.2)
-Copyright (C) 2006 Free Software Foundation, Inc.
+gcc (Gentoo 4.3.2-r3 p1.6, pie-10.1.5) 4.3.2
+Copyright (C) 2008 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.
configure:3437: gcc -v >&5
Using built-in specs.
Target: i686-pc-linux-gnu
-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
+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'
Thread model: posix
-gcc version 4.1.2 (Gentoo 4.1.2 p1.0.2)
+gcc version 4.3.2 (Gentoo 4.3.2-r3 p1.6, pie-10.1.5)
configure:3441: $? = 0
configure:3448: gcc -V >&5
gcc: '-V' option must have argument
configure:3776: result: none needed
configure:3796: checking dependency style of gcc
configure:3887: result: gcc3
-configure:3914: checking how to run the C preprocessor
-configure:3954: gcc -E conftest.c
-configure:3961: $? = 0
-configure:3992: gcc -E conftest.c
+configure:3915: checking how to run the C preprocessor
+configure:3955: gcc -E conftest.c
+configure:3962: $? = 0
+configure:3993: gcc -E conftest.c
conftest.c:8:28: error: ac_nonexistent.h: No such file or directory
-configure:3999: $? = 1
+configure:4000: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "utakata"
| #define PACKAGE_BUGREPORT "BUG-REPORT-ADDRESS"
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
-configure:4032: result: gcc -E
-configure:4061: gcc -E conftest.c
-configure:4068: $? = 0
-configure:4099: gcc -E conftest.c
+configure:4033: result: gcc -E
+configure:4062: gcc -E conftest.c
+configure:4069: $? = 0
+configure:4100: gcc -E conftest.c
conftest.c:8:28: error: ac_nonexistent.h: No such file or directory
-configure:4106: $? = 1
+configure:4107: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "utakata"
| #define PACKAGE_BUGREPORT "BUG-REPORT-ADDRESS"
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
-configure:4146: checking for grep that handles long lines and -e
-configure:4206: result: /bin/grep
-configure:4211: checking for egrep
-configure:4275: result: /bin/grep -E
-configure:4280: checking for ANSI C header files
-configure:4310: gcc -c -g -O2 conftest.c >&5
-configure:4317: $? = 0
-configure:4416: gcc -o conftest -g -O2 conftest.c >&5
-configure:4420: $? = 0
-configure:4426: ./conftest
-configure:4430: $? = 0
-configure:4448: result: yes
-configure:4472: checking for sys/types.h
-configure:4493: gcc -c -g -O2 conftest.c >&5
-configure:4500: $? = 0
-configure:4517: result: yes
-configure:4472: checking for sys/stat.h
-configure:4493: gcc -c -g -O2 conftest.c >&5
-configure:4500: $? = 0
-configure:4517: result: yes
-configure:4472: checking for stdlib.h
-configure:4493: gcc -c -g -O2 conftest.c >&5
-configure:4500: $? = 0
-configure:4517: result: yes
-configure:4472: checking for string.h
-configure:4493: gcc -c -g -O2 conftest.c >&5
-configure:4500: $? = 0
-configure:4517: result: yes
-configure:4472: checking for memory.h
-configure:4493: gcc -c -g -O2 conftest.c >&5
-configure:4500: $? = 0
-configure:4517: result: yes
-configure:4472: checking for strings.h
-configure:4493: gcc -c -g -O2 conftest.c >&5
-configure:4500: $? = 0
-configure:4517: result: yes
-configure:4472: checking for inttypes.h
-configure:4493: gcc -c -g -O2 conftest.c >&5
-configure:4500: $? = 0
-configure:4517: result: yes
-configure:4472: checking for stdint.h
-configure:4493: gcc -c -g -O2 conftest.c >&5
-configure:4500: $? = 0
-configure:4517: result: yes
-configure:4472: checking for unistd.h
-configure:4493: gcc -c -g -O2 conftest.c >&5
-configure:4500: $? = 0
-configure:4517: result: yes
-configure:4531: checking for stdbool.h that conforms to C99
-configure:4626: gcc -c -g -O2 conftest.c >&5
-configure:4633: $? = 0
-configure:4648: result: yes
-configure:4650: checking for _Bool
-configure:4678: gcc -c -g -O2 conftest.c >&5
-configure:4685: $? = 0
-configure:4712: gcc -c -g -O2 conftest.c >&5
+configure:4147: checking for grep that handles long lines and -e
+configure:4207: result: /bin/grep
+configure:4212: checking for egrep
+configure:4276: result: /bin/grep -E
+configure:4281: checking for ANSI C header files
+configure:4311: gcc -c -g -O2 conftest.c >&5
+configure:4318: $? = 0
+configure:4417: gcc -o conftest -g -O2 conftest.c >&5
+configure:4421: $? = 0
+configure:4427: ./conftest
+configure:4431: $? = 0
+configure:4449: result: yes
+configure:4473: checking for sys/types.h
+configure:4494: gcc -c -g -O2 conftest.c >&5
+configure:4501: $? = 0
+configure:4518: result: yes
+configure:4473: checking for sys/stat.h
+configure:4494: gcc -c -g -O2 conftest.c >&5
+configure:4501: $? = 0
+configure:4518: result: yes
+configure:4473: checking for stdlib.h
+configure:4494: gcc -c -g -O2 conftest.c >&5
+configure:4501: $? = 0
+configure:4518: result: yes
+configure:4473: checking for string.h
+configure:4494: gcc -c -g -O2 conftest.c >&5
+configure:4501: $? = 0
+configure:4518: result: yes
+configure:4473: checking for memory.h
+configure:4494: gcc -c -g -O2 conftest.c >&5
+configure:4501: $? = 0
+configure:4518: result: yes
+configure:4473: checking for strings.h
+configure:4494: gcc -c -g -O2 conftest.c >&5
+configure:4501: $? = 0
+configure:4518: result: yes
+configure:4473: checking for inttypes.h
+configure:4494: gcc -c -g -O2 conftest.c >&5
+configure:4501: $? = 0
+configure:4518: result: yes
+configure:4473: checking for stdint.h
+configure:4494: gcc -c -g -O2 conftest.c >&5
+configure:4501: $? = 0
+configure:4518: result: yes
+configure:4473: checking for unistd.h
+configure:4494: gcc -c -g -O2 conftest.c >&5
+configure:4501: $? = 0
+configure:4518: result: yes
+configure:4532: checking for stdbool.h that conforms to C99
+configure:4627: gcc -c -g -O2 conftest.c >&5
+configure:4634: $? = 0
+configure:4649: result: yes
+configure:4651: checking for _Bool
+configure:4679: gcc -c -g -O2 conftest.c >&5
+configure:4686: $? = 0
+configure:4713: gcc -c -g -O2 conftest.c >&5
conftest.c: In function 'main':
conftest.c:54: error: expected expression before ')' token
-configure:4719: $? = 1
+configure:4720: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "utakata"
| ;
| return 0;
| }
-configure:4742: result: yes
-configure:4761: checking for inline
-configure:4787: gcc -c -g -O2 conftest.c >&5
-configure:4794: $? = 0
-configure:4812: result: inline
-configure:4831: checking for size_t
-configure:4859: gcc -c -g -O2 conftest.c >&5
-configure:4866: $? = 0
-configure:4893: gcc -c -g -O2 conftest.c >&5
+configure:4743: result: yes
+configure:4762: checking for inline
+configure:4788: gcc -c -g -O2 conftest.c >&5
+configure:4795: $? = 0
+configure:4813: result: inline
+configure:4832: checking for size_t
+configure:4860: gcc -c -g -O2 conftest.c >&5
+configure:4867: $? = 0
+configure:4894: gcc -c -g -O2 conftest.c >&5
conftest.c: In function 'main':
conftest.c:56: error: expected expression before ')' token
-configure:4900: $? = 1
+configure:4901: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "utakata"
| ;
| return 0;
| }
-configure:4923: result: yes
-configure:5063: creating ./config.status
+configure:4924: result: yes
+configure:5064: creating ./config.status
## ---------------------- ##
## Running config.status. ##
#define HAVE_STDBOOL_H 1
configure: exit 0
-
-## ---------------------- ##
-## 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
+
# Checks for libraries.
# Checks for header files.
AC_PROG_CXX
AC_PROG_CC
+
# Checks for libraries.
# Checks for header files.
#define _LEXEME_H_
#include "smart_ptr.h"
+#include "utf8_string.h"
namespace utakata {
namespace lexeme {
- class utakata::utf8_string::CUTF8InputStream;
- class utakata::utf8_string::CUTF8String;
- class CLexeme;
-
- // lexer名前空間で使用されるそれぞれの終端記号と
- // それらを解析するための関数オブジェクトを定義する。
-
- struct CIdentityLexer
- {
- /*
- <identifier>を解釈するためのfunctor。
- <identifier>は次のBNF構文で定義される。
-
- <identifier> - <initial> <subsequent>*
- | <peculiar identifier>
- */
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CInitialLexer
- {
- /*
- <initial>を解釈するためのfunctor。
- <initial>は次のBNF構文で定義される。
-
- <initial> - <constituent> | <special initial>
- | <inline hex escape>
- */
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CConstituentLexer
- {
- /*
- <constituent>を解釈するためのfunctor。
- <constituent>は次のBNF構文で定義される。
-
- <constituent> - <letter>
- | 〈any character whose Unicode scalar value is greater than
- 127, and whose category is Lu, Ll, Lt, Lm, Lo, Mn,
- Nl, No, Pd, Pc, Po, Sc, Sm, Sk, So, or Co〉
- */
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CLetterlexer
- {
- /*
- <letter>を解釈するためのfunctor。
- <letter>は次のBNF構文で定義される。
-
- <letter> - a | b | c | ... | z
- | A | B | C | ... | Z
- */
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CSpecialInitialLexer
- {
- /*
- <special initial>を解釈するためのfunctor。
- <special initial>は次のBNF構文で定義される。
- <special initial> - ! | $ | % | & | * | / | : | < | =
- | > | ? | ^ | _ | ~
-
- */
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CDigitlexer
- {
- /*
- <digit>を解釈するためのfunctor。
- <digit>は次のBNF構文で定義される。
- <digit> - 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
- */
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CHexDigitLexer
- {
- /*
- <hex digit>を解釈するためのfunctor。
- <hex digit>は次のBNF構文で定義される。
- <hex digit> - <digit>
- | a | A | b | B | c | C | d | D | e | E | f
- | F
- */
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CSpecialSubsequentLexer
- {
- /*
- <special subsequent>を解釈するためのfunctor。
- <special subsequent>は次のBNF構文で定義される。
- <special subsequent> → + | - | . | @
- */
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CInlineHexEscapeLexer
- {
- /*
- <inline hex escape>を解釈するためのfunctor
- <inline hex escape>は次のBNF構文で定義される。
- <inline hex escape> - \x<hex scalar value>;
- */
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CHexScalarValueLexer
- {
- //<hex scalar value>を解釈するためのfunctor。
- //<hex scalar value>は次のBNF構文で定義される。
- //<hex scalar value> - <hex digit>+
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CBooleanLexer
- {
- // <boolean>を解釈するためのfunctor。
- // <boolean>は次のBNF構文で定義される。
- // <boolean> - #t | #T | #f | #F
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CCharactorLexer
- {
- // <charactor>を解釈するためのfunctor。
- // <charactor>は次のBNF構文で定義される。
- // <character> - #\<any character>
- // | #\<character name>
- // | #\x<hex scalar value>
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CCharactorNameLexer
- {
-// <character name>を解釈するためのfunctor。
-// <charactor name>は次のBNF構文で定義される。
-// <character name> - nul | alarm | backspace | tab
-// | linefeed | newline | vtab | page | return
-// | esc | space | delete
-
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CStringlexer
- {
-// <string>を解釈するためのfunctor。
-// <string>は次のBNF構文で定義される。
-// <string> - " <string element>* "
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CStringElementLexer
- {
-// <string element>を解釈するためのfunctor。
-// <string element>は次のBNF構文で定義される。
-// <string element> - <any character other than " or \>
-// | \a | \b | \t | \n | \v | \f | \r
-// | \" | \\
-// | \<intraline whitespace>*<line ending>
-// <intraline whitespace>*
-// | <inline hex escape>
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CIntralineWhitespaceLexer
+ class ILexeme
{
-// <intraline whitespace>を解釈するためのfunctor。
-// <intraline whitespace>は次のBNF構文で定義される。
-// <intraline whitespace> - <character tabulation>
-// | <any character whose category is Zs>
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CDelimiterlexer
- {
-// <delimiter>を解釈するためのfunctor。
-// <delimiter>は次のBNF構文で定義される。
-// <delimiter> - ( | ) | [ | ] | " | ; | #
-// | <whitespace>
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CWhitespaceLexer
- {
-// <whitespace>を解釈するためのfunctor。
-// <whitespace>は次のBNF構文で定義される。
-// <whitespace> - <character tabulation>
-// | <linefeed> | <line tabulation> | <form feed>
-// | <carriage return> | <next line>
-// | <any character whose category is Zs, Zl, or Zp>
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CLineEndingLexer
- {
-// <line ending>を解釈するためのfunctor。
-// <line ending>は次のBNF構文で定義される。
-// <line ending> - <linefeed> | <carriage return>
-// | <carriage return> <linefeed> | <next line>
-// | <carriage return> <next line> | <line separator>
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CCommentLexer
- {
-// <comment>を解釈するためのfunctor。
-// <comment>は次のBNF構文で定義される。
-// <comment> - ; 〈all subsequent characters up to a
-// <line ending> or <paragraph separator>〉
-// | <nested comment>
-// | #; <interlexeme space> <datum>
-// | #!r6rs
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CNestedCommentLexer
- {
-// <nested comment>を解釈するためのfunctor。
-// <nested comment>は次のBNF構文で定義される。
-// <nested comment> - #| <comment text>
-// <comment cont>* |#
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CCommentTextLexer
- {
-// <comment text>を解釈するためのfunctor。
-// <comment text>は次のBNF構文で定義される。
-// <comment text> - 〈character sequence not containing
-// #| or |#〉
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CCommentContLexer
- {
-// <comment cont>を解釈するためのfunctor。
-// <comment cont>は次のBNF構文で定義される。
-// <comment cont> - <nested comment> <comment text>
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
-
- struct CNumberLexer
- {
-// <number>を解釈するためのfunctor。
-// <number>は次のBNF構文で定義される。
-// <number> - <num 2> | <num 8>
-// | <num 10> | <num 16>
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CNum2Lexer
- {
-// <num 2>を解釈するためのfunctor。
-// <num 2>は次のBNF構文で定義される。
-// <num R> - <prefix R> <complex R>
-// <complex 2> - <real 2> | <real 2> @ <real 2>
-// | <real 2> + <ureal 2> i | <real 2> - <ureal 2> i
-// | <real 2> + <naninf> i | <real 2> - <naninf> i
-// | <real 2> + i | <real 2> - i
-// | + <ureal 2> i | - <ureal 2> i
-// | + <naninf> i | - <naninf> i
-// | + i | - i
-// <real 2> - <sign> <ureal 2>
-// | + <naninf> | - <naninf>
-// <naninf> - nan.0 | inf.0
-// <ureal 2> - <uinteger 2>
-// | <uinteger 2> / <uinteger 2>
-// | <decimal 2> <mantissa width>
-// <decimal 10> - <uinteger 10> <suffix>
-// | . <digit 10>+ <suffix>
-// | <digit 10>+ . <digit 10>* <suffix>
-// <uinteger 2> - <digit 2>+
-// <prefix 2> - <radix 2> <exactness>
-// | <exactness> <radix 2>
-
-// <suffix> - <empty>
-// | <exponent marker> <sign> <digit 10>+
-// <exponent marker> - e | E | s | S | f | F
-// | d | D | l | L
-// <mantissa width> - <empty>
-// | | <digit 10>+
-// <sign> - <empty> | + | -
-// <exactness> - <empty>
-// | #i| #I | #e| #E
-// <radix 2> - #b| #B
-// <digit 2> - 0 | 1
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CNum8Lexer
- {
-// <num 8>を解釈するためのfunctor。
-// <num 8>は次のBNF構文で定義される。
-// <num R> - <prefix R> <complex R>
-// <complex 8> - <real 8> | <real 8> @ <real 8>
-// | <real 8> + <ureal 8> i | <real 8> - <ureal 8> i
-// | <real 8> + <naninf> i | <real 8> - <naninf> i
-// | <real 8> + i | <real 8> - i
-// | + <ureal 8> i | - <ureal 8> i
-// | + <naninf> i | - <naninf> i
-// | + i | - i
-// <real 8> - <sign> <ureal 8>
-// | + <naninf> | - <naninf>
-// <naninf> - nan.0 | inf.0
-// <ureal 8> - <uinteger 8>
-// | <uinteger 8> / <uinteger 8>
-// | <decimal 8> <mantissa width>
-// <decimal 10> - <uinteger 10> <suffix>
-// | . <digit 10>+ <suffix>
-// | <digit 10>+ . <digit 10>* <suffix>
-// <uinteger 8> - <digit 8>+
-// <prefix 8> - <radix 8> <exactness>
-// | <exactness> <radix 8>
-
-// <suffix> - <empty>
-// | <exponent marker> <sign> <digit 10>+
-// <exponent marker> - e | E | s | S | f | F
-// | d | D | l | L
-// <mantissa width> - <empty>
-// | | <digit 10>+
-// <sign> - <empty> | + | -
-// <exactness> - <empty>
-// | #i| #I | #e| #E
-// <radix 8> - #b| #B
-// <digit 8> - 0 | 1
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CNum10Lexer
- {
-// <num 10>を解釈するためのfunctor。
-// <num 10>は次のBNF構文で定義される。
-// <num R> - <prefix R> <complex R>
-// <complex 10> - <real 10> | <real 10> @ <real 10>
-// | <real 10> + <ureal 10> i | <real 10> - <ureal 10> i
-// | <real 10> + <naninf> i | <real 10> - <naninf> i
-// | <real 10> + i | <real 10> - i
-// | + <ureal 10> i | - <ureal 10> i
-// | + <naninf> i | - <naninf> i
-// | + i | - i
-// <real 10> - <sign> <ureal 10>
-// | + <naninf> | - <naninf>
-// <naninf> - nan.0 | inf.0
-// <ureal 10> - <uinteger 10>
-// | <uinteger 10> / <uinteger 10>
-// | <decimal 10> <mantissa width>
-// <decimal 10> - <uinteger 10> <suffix>
-// | . <digit 10>+ <suffix>
-// | <digit 10>+ . <digit 10>* <suffix>
-// <uinteger 10> - <digit 10>+
-// <prefix 10> - <radix 10> <exactness>
-// | <exactness> <radix 10>
-
-// <suffix> - <empty>
-// | <exponent marker> <sign> <digit 10>+
-// <exponent marker> - e | E | s | S | f | F
-// | d | D | l | L
-// <mantissa width> - <empty>
-// | | <digit 10>+
-// <sign> - <empty> | + | -
-// <exactness> - <empty>
-// | #i| #I | #e| #E
-// <radix 10> - #b| #B
-// <digit 10> - 0 | 1
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- struct CNum16Lexer
- {
-// <num 16>を解釈するためのfunctor。
-// <num 16>は次のBNF構文で定義される。
-// <num R> - <prefix R> <complex R>
-// <complex 16> - <real 16> | <real 16> @ <real 16>
-// | <real 16> + <ureal 16> i | <real 16> - <ureal 16> i
-// | <real 16> + <naninf> i | <real 16> - <naninf> i
-// | <real 16> + i | <real 16> - i
-// | + <ureal 16> i | - <ureal 16> i
-// | + <naninf> i | - <naninf> i
-// | + i | - i
-// <real 16> - <sign> <ureal 16>
-// | + <naninf> | - <naninf>
-// <naninf> - nan.0 | inf.0
-// <ureal 16> - <uinteger 16>
-// | <uinteger 16> / <uinteger 16>
-// | <decimal 16> <mantissa width>
-// <decimal 10> - <uinteger 10> <suffix>
-// | . <digit 10>+ <suffix>
-// | <digit 10>+ . <digit 10>* <suffix>
-// <uinteger 16> - <digit 16>+
-// <prefix 16> - <radix 16> <exactness>
-// | <exactness> <radix 16>
-
-// <suffix> - <empty>
-// | <exponent marker> <sign> <digit 10>+
-// <exponent marker> - e | E | s | S | f | F
-// | d | D | l | L
-// <mantissa width> - <empty>
-// | | <digit 10>+
-// <sign> - <empty> | + | -
-// <exactness> - <empty>
-// | #i| #I | #e| #E
-// <radix 16> - #b| #B
-// <digit 16> - 0 | 1
- smart_ptr<CLexeme> operator()(smart_ptr<utakata::utf8_string::CUTF8InputStream>& stream);
- };
-
- //======================================================================
-
- class CLexeme
- {
- // 非終端記号、及び終端記号を表す。
- // とりあえず最もシンプルな形を取るよ。
+ // 非終端記号、及び終端記号を表すクラス。
+ // それぞれ分割しても問題なかったのだが、それぞれのデータが
+ // 互いに非可換であるが、それぞれ継承してもどうしようもないため、
+ // さしあたって必要となる全ての型を取得できるようにしておき、
+ // それをそのまま取得してもらう、という形にする。
+ // つまりは全体をpimplにしておき、データはそれらから取得するようにするということ。
+ // それぞれを取得するためのインターフェースはこれから作成される。
public:
- ILexeme(const utakata::utf8_string::CUTF8String& str, int id);
+ ILexeme();
virtual ~ILexeme(){}
// 終端記号、非終端記号のIDを取得する。
int getID() const;
- // そのものを表す文字列を返す。
- const utakata::utf8_string::CUTF8String& getString() const;
+ // stringのデータ型において、文字列を取得する。
+ smart_ptr<utakata::utf8_string::CUTF8String> getString() const;
private:
-
- // pimplイディオムを使用する。
- struct Impl;
- smart_ptr<Impl> pimpl_;
+ // 必要な型全てをまとめるための構造体。ただし、
+ // 内部のどれか一つだけが有効となっており、これを必要と
+ // しない終端記号のデータも存在する。
+ // 詳しくは各データを解釈する場所にて。
+ struct PImpl;
+ smart_ptr<PImpl> pimpl_;
};
+
};
};
--- /dev/null
+#ifndef _LEXEME_IMPL_H_
+#define _LEXEME_IMPL_H_
+
+// lexemeの様々な実装を定義する。
+namespace utakata {
+
+ namespace lexeme {
+
+ class ILexeme;
+ };
+
+};
+
+#endif /* _LEXEME_IMPL_H_ */
#include <iostream>
+#include <assert.h>
#include "lexer.h"
+#include "sublexer.h"
+#include "lexeme.h"
using namespace utakata;
-smart_ptr<lexer::CLexeme> lexer::CLexer::lex(smart_ptr<utf8::CUTF8InputStream>& stream)
+smart_ptr<lexeme::ILexeme> lexer::CLexer::lex(smart_ptr<utf8::CUTF8InputStream>& stream)
{
// 渡されたCUTF8InputStreamから、1文字ずつ読んでいき、各構文を解釈
// する。
// まずは何はなくとも1文字読みだす。
// EOF以外の値の場合には、通常の字句解析を行っていく。
- utf8_string::CUTF8String str();
- bool first = true;
- while (!stream->isEOF()) {
+ utf8_string::CUTF8String str;
- // 意味のある文字のみで構成していく。
-
- utf8_string::CUTF8Char ch(stream->read());
-
- // 最初の一文字で、大体決定されるため、firstをチェックして
- // いく。
- if (first)
- {
- first = false;
-
- // ()[]`',.は構文解析の重要な要素となるため、このまま返す。
- if (ch.toUTF16Code() == '(' || ch.toUTF16Code() == '[')
- {
- return makeStartParen();
- }
-
- if (ch.toUTF16Code() == ')' || ch.toUTF16Code() == ']')
- {
- return makeEndParen();
- }
-
- if (ch.toUTF16Code() == '`')
- {
- return makeBackQuote();
- }
-
- if (ch.toUTF16Code() == '\'')
- {
- return makeQuote();
- }
+ smart_ptr<sublexer::ISubLexer> sublex(new sublexer::CFirstLex());
+
+ while (!stream->isEOF() && !sublex.isNull()) {
- if (ch.toUTF16Code() == '.')
- {
- return makeDot();
- }
-
- if (ch.toUTF16Code() == ',')
- {
- return makeComma();
- }
-
- if (ch.toUTF16Code() == '"')
- {
- // 先頭が"の場合、stringと判断される。
- return makeString(stream);
- }
+ // 意味のある文字のみで構成していく。
- }
- else
+ utf8_string::CUTF8Char ch = stream->peek();
+ smart_ptr<sublexer::ISubLexer> next = sublex->lex(ch, str, stream);
+ if (next.isNull())
{
- // それまでに読みだした文字列が固定の文字列かどうか。
-
- // 読出した文字がデリミタであるかどうか。
- if (isDelimiter(ch))
- {
- // デリミタ文字である場合、このデリミタ文字に来るまでの間に
- // 保存した文字列から、実際のデータを作成する。
- // ここに来るまでにすでに型は決定されているはずなので、
- // その型を基にして作成する。
-
- }
-
-
+ return sublex->getLexeme();
}
+ // 次に移れるようにしておく。
+ sublex = next;
+ str += utf8_string::CUTF8Char(stream->read());
}
+
+ // 何もなく終了してしまった場合、これはエラーとなる。
+ return smart_ptr<lexeme::ILexeme>();
}
+
#include "smart_ptr.h"
#include "utf8.h"
#include "utf8_string.h"
+#include "lexeme.h"
namespace utakata {
namespace lexer {
- class CLexeme;
class CLexer
{
/**
渡されたUTF8を解釈するstreamから、データを解釈して、結果を返す。
結果は、smart_ptr<CLexeme>で返される。
*/
- smart_ptr<CLexeme> lex(smart_ptr<utakata::utf8::CUTF8InputStream>& stream);
+ smart_ptr<utakata::lexeme::ILexeme> lex(smart_ptr<utakata::utf8::CUTF8InputStream>& stream);
- private:
-
};
- class CLexeme
- {
- // 非終端記号、及び終端記号を表すクラス。
- // それぞれ分割しても問題なかったのだが、それぞれのデータが
- // 互いに非可換であるが、それぞれ継承してもどうしようもないため、
- // さしあたって必要となる全ての型を取得できるようにしておき、
- // それをそのまま取得してもらう、という形にする。
- // つまりは全体をpimplにしておき、データはそれらから取得するようにするということ。
- // それぞれを取得するためのインターフェースはこれから作成される。
- public:
- CLexeme();
- virtual ~CLexeme(){}
-
- // 終端記号、非終端記号のIDを取得する。
- int getID() const;
-
- // stringのデータ型において、文字列を取得する。
- smart_ptr<utakata::utf8_string::CUTF8String> getString() const;
-
- private:
- // 必要な型全てをまとめるための構造体。ただし、
- // 内部のどれか一つだけが有効となっており、これを必要と
- // しない終端記号のデータも存在する。
- // 詳しくは各データを解釈する場所にて。
- struct PImpl;
- smart_ptr<PImpl> pimpl_;
- };
};
--- /dev/null
+#include <iostream>
+#include <assert.h>
+
+/////#include "lexeme.h"
+#include "utf8_string.h"
+#include "utf8.h"
+
+#include "sublexer.h"
+
+using namespace utakata;
+
+smart_ptr<sublexer::ISubLexer> sublexer::CFirstLex::lex(const utf8_string::CUTF8Char& ch,
+ const utf8_string::CUTF8String& str,
+ smart_ptr<utf8::CUTF8InputStream>& stream)
+{
+ // 最初の一文字を利用して判定を行う。
+ // なお、最初の一文字だけを行うため、strに文字が入っているとエラーになる。
+
+ assert(str.size() != 0 && "一文字目ではない。別の場所で呼びだされている");
+
+ smart_ptr<sublexer::ISubLexer> ret;
+ // ()[]`',.は構文解析の重要な要素となるため、このまま返す。
+// if (ch.toUTF16Code() == '(' || ch.toUTF16Code() == '[')
+// {
+// lexeme_ = lexer::makeStartParen();
+// }
+
+// if (ch.toUTF16Code() == ')' || ch.toUTF16Code() == ']')
+// {
+// lexeme_ = lexer::makeEndParen();
+// }
+
+// if (ch.toUTF16Code() == '`')
+// {
+// lexeme_ = (lexer::makeBackQuote();
+// }
+
+// if (ch.toUTF16Code() == '\'')
+// {
+// lexeme_ = (lexer::makeQuote();
+// }
+
+// if (ch.toUTF16Code() == '.')
+// {
+// lexeme_ = lexer::makeDot();
+// }
+
+// if (ch.toUTF16Code() == ',' || ch.toUTF16Code() == '#')
+// {
+// // ,や#の場合、次に別の文字が続く可能性があるため、NextLexemeLexerを
+// // 呼び出すようにしておく。
+// ret.add(new lexer::CNextLexemeLexer());
+// }
+
+// if (ch.toUTF16Code() == '"')
+// {
+// // 先頭が"の場合、stringと判断される。
+// ret.add(new lexer::CStringLexer());
+// }
+
+ // 判定できないとき、
+ return ret;
+}
+
+smart_ptr<lexeme::ILexeme> sublexer::CFirstLex::getLexeme()
+{
+ return smart_ptr<lexeme::ILexeme>();
+}
--- /dev/null
+#ifndef _SUBLEXER_H_
+#define _SUBLEXER_H_
+
+#include "smart_ptr.h"
+#include "utf8.h"
+#include "utf8_string.h"
+#include "lexeme.h"
+
+namespace utakata {
+
+ namespace sublexer {
+
+ class ISubLexer
+ {
+ /**
+ lexerのlex内で、数々の条件分岐を行わなければならない場合に、
+ それぞれのsublexerからの結果、追加で返されるsublexerを、
+ 次の文字における判定として利用することにしておく。
+ このようにすることで、インターフェースを完全に統一しながら、
+ sublexerからsublexerを返すようにしていくだけで、
+ lex内部をシンプルにすることができる。
+
+ これは完全にインターフェースのみを提供する。
+ */
+
+ public:
+ ISubLexer() {}
+ virtual ~ISubLexer() {}
+
+ // 処理の実体となる。
+ // strは前回のsublexが返した文字列であり、前のsublexによって更新される。
+ // streamは文字通りストリームとなる。sublex中で文字の取得などを
+ // 自由に行う必要があるために渡している。
+ virtual smart_ptr<ISubLexer> lex(const utakata::utf8_string::CUTF8Char& ch,
+ const utakata::utf8_string::CUTF8String& str,
+ smart_ptr<utakata::utf8::CUTF8InputStream>& stream) = 0;
+
+ // 作成したILexemeを返す。lexの結果を返さない場合に利用される。
+ // これだけは前方参照のみでなんとか乗り切る必要がある。
+ virtual smart_ptr<utakata::lexeme::ILexeme> getLexeme() = 0;
+
+ };
+
+ class CFirstLex : public ISubLexer
+ {
+ // lex関数の内部で最初に実行される。
+ // ここから返されない場合は、一文字の構文構成文字が返されるということになる。
+ public:
+
+ smart_ptr<ISubLexer> lex(const utakata::utf8_string::CUTF8Char& ch,
+ const utakata::utf8_string::CUTF8String& str,
+ smart_ptr<utakata::utf8::CUTF8InputStream>& stream);
+
+ smart_ptr<utakata::lexeme::ILexeme> getLexeme();
+
+ private:
+ // 返すべきILexemeが確定した場合に、ここに格納する。
+ smart_ptr<utakata::lexeme::ILexeme> lexeme_;
+ };
+
+
+
+ };
+
+};
+
+#endif /* _SUBLEXER_H_ */
PRE_UNINSTALL = :
POST_UNINSTALL = :
bin_PROGRAMS = utf8_test$(EXEEXT) textarrayformat_test$(EXEEXT) \
- utf8_string_test$(EXEEXT)
+ utf8_string_test$(EXEEXT) lexer_test$(EXEEXT) \
+ sublexer_test$(EXEEXT)
subdir = test
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
+am_lexer_test_OBJECTS = lexer_test.$(OBJEXT) lexer.$(OBJEXT) \
+ sublexer.$(OBJEXT) simpletest.$(OBJEXT) utf8_string.$(OBJEXT) \
+ utf8.$(OBJEXT)
+lexer_test_OBJECTS = $(am_lexer_test_OBJECTS)
+lexer_test_LDADD = $(LDADD)
+am_sublexer_test_OBJECTS = sublexer_test.$(OBJEXT) sublexer.$(OBJEXT) \
+ simpletest.$(OBJEXT) utf8_string.$(OBJEXT) utf8.$(OBJEXT)
+sublexer_test_OBJECTS = $(am_sublexer_test_OBJECTS)
+sublexer_test_LDADD = $(LDADD)
am_textarrayformat_test_OBJECTS = textarrayformat_test.$(OBJEXT) \
TextArrayFormat.$(OBJEXT) simpletest.$(OBJEXT)
textarrayformat_test_OBJECTS = $(am_textarrayformat_test_OBJECTS)
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@
-SOURCES = $(textarrayformat_test_SOURCES) $(utf8_string_test_SOURCES) \
+SOURCES = $(lexer_test_SOURCES) $(sublexer_test_SOURCES) \
+ $(textarrayformat_test_SOURCES) $(utf8_string_test_SOURCES) \
+ $(utf8_test_SOURCES)
+DIST_SOURCES = $(lexer_test_SOURCES) $(sublexer_test_SOURCES) \
+ $(textarrayformat_test_SOURCES) $(utf8_string_test_SOURCES) \
$(utf8_test_SOURCES)
-DIST_SOURCES = $(textarrayformat_test_SOURCES) \
- $(utf8_string_test_SOURCES) $(utf8_test_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CPP = gcc -E
-CPPFLAGS = -Wall
+CPPFLAGS =
CXX = g++
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2
top_build_prefix = ../
top_builddir = ..
top_srcdir = ..
+
+# 警告レベルを最大にする。
+AM_CPPFLAGS = -Wall
INCLUDES = -l$(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 ../sublexer.cpp ../simpletest.cpp ../utf8_string.cpp ../utf8.cpp
+sublexer_test_SOURCES = sublexer_test.cpp ../sublexer.cpp ../simpletest.cpp ../utf8_string.cpp ../utf8.cpp
check_PROGRANS = $(bin_PROGRAMS)
TESTS = $(bin_PROGRAMS)
all: all-am
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+lexer_test$(EXEEXT): $(lexer_test_OBJECTS) $(lexer_test_DEPENDENCIES)
+ @rm -f lexer_test$(EXEEXT)
+ $(CXXLINK) $(lexer_test_OBJECTS) $(lexer_test_LDADD) $(LIBS)
+sublexer_test$(EXEEXT): $(sublexer_test_OBJECTS) $(sublexer_test_DEPENDENCIES)
+ @rm -f sublexer_test$(EXEEXT)
+ $(CXXLINK) $(sublexer_test_OBJECTS) $(sublexer_test_LDADD) $(LIBS)
textarrayformat_test$(EXEEXT): $(textarrayformat_test_OBJECTS) $(textarrayformat_test_DEPENDENCIES)
@rm -f textarrayformat_test$(EXEEXT)
$(CXXLINK) $(textarrayformat_test_OBJECTS) $(textarrayformat_test_LDADD) $(LIBS)
-rm -f *.tab.c
include ./$(DEPDIR)/TextArrayFormat.Po
+include ./$(DEPDIR)/lexer.Po
+include ./$(DEPDIR)/lexer_test.Po
include ./$(DEPDIR)/simpletest.Po
+include ./$(DEPDIR)/sublexer.Po
+include ./$(DEPDIR)/sublexer_test.Po
include ./$(DEPDIR)/textarrayformat_test.Po
include ./$(DEPDIR)/utf8.Po
include ./$(DEPDIR)/utf8_string.Po
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
# $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-TextArrayFormat.o: ../TextArrayFormat.cpp
- $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TextArrayFormat.o -MD -MP -MF $(DEPDIR)/TextArrayFormat.Tpo -c -o TextArrayFormat.o `test -f '../TextArrayFormat.cpp' || echo '$(srcdir)/'`../TextArrayFormat.cpp
- mv -f $(DEPDIR)/TextArrayFormat.Tpo $(DEPDIR)/TextArrayFormat.Po
-# source='../TextArrayFormat.cpp' object='TextArrayFormat.o' libtool=no \
+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 TextArrayFormat.o `test -f '../TextArrayFormat.cpp' || echo '$(srcdir)/'`../TextArrayFormat.cpp
+# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lexer.o `test -f '../lexer.cpp' || echo '$(srcdir)/'`../lexer.cpp
-TextArrayFormat.obj: ../TextArrayFormat.cpp
- $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TextArrayFormat.obj -MD -MP -MF $(DEPDIR)/TextArrayFormat.Tpo -c -o TextArrayFormat.obj `if test -f '../TextArrayFormat.cpp'; then $(CYGPATH_W) '../TextArrayFormat.cpp'; else $(CYGPATH_W) '$(srcdir)/../TextArrayFormat.cpp'; fi`
- mv -f $(DEPDIR)/TextArrayFormat.Tpo $(DEPDIR)/TextArrayFormat.Po
-# source='../TextArrayFormat.cpp' object='TextArrayFormat.obj' libtool=no \
+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 TextArrayFormat.obj `if test -f '../TextArrayFormat.cpp'; then $(CYGPATH_W) '../TextArrayFormat.cpp'; else $(CYGPATH_W) '$(srcdir)/../TextArrayFormat.cpp'; fi`
+# $(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`
+
+sublexer.o: ../sublexer.cpp
+ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sublexer.o -MD -MP -MF $(DEPDIR)/sublexer.Tpo -c -o sublexer.o `test -f '../sublexer.cpp' || echo '$(srcdir)/'`../sublexer.cpp
+ mv -f $(DEPDIR)/sublexer.Tpo $(DEPDIR)/sublexer.Po
+# source='../sublexer.cpp' object='sublexer.o' libtool=no \
+# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sublexer.o `test -f '../sublexer.cpp' || echo '$(srcdir)/'`../sublexer.cpp
+
+sublexer.obj: ../sublexer.cpp
+ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sublexer.obj -MD -MP -MF $(DEPDIR)/sublexer.Tpo -c -o sublexer.obj `if test -f '../sublexer.cpp'; then $(CYGPATH_W) '../sublexer.cpp'; else $(CYGPATH_W) '$(srcdir)/../sublexer.cpp'; fi`
+ mv -f $(DEPDIR)/sublexer.Tpo $(DEPDIR)/sublexer.Po
+# source='../sublexer.cpp' object='sublexer.obj' libtool=no \
+# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sublexer.obj `if test -f '../sublexer.cpp'; then $(CYGPATH_W) '../sublexer.cpp'; else $(CYGPATH_W) '$(srcdir)/../sublexer.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
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o utf8.obj `if test -f '../utf8.cpp'; then $(CYGPATH_W) '../utf8.cpp'; else $(CYGPATH_W) '$(srcdir)/../utf8.cpp'; fi`
+TextArrayFormat.o: ../TextArrayFormat.cpp
+ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TextArrayFormat.o -MD -MP -MF $(DEPDIR)/TextArrayFormat.Tpo -c -o TextArrayFormat.o `test -f '../TextArrayFormat.cpp' || echo '$(srcdir)/'`../TextArrayFormat.cpp
+ mv -f $(DEPDIR)/TextArrayFormat.Tpo $(DEPDIR)/TextArrayFormat.Po
+# source='../TextArrayFormat.cpp' object='TextArrayFormat.o' libtool=no \
+# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TextArrayFormat.o `test -f '../TextArrayFormat.cpp' || echo '$(srcdir)/'`../TextArrayFormat.cpp
+
+TextArrayFormat.obj: ../TextArrayFormat.cpp
+ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TextArrayFormat.obj -MD -MP -MF $(DEPDIR)/TextArrayFormat.Tpo -c -o TextArrayFormat.obj `if test -f '../TextArrayFormat.cpp'; then $(CYGPATH_W) '../TextArrayFormat.cpp'; else $(CYGPATH_W) '$(srcdir)/../TextArrayFormat.cpp'; fi`
+ mv -f $(DEPDIR)/TextArrayFormat.Tpo $(DEPDIR)/TextArrayFormat.Po
+# source='../TextArrayFormat.cpp' object='TextArrayFormat.obj' libtool=no \
+# 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`
+
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
+# 警告レベルを最大にする。
+AM_CPPFLAGS = -Wall
INCLUDES = -l$(top_srcdir)
-bin_PROGRAMS = utf8_test textarrayformat_test utf8_string_test
+bin_PROGRAMS = utf8_test textarrayformat_test utf8_string_test lexer_test sublexer_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 ../sublexer.cpp ../simpletest.cpp ../utf8_string.cpp ../utf8.cpp
+sublexer_test_SOURCES = sublexer_test.cpp ../sublexer.cpp ../simpletest.cpp ../utf8_string.cpp ../utf8.cpp
check_PROGRANS = $(bin_PROGRAMS)
TESTS = $(bin_PROGRAMS)
PRE_UNINSTALL = :
POST_UNINSTALL = :
bin_PROGRAMS = utf8_test$(EXEEXT) textarrayformat_test$(EXEEXT) \
- utf8_string_test$(EXEEXT)
+ utf8_string_test$(EXEEXT) lexer_test$(EXEEXT) \
+ sublexer_test$(EXEEXT)
subdir = test
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
+am_lexer_test_OBJECTS = lexer_test.$(OBJEXT) lexer.$(OBJEXT) \
+ sublexer.$(OBJEXT) simpletest.$(OBJEXT) utf8_string.$(OBJEXT) \
+ utf8.$(OBJEXT)
+lexer_test_OBJECTS = $(am_lexer_test_OBJECTS)
+lexer_test_LDADD = $(LDADD)
+am_sublexer_test_OBJECTS = sublexer_test.$(OBJEXT) sublexer.$(OBJEXT) \
+ simpletest.$(OBJEXT) utf8_string.$(OBJEXT) utf8.$(OBJEXT)
+sublexer_test_OBJECTS = $(am_sublexer_test_OBJECTS)
+sublexer_test_LDADD = $(LDADD)
am_textarrayformat_test_OBJECTS = textarrayformat_test.$(OBJEXT) \
TextArrayFormat.$(OBJEXT) simpletest.$(OBJEXT)
textarrayformat_test_OBJECTS = $(am_textarrayformat_test_OBJECTS)
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@
-SOURCES = $(textarrayformat_test_SOURCES) $(utf8_string_test_SOURCES) \
+SOURCES = $(lexer_test_SOURCES) $(sublexer_test_SOURCES) \
+ $(textarrayformat_test_SOURCES) $(utf8_string_test_SOURCES) \
+ $(utf8_test_SOURCES)
+DIST_SOURCES = $(lexer_test_SOURCES) $(sublexer_test_SOURCES) \
+ $(textarrayformat_test_SOURCES) $(utf8_string_test_SOURCES) \
$(utf8_test_SOURCES)
-DIST_SOURCES = $(textarrayformat_test_SOURCES) \
- $(utf8_string_test_SOURCES) $(utf8_test_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
+
+# 警告レベルを最大にする。
+AM_CPPFLAGS = -Wall
INCLUDES = -l$(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 ../sublexer.cpp ../simpletest.cpp ../utf8_string.cpp ../utf8.cpp
+sublexer_test_SOURCES = sublexer_test.cpp ../sublexer.cpp ../simpletest.cpp ../utf8_string.cpp ../utf8.cpp
check_PROGRANS = $(bin_PROGRAMS)
TESTS = $(bin_PROGRAMS)
all: all-am
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+lexer_test$(EXEEXT): $(lexer_test_OBJECTS) $(lexer_test_DEPENDENCIES)
+ @rm -f lexer_test$(EXEEXT)
+ $(CXXLINK) $(lexer_test_OBJECTS) $(lexer_test_LDADD) $(LIBS)
+sublexer_test$(EXEEXT): $(sublexer_test_OBJECTS) $(sublexer_test_DEPENDENCIES)
+ @rm -f sublexer_test$(EXEEXT)
+ $(CXXLINK) $(sublexer_test_OBJECTS) $(sublexer_test_LDADD) $(LIBS)
textarrayformat_test$(EXEEXT): $(textarrayformat_test_OBJECTS) $(textarrayformat_test_DEPENDENCIES)
@rm -f textarrayformat_test$(EXEEXT)
$(CXXLINK) $(textarrayformat_test_OBJECTS) $(textarrayformat_test_LDADD) $(LIBS)
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TextArrayFormat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lexer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lexer_test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpletest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sublexer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sublexer_test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/textarrayformat_test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8_string.Po@am__quote@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-TextArrayFormat.o: ../TextArrayFormat.cpp
-@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TextArrayFormat.o -MD -MP -MF $(DEPDIR)/TextArrayFormat.Tpo -c -o TextArrayFormat.o `test -f '../TextArrayFormat.cpp' || echo '$(srcdir)/'`../TextArrayFormat.cpp
-@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/TextArrayFormat.Tpo $(DEPDIR)/TextArrayFormat.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../TextArrayFormat.cpp' object='TextArrayFormat.o' libtool=no @AMDEPBACKSLASH@
+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 TextArrayFormat.o `test -f '../TextArrayFormat.cpp' || echo '$(srcdir)/'`../TextArrayFormat.cpp
+@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
-TextArrayFormat.obj: ../TextArrayFormat.cpp
-@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TextArrayFormat.obj -MD -MP -MF $(DEPDIR)/TextArrayFormat.Tpo -c -o TextArrayFormat.obj `if test -f '../TextArrayFormat.cpp'; then $(CYGPATH_W) '../TextArrayFormat.cpp'; else $(CYGPATH_W) '$(srcdir)/../TextArrayFormat.cpp'; fi`
-@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/TextArrayFormat.Tpo $(DEPDIR)/TextArrayFormat.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../TextArrayFormat.cpp' object='TextArrayFormat.obj' libtool=no @AMDEPBACKSLASH@
+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 TextArrayFormat.obj `if test -f '../TextArrayFormat.cpp'; then $(CYGPATH_W) '../TextArrayFormat.cpp'; else $(CYGPATH_W) '$(srcdir)/../TextArrayFormat.cpp'; fi`
+@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`
+
+sublexer.o: ../sublexer.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sublexer.o -MD -MP -MF $(DEPDIR)/sublexer.Tpo -c -o sublexer.o `test -f '../sublexer.cpp' || echo '$(srcdir)/'`../sublexer.cpp
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/sublexer.Tpo $(DEPDIR)/sublexer.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../sublexer.cpp' object='sublexer.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.o `test -f '../sublexer.cpp' || echo '$(srcdir)/'`../sublexer.cpp
+
+sublexer.obj: ../sublexer.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sublexer.obj -MD -MP -MF $(DEPDIR)/sublexer.Tpo -c -o sublexer.obj `if test -f '../sublexer.cpp'; then $(CYGPATH_W) '../sublexer.cpp'; else $(CYGPATH_W) '$(srcdir)/../sublexer.cpp'; fi`
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/sublexer.Tpo $(DEPDIR)/sublexer.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../sublexer.cpp' object='sublexer.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.obj `if test -f '../sublexer.cpp'; then $(CYGPATH_W) '../sublexer.cpp'; else $(CYGPATH_W) '$(srcdir)/../sublexer.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
@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.obj `if test -f '../utf8.cpp'; then $(CYGPATH_W) '../utf8.cpp'; else $(CYGPATH_W) '$(srcdir)/../utf8.cpp'; fi`
+TextArrayFormat.o: ../TextArrayFormat.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TextArrayFormat.o -MD -MP -MF $(DEPDIR)/TextArrayFormat.Tpo -c -o TextArrayFormat.o `test -f '../TextArrayFormat.cpp' || echo '$(srcdir)/'`../TextArrayFormat.cpp
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/TextArrayFormat.Tpo $(DEPDIR)/TextArrayFormat.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../TextArrayFormat.cpp' object='TextArrayFormat.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 TextArrayFormat.o `test -f '../TextArrayFormat.cpp' || echo '$(srcdir)/'`../TextArrayFormat.cpp
+
+TextArrayFormat.obj: ../TextArrayFormat.cpp
+@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TextArrayFormat.obj -MD -MP -MF $(DEPDIR)/TextArrayFormat.Tpo -c -o TextArrayFormat.obj `if test -f '../TextArrayFormat.cpp'; then $(CYGPATH_W) '../TextArrayFormat.cpp'; else $(CYGPATH_W) '$(srcdir)/../TextArrayFormat.cpp'; fi`
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/TextArrayFormat.Tpo $(DEPDIR)/TextArrayFormat.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../TextArrayFormat.cpp' object='TextArrayFormat.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 TextArrayFormat.obj `if test -f '../TextArrayFormat.cpp'; then $(CYGPATH_W) '../TextArrayFormat.cpp'; else $(CYGPATH_W) '$(srcdir)/../TextArrayFormat.cpp'; fi`
+
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
--- /dev/null
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <functional>
+
+
+#include "../simpletest.h"
+
+#include "../lexer.h"
+
+
+int main(int argc, char *argv[])
+{
+ simpletest::CSimpleTestSuite suite("main lexer test");
+// suite.addTester(sfcr::screate(utf8_multichar_test, suite.getAsserter()));
+// suite.addTester(sfcr::screate(utf8_string_test, suite.getAsserter()));
+// suite.addTester(sfcr::screate(utf8_string_util_test, suite.getAsserter()));
+ suite.run();
+ return 0;
+}
--- /dev/null
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <functional>
+
+
+#include "../simpletest.h"
+
+#include "../sublexer.h"
+
+
+int main(int argc, char *argv[])
+{
+ simpletest::CSimpleTestSuite suite("sublexer's test");
+// suite.addTester(sfcr::screate(utf8_multichar_test, suite.getAsserter()));
+// suite.addTester(sfcr::screate(utf8_string_test, suite.getAsserter()));
+// suite.addTester(sfcr::screate(utf8_string_util_test, suite.getAsserter()));
+ suite.run();
+ return 0;
+}
// 単独のreadを試す。
utakata::utf8_string::CUTF8Char ch(stream.read());
- asserter->check(ch.toUTF16Code(), utakata::utf8::generateUTF8Code("あ"));
+ asserter->check(ch.toUTF16Code(), utakata::utf8::generateUTF8Code("あ"), "通常read失敗");
// peekが問題なく働いていることのテスト
utakata::utf8_string::CUTF8Char ch2(stream.peek());
- asserter->check(ch2.toUTF16Code(), utakata::utf8::generateUTF8Code("い"));
+ asserter->check(ch2.toUTF16Code(), utakata::utf8::generateUTF8Code("い"), "peek失敗");
utakata::utf8_string::CUTF8Char ch3(stream.read());
- asserter->check(ch3.toUTF16Code(), utakata::utf8::generateUTF8Code("い"));
+ asserter->check(ch3.toUTF16Code(), utakata::utf8::generateUTF8Code("い"), "peek後read失敗");
// asciiだとしても問題無く読みだせるはず。
utakata::utf8_string::CUTF8Char ch4(stream.peek());
// 文字との加算も可能。
str += ch;
- asserter->check(str.toStr(), "ã\81\82ã\81\82ã\81\84ã\81\86ã\81\88sã\81\82ã\81\84ã\81\86ã\81\88s");
+ asserter->check(str.toStr(), "ã\81\82ã\81\84ã\81\86ã\81\88sã\81\82ã\81\84ã\81\86ã\81\88sã\81\82");
return asserter->isOk();
}
// 互いに加算できる。
utakata::utf8_string::CUTF8String str4 = str + str2;
- asserter->check(str4.toStr(), "ssおssおあいうえs");
+ asserter->check(str4.toStr(), "ssおあいうえsssお");
return asserter->isOk();
}