123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- #! /bin/sh
- required='c++ bison'
- . test-init.sh
- cat >> configure.ac << 'END'
- AC_PROG_CXX
- AC_PROG_YACC
- AC_OUTPUT
- END
- cat > Makefile.am << 'END'
- bin_PROGRAMS = zardoz
- zardoz_SOURCES = zardoz.yy foo.cc
- AM_YFLAGS = -d
- BUILT_SOURCES = zardoz.hh
- EXTRA_DIST = stack.hh location.hh position.hh
- END
- cat > zardoz.yy << 'END'
- %skeleton "lalr1.cc"
- %defines
- %locations
- %union
- {
- int ival;
- };
- %{
- int yylex (yy::parser::semantic_type *yylval,
- yy::parser::location_type *yylloc);
- %}
- %%
- start : /* empty */
- %%
- int
- yylex (yy::parser::semantic_type *yylval,
- yy::parser::location_type *yylloc)
- {
- return 0;
- }
- void
- yy::parser::error(const yy::parser::location_type&, const std::string&)
- {
- return;
- }
- END
- cat > foo.cc << 'END'
- int
- main(int argc, char** argv)
- {
- yy::parser my_parser;
- return my_parser.parse ();
- }
- END
- $ACLOCAL
- $AUTOCONF
- $AUTOMAKE -a
- mkdir build
- cd build
- ../configure YACC='bison -y'
- $MAKE
- cd ..
- ./configure YACC='bison -y'
- $MAKE
- yl_distcheck YACC=false DISTCHECK_CONFIGURE_FLAGS='YACC=false'
- :
|