Commit b523d79d authored by vasseu_c's avatar vasseu_c
Browse files

Index: ChangeLog

from  Clement Vasseur  <clement.vasseur@lrde.epita.fr>

	* config/check-rules.mk: New test rules.

	* test/expressions/test,
	* test/disambiguate/test,
	* test/g++/test: New test scripts.

	* config/defs.in,
	* test/expressions/test.test,
	* test/disambiguate/test.test
	* test/g++/test.test: Remove.

	* test/expressions/Makefile.am
	* test/disambiguate/Makefile.am
	* test/g++/Makefile.am
	* config/Makefile.am: Update.

	* test/expressions/primary-this.cc,
	* test/disambiguate/template-08.cc,
	* src/parser/parse-dxx.str: Fix.
parent 7255a911
2004-03-09 Clement Vasseur <clement.vasseur@lrde.epita.fr>
* config/check-rules.mk: New test rules.
* test/expressions/test,
* test/disambiguate/test,
* test/g++/test: New test scripts.
* config/defs.in,
* test/expressions/test.test,
* test/disambiguate/test.test
* test/g++/test.test: Remove.
* test/expressions/Makefile.am
* test/disambiguate/Makefile.am
* test/g++/Makefile.am
* config/Makefile.am: Update.
* test/expressions/primary-this.cc,
* test/disambiguate/template-08.cc,
* src/parser/parse-dxx.str: Fix.
2004-03-08 Clement Vasseur <clement.vasseur@lrde.epita.fr>
* src/parser/parse-cxx.str: Make it fail if the resulting AST
......
## Makefile.am -- Process this file with automake to produce Makefile.in
##
noinst_SCRIPTS = defs
MAINTAINERCLEANFILES = \
Makefile.in \
$(STANDARD_TOOLS)
......
# -*-Makefile-*-
CXX_TBL=$(top_builddir)/src/syn/Cxx.tbl
DXX_TBL=$(top_builddir)/src/deterministic/Dxx.tbl
CXX_PP_AF=$(top_builddir)/src/syn/Cxx.pp.af
parse-cxx:
@$(top_builddir)/src/parser/parse-cxx -i $(SRC) &> cxx-out
# Parsing
.C.ptcc: $(CXX_TBL)
$(SGLR)/bin/sglr -2 -t -fi -p $(CXX_TBL) -i $< -o $@
.cc.ptcc: $(CXX_TBL)
$(SGLR)/bin/sglr -2 -t -fi -p $(CXX_TBL) -i $< -o $@
parse-dxx:
@$(top_builddir)/src/parser/parse-dxx -i $(SRC) &> dxx-out
# Disambiguation
.ptcc.disambcc:
$(top_builddir)/src/disamb/ambdown/ambdown -i $< | \
$(top_builddir)/src/disamb/simpledeclaration/afcxx-simpledeclaration -S | \
$(top_builddir)/src/disamb/purespecifier/afcxx-purespecifier -S | \
$(top_builddir)/src/disamb/namespace/afcxx-namespace -S | \
$(top_builddir)/src/disamb/declaration/afcxx-declaration -S | \
$(top_builddir)/src/disamb/resolve/afcxx-resolve -S | \
$(top_builddir)/src/disamb/classparam/afcxx-classparam -S | \
$(top_builddir)/src/disamb/resolve/afcxx-resolve -S | \
$(top_builddir)/src/disamb/specifier/afcxx-specifier -S | \
$(top_builddir)/src/disamb/validtypes/afcxx-validtypes -S | \
$(top_builddir)/src/disamb/resolve/afcxx-resolve -S | \
$(top_builddir)/src/disamb/disambiguate/afcxx-disambiguate -S \
-o $@
$(TESTS): test
@if [ -f abi ]; then \
for i in $(TESTS); do ln -fs $< $$i; done; \
else \
for i in $(TESTS); do ln -fs ../$< $$i; done; \
fi
@rm -f XTC log
@$(XTC)/bin/xtc -r XTC import \
$(STRATEGOXT)/share/strategoxt/XTC 2>/dev/null
@$(XTC)/bin/xtc -r XTC register \
-l $(top_builddir)/src/syn -V 1 -t Cxx.tbl
@$(XTC)/bin/xtc -r XTC register \
-l $(top_builddir)/src/deterministic -V 1 -t Dxx.tbl
@for i in ambdown afcxx-simpledeclaration afcxx-purespecifier \
afcxx-namespace afcxx-declaration afcxx-resolve afcxx-bitfield \
afcxx-classparam afcxx-resolve afcxx-specifier afcxx-disambiguate \
afcxx-validtypes; \
do \
dir=$(top_builddir)/src/disamb/`echo $$i | sed s/^afcxx-//`; \
$(XTC)/bin/xtc -r XTC register -l $$dir -V 1 -t $$i; \
done
# Implosion
.disambcc.astcc:
$(ASFIX_TOOLS)/bin/implode-asfix -i $< -o $@
TESTS_ENVIRONMENT = XTC_REPOSITORY=XTC
# Check for presence of ambiguities
.disambcc.visamb:
$(ASFIX_TOOLS)/bin/visamb -i $< -o $@
grep "amb" $< -v -c
# Check that the disambiguation has kept the right branches
.astcc.diff:
$(SGLR)/bin/sglr -2 -t -fi -A -p $(DXX_TBL) \
-i $(srcdir)/$(<:.astcc=.detcc) | \
$(ASFIX_TOOLS)/bin/implode-asfix -o $(<:.astcc=.astcc2)
diff $< $(<:.astcc=.astcc2) > $@
# Pretty Printing
.astcc.ppcc: $(CXX_PP_AF)
$(GPP)/bin/ast2text -p $(CXX_PP_AF) -i $< -o $@
CLEANFILES = $(TESTS) XTC log cxx-out dxx-out
#! /bin/sh
# @configure_input@
# -*- shell-script -*-
# Ensure we are running from the right directory.
test -f ./defs || {
echo "defs: not found in current directory" 1>&2
exit 1
}
# If srcdir is not set, then we are not running from `make check', be verbose.
if test -z "$srcdir"; then
test -z "$VERBOSE" && VERBOSE=x
# compute $srcdir.
srcdir=`echo "$0" | sed -e 's,/[^\\/]*$,,'`
test $srcdir = $0 && srcdir=.
fi
# Ensure $srcdir is set correctly.
#test -f $srcdir/defs.in || {
# echo "$srcdir/defs.in not found, check \$srcdir" 1>&2
# exit 1
#}
me=`echo "$0" | sed -e 's,.*[\\/],,;s/\.test$//'`
# See how redirections should work. User can set VERBOSE to see all
# output.
test -z "$VERBOSE" && {
exec > /dev/null 2>&1
}
# Turn on shell traces when VERBOSE=x.
if test "x$VERBOSE" = xx; then
set -x
else
:
fi
pwd
# Unset VERBOSE as the XT tools might be reading this variable.
unset VERBOSE
# Be sure to return true, even when VERBOSE is not set.
:
......@@ -20,23 +20,6 @@ module parse-dxx
imports xtc-lib stratego-xt-xtc-tools ambtrack
strategies
my-xtc :
FILE(f) -> FILE(g')
where <xtc-new-file> f => g
; (<xtc-command(!"sglr")> ["-i", f, "-o", g, "-2A", "-fi", "-p", <xtc-find> "Dxx.tbl"]
; <close-file> g
; <xtc-implode-asfix> FILE(g) => FILE(g')
<+ <xtc-ambtrack> FILE(g) => FILE(g'))
my-xtc :
stdin -> FILE(g')
where xtc-new-file => g
; (<xtc-command(!"sglr")> ["-o", g, "-2A", "-fi", "-p", <xtc-find> "Dxx.tbl"]
; <close-file> g
; <xtc-implode-asfix> FILE(g) => FILE(g')
<+ <xtc-ambtrack> FILE(g) => FILE(g'))
xtc-ambtrack =
read-from
; (ambtrack <+ <xtc-exit> 1)
......@@ -47,5 +30,7 @@ strategies
io-parse-dxx =
xtc-io-wrap(
my-xtc
xtc-transform(!"sglr", !["-2A", "-fi", "-p", <xtc-find> "Dxx.tbl"])
< xtc-implode-asfix
+ xtc-ambtrack
)
include $(top_srcdir)/config/Makefile.xt
include $(top_srcdir)/config/check-rules.mk
# Each test case depends on defs.
check_SCRIPTS = defs dirs
defs: $(top_builddir)/config/defs
ln -s $(top_builddir)/config/defs .
$(TESTS): test.test
for i in $(TESTS); do ln -fs $< $$i; done
dirs:
echo "SRCDIR=\"$(srcdir)\"" >dirs
XFAIL_TESTS = \
template-08.test
TESTS = \
alias-01.test \
class-01.test \
class-02.test \
class-03.test \
class-04.test \
class-05.test \
class-06.test \
enum-01.test \
enum-02.test \
enum-03.test \
enum-04.test \
factorial-01.test \
funcdef-01.test \
funcdef-02.test \
function-01.test \
function-02.test \
function-03.test \
function-04.test \
function-05.test \
function-06.test \
inherit-01.test \
inherit-02.test \
inherit-03.test \
inherit-04.test \
inherit-05.test \
inherit-06.test \
inherit-07.test \
inherit-08.test \
inherit-09.test \
main-01.test \
main-02.test \
namespace-01.test \
namespace-02.test \
namespace-03.test \
namespace-04.test \
namespace-05.test \
parameter-01.test \
parameter-02.test \
parameter-03.test \
parameter-04.test \
parameter-05.test \
parameter-06.test \
parameter-07.test \
parameter-08.test \
power-01.test \
power-02.test \
simple-decl-01.test \
simple-decl-02.test \
sizeof-01.test \
sizeof-02.test \
struct-01.test \
return-01.test \
template-01.test \
template-02.test \
template-03.test \
template-04.test \
template-05.test \
template-06.test \
template-07.test \
template-08.test \
template-09.test \
template-10.test \
template-11.test \
test-01.test \
test-02.test \
test-03.test \
test-04.test \
type-01.test \
typedef-01.test \
typedef-02.test \
union-01.test \
variable-01.test
EXTRA_DIST = test.test $(TESTS:.test=.cc) $(TESTS:.test=.detcc)
alias-01 \
class-01 \
class-02 \
class-03 \
class-04 \
class-05 \
class-06 \
enum-01 \
enum-02 \
enum-03 \
enum-04 \
factorial-01 \
funcdef-01 \
funcdef-02 \
function-01 \
function-02 \
function-03 \
function-04 \
function-05 \
function-06 \
inherit-01 \
inherit-02 \
inherit-03 \
inherit-04 \
inherit-05 \
inherit-06 \
inherit-07 \
inherit-08 \
inherit-09 \
main-01 \
main-02 \
namespace-01 \
namespace-02 \
namespace-03 \
namespace-04 \
namespace-05 \
parameter-01 \
parameter-02 \
parameter-03 \
parameter-04 \
parameter-05 \
parameter-06 \
parameter-07 \
parameter-08 \
power-01 \
power-02 \
simple-decl-01 \
simple-decl-02 \
sizeof-01 \
sizeof-02 \
struct-01 \
return-01 \
template-01 \
template-02 \
template-03 \
template-04 \
template-05 \
template-06 \
template-07 \
template-08 \
template-09 \
template-10 \
template-11 \
test-01 \
test-02 \
test-03 \
test-04 \
type-01 \
typedef-01 \
typedef-02 \
union-01 \
variable-01
CLEANFILES = defs \
dirs \
$(TESTS) \
$(TESTS:.test=.visamb) \
$(TESTS:.test=.disambcc) \
$(TESTS:.test=.diff) \
$(TESTS:.test=.astcc2)
EXTRA_DIST = test $(TESTS:=.cc) $(TESTS:=.detcc)
// Exercise membership in template classes.
// This program is intended to check that two different namespaces are created
// for two different flavors of class template A. This is not valid C++,
// though.
template < typename T >
class A
......@@ -12,7 +9,7 @@ class A
template < typename U,
typename V >
class A
class C
{
class B
{
......
#!/bin/sh
if make SRC="$0.cc" parse-cxx &> /dev/null
then
if [ -f "$0.detcc" ]
then
if make SRC="$0.detcc" parse-dxx &> /dev/null
then
if cmp -s cxx-out dxx-out
then
echo "$0: cxx != dxx" >> log
echo "** CXX **" >> log
cat cxx-out >> log
echo "** DXX **" >> log
cat dxx-out >> log
rm -f cxx-out dxx-out
exit 1
fi
else
echo "$0: parse-dxx failed" >> log
cat dxx-out >> log
rm -f cxx-out dxx-out
exit 1
fi
fi
rm -f cxx-out dxx-out
exit 0
else
echo "$0: parse-cxx failed" >> log
cat cxx-out >> log
rm -f cxx-out dxx-out
exit 1
fi
#! /bin/sh
. ./defs || exit 1
. ./dirs || exit 1
rm -f $me.visamb $me.disambcc $me.diff
if g++ -ansi -pedantic -fsyntax-only "${SRCDIR}"/"$me.cc" &> /dev/null; then
if make $me.visamb $me.diff; then
exit 0
else
exit -1
fi
else
if make $me.visamb $me.diff; then
exit -1
else
exit 0
fi
fi
include $(top_srcdir)/config/Makefile.xt
include $(top_srcdir)/config/check-rules.mk
# Each test case depends on defs.
check_SCRIPTS = defs dirs
defs: $(top_builddir)/config/defs
ln -s $(top_builddir)/config/defs .
dirs:
echo "SRCDIR=\"$(srcdir)\"" >dirs
$(TESTS): test.test
for i in $(TESTS); do ln -fs $< $$i; done
TESTS = \
postfix-bracket-01.test \
postfix-bracket-02.test \
postfix-bracket-03.test \
primary-lit-integer-01.test \
primary-lit-integer-02.test \
primary-lit-integer-03.test \
primary-lit-integer-04.test \
primary-lit-integer-05.test \
primary-lit-integer-10.test \
primary-lit-integer-11-fail.test \
primary-lit-integer-12.test \
primary-lit-integer-13-fail.test \
primary-lit-integer-14.test \
primary-lit-integer-15-fail.test \
primary-lit-integer-16.test \
primary-lit-integer-17-fail.test \
primary-par.test \
primary-this.test
postfix-bracket-01 \
postfix-bracket-02 \
postfix-bracket-03 \
primary-lit-integer-01 \
primary-lit-integer-02 \
primary-lit-integer-03 \
primary-lit-integer-04 \
primary-lit-integer-05 \
primary-lit-integer-10 \
primary-lit-integer-11-fail \
primary-lit-integer-12 \
primary-lit-integer-13-fail \
primary-lit-integer-14 \
primary-lit-integer-15-fail \
primary-lit-integer-16 \
primary-lit-integer-17-fail \
primary-par \
primary-this
EXTRA_DIST = test.test $(TESTS:.test=.cc)
XFAIL_TESTS = \
primary-lit-integer-11-fail \
primary-lit-integer-13-fail \
primary-lit-integer-15-fail \
primary-lit-integer-17-fail
CLEANFILES = defs \
dirs \
$(TESTS) \
$(TESTS:.test=.visamb) \
$(TESTS:.test=.disambcc) \
$(TESTS:.test=.diff) \
$(TESTS:.test=.astcc2)
EXTRA_DIST = test $(TESTS:=.cc)
......@@ -5,4 +5,4 @@ class Foo
{
void *foo = this;
}
}
};
#!/bin/sh
if make SRC="$0.cc" parse-cxx &> /dev/null
then
if [ -f "$0.detcc" ]
then
if make SRC="$0.detcc" parse-dxx &> /dev/null
then
if cmp -s cxx-out dxx-out
then
echo "$0: cxx != dxx" >> log
echo "** CXX **" >> log
cat cxx-out >> log
echo "** DXX **" >> log
cat dxx-out >> log
rm -f cxx-out dxx-out
exit 1
fi
else
echo "$0: parse-dxx failed" >> log
cat dxx-out >> log
rm -f cxx-out dxx-out
exit 1
fi
fi
rm -f cxx-out dxx-out
exit 0
else
echo "$0: parse-cxx failed" >> log
cat cxx-out >> log
rm -f cxx-out dxx-out
exit 1
fi
#! /bin/sh
. ./defs || exit 1
. ./dirs || exit 1
rm $me.visamb $me.disambcc
if g++ -ansi -pedantic -fsyntax-only "${SRCDIR}"/"$me.cc" -o /dev/null &> /dev/null; then
if make $me.visamb; then
exit 0
else
exit -1
fi
else
if make $me.visamb; then
exit -1
else
exit 0
fi
fi
This diff is collapsed.
#!/bin/sh
if make SRC="$0.C" parse-cxx &> /dev/null
then
rm -f cxx-out
exit 0
else
echo "$0: parse-cxx failed" >> log
cat cxx-out >> log
rm -f cxx-out
exit 1
fi
#!/bin/sh
SRC=`echo "$0" | sed s/\.test\$//`
if g++ -ansi -pedantic -fsyntax-only "$SRC.C" &> /dev/null; then
if make check-parser SRC=$SRC &> /dev/null; then
exit 0
else
exit -1
fi
else
if make check-parser SRC=$SRC &> /dev/null; then
exit -1
else
exit 0
fi
fi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment