Commit afdaf203 authored by david_v's avatar david_v
Browse files

See ChangeLog ;)

parent 6253154f
This diff is collapsed.
include $(top_srcdir)/config/Makefile.xt
ACLOCAL_AMFLAGS = -I config
SUBDIRS = config src test
SUBDIRS = config lib src test
BOOTCLEAN_SUBDIRS = src
EXTRA_DIST = bootstrap ChangeLog
XTC_IMPORT = $(STRATEGOXT)/share/StrategoXT/XTC
## Makefile.am -- Process this file with automake to produce Makefile.in
##
bin_SCRIPTS = sdf-check
noinst_SCRIPTS = defs
MAINTAINERCLEANFILES = \
Makefile.in \
......@@ -15,4 +15,5 @@ depcomp
EXTRA_DIST = \
autoxt.m4 \
Makefile.xt
Makefile.xt \
check-rules.mk
# -*-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
# 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 $@
# Disambiguation
.ptcc.disambcc:
$(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/declarator/afcxx-declarator -S | \
$(top_builddir)/src/disamb/specifier/afcxx-specifier -S | \
$(top_builddir)/src/disamb/disambiguate/afcxx-disambiguate -S \
> $@
# Implosion
.disambcc.astcc:
$(ASFIX_TOOLS)/bin/implode-asfix -i $< -o $@
# 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 $(<:.astcc=.detcc) | \
$(ASFIX_TOOLS)/bin/implode-asfix > $(<:.astcc=.astcc2)
diff $< $(<:.astcc=.astcc2) > $@
# Pretty Printing
.astcc.ppcc: $(CXX_PP_AF)
$(GPP)/bin/ast2text -p $(CXX_PP_AF) -i $< -o $@
#! /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.
:
#!/bin/sh
PARSE=@SGLR@/bin/sglr
UNPARSE=@ASFIX_TOOLS@/bin/asfix-yield
table=@top_builddir@/src/syn/Cxx.tbl
tmp1=$(tempfile)
tmp2=$(tempfile)
for file in "$@"; do
echo -n "$file"
g++ -ansi -pedantic -fsyntax-only "$file" -o /dev/null &> /dev/null
if [ $? -eq 0 ]; then
$PARSE -fi -p $table -i "$file" | $UNPARSE > $tmp1 && \
$PARSE -fi -p $table -i $tmp1 | $UNPARSE > $tmp2 && \
diff $tmp1 $tmp2
if [ $? -eq 0 ]; then
echo ": ok [1]"
else
echo ": error"
fi
else
$PARSE -fr -p $table -i "$file" > /dev/null &> /dev/null
if [ $? -eq 0 ]; then
echo ": error, expecting failure"
else
echo ": ok [2]"
fi
fi
done
rm -f $tmp1
rm -f $tmp2
......@@ -15,15 +15,15 @@ AC_INIT(cxx-grammar, 0.1)
# Auxiliary files
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_FILES(config/Makefile)
AC_CONFIG_FILES([config/sdf-check],
[chmod +x config/sdf-check])
AC_CONFIG_FILES([config/defs],
[chmod +x config/defs])
AM_INIT_AUTOMAKE([1.7.3 dist-bzip2])
USE_XT_PACKAGES
test "x$prefix" = xNONE && prefix=$ac_default_prefix
USE_XT_PACKAGES
AC_ARG_WITH(lrde-sdftools,
[ --with-lrde-sdftools=DIR Specify location of LRDE_SDF, [PREFIX]],
LRDE_SDF="$withval",
......@@ -65,6 +65,9 @@ AC_SUBST(COMPILER_SYNTAX_CHECK)
# Output Files
AC_CONFIG_FILES([Makefile
lib/Makefile
lib/cxx/Makefile
lib/prelude/Makefile
src/Makefile
src/syn/Makefile
src/cxxsdf/Makefile
......@@ -73,5 +76,27 @@ AC_CONFIG_FILES([Makefile
src/pp/Makefile
src/sdf/Makefile
src/strategocxx/Makefile
test/Makefile])
src/parser/Makefile
src/disamb/Makefile
src/disamb/declaration/Makefile
src/disamb/declarator/Makefile
src/disamb/disambiguate/Makefile
src/disamb/namespace/Makefile
src/disamb/resolve/Makefile
src/disamb/specifier/Makefile
test/Makefile
test/disambiguate/Makefile
test/expressions/Makefile
test/g++/Makefile
test/g++/abi/Makefile
test/g++/debug/Makefile
test/g++/eh/Makefile
test/g++/inherit/Makefile
test/g++/init/Makefile
test/g++/lookup/Makefile
test/g++/opt/Makefile
test/g++/other/Makefile
test/g++/overload/Makefile
test/g++/parse/Makefile
test/g++/template/Makefile])
AC_OUTPUT
include $(top_srcdir)/config/Makefile.xt
SUBDIRS = cxx prelude
BOOTCLEAN_SUBDIRS = $(SUBDIRS)
module BaseSpecifiersOverlays
imports
AsFix2-Syntax
overlays
// The following overlay stands for this rule:
// "::"? NestedNameSpecifier? ClassName -> BaseSpecifier
base-specifier-1-overlay (x0, l0, x1, l1, x2, as) =
appl (prod ([cf (opt (sort ("Dummy0"))),
cf (opt (layout)),
cf (opt (sort ("NestedNameSpecifier"))),
cf (opt (layout)),
cf (sort ("ClassName"))],
cf (sort ("BaseSpecifier")),
attrs (as)),
[x0, l0, x1, l1, x2])
// The following overlay stands for this rule:
// "virtual" AccessSpecifier? "::"? NestedNameSpecifier? ClassName -> BaseSpecifier
base-specifier-2-overlay (l0, x0, l1, x1, l2, x2, l3, x3, as) =
appl (prod ([lit ("virtual"),
cf (opt (layout)),
cf (opt (sort ("AccessSpecifier"))),
cf (opt (layout)),
cf (opt (sort ("Dummy0"))),
cf (opt (layout)),
cf (opt (sort ("NestedNameSpecifier"))),
cf (opt (layout)),
cf (sort ("ClassName"))],
cf (sort ("BaseSpecifier")),
attrs (as)),
[appl (prod ([char-class ([118]),
char-class ([105]),
char-class ([114]),
char-class ([116]),
char-class ([117]),
char-class ([97]),
char-class ([108])],
lit ("virtual"),
no-attrs),
[118, 105, 114, 116, 117, 97, 108]),
l0, x0, l1, x1, l2, x2, l3, x3])
// The following overlay stands for this rule:
// AccessSpecifier "virtual"? "::"? NestedNameSpecifier? ClassName -> BaseSpecifier
base-specifier-3-overlay (x0, l0, x1, l1, x2, l2, x3, l3, x4, as) =
appl (prod ([cf (sort ("AcessSpecifier")),
cf (opt (layout)),
cf (opt (sort ("Dummy7"))),
cf (opt (layout)),
cf (opt (sort ("Dummy0"))),
cf (opt (layout)),
cf (opt (sort ("NestedNameSpecifier"))),
cf (opt (layout)),
cf (sort ("ClassName"))],
cf (sort ("BaseSpecifier")),
attrs (as)),
[x0, l0, x1, l1, x2, l2, x3, l3, x4])
// The following overlay may be used where one wants to match at the same time
// base-specifier-2-overlay and base-specifier-3-overlay:
// "virtual" AccessSpecifier? "::"? NestedNameSpecifier? ClassName -> BaseSpecifier
// AccessSpecifier "virtual"? "::"? NestedNameSpecifier? ClassName -> BaseSpecifier
base-specifier-23-overlay (va0-r, va0, l0, va1-r, va1, l1, x0, l2, x1, l3, x2, as) =
appl (prod ([va0-r,
cf (opt (layout)),
va1-r,
cf (opt (layout)),
cf (opt (sort ("Dummy0"))),
cf (opt (layout)),
cf (opt (sort ("NestedNameSpecifier"))),
cf (opt (layout)),
cf (sort ("ClassName"))],
cf (sort ("BaseSpecifier")),
attrs (as)),
[va0, l0, va1, l1, x0, l2, x1, l3, x2])
module ClassSpecifiersOverlays
imports
AsFix2-Syntax
overlays
class-head-1-overlay (x0, l0, x1, l1, x2, as) =
appl (prod ([cf (sort ("ClassKey")),
cf (opt (layout)),
cf (opt (sort ("Identifier"))),
cf (opt (layout)),
cf (opt (sort ("BaseClause")))],
cf (sort ("ClassHead")),
attrs (as)),
[x0, l0, x1, l1, x2])
class-head-2-overlay (x0, l0, x1, l1, x2, l2, x3, as) =
appl (prod ([cf (sort ("ClassKey")),
cf (opt (layout)),
cf (sort ("NestedNameSpecifier")),
cf (opt (layout)),
cf (sort ("Identifier")),
cf (opt (layout)),
cf (opt (sort ("BaseClause")))],
cf (sort ("ClassHead")),
attrs (as)),
[x0, l0, x1, l1, x2, l2, x3])
class-head-3-overlay (x0, l0, x1, l1, x2, l2, x3, as) =
appl (prod ([cf (sort ("ClassKey")),
cf (opt (layout)),
cf (opt (sort ("NestedNameSpecifier"))),
cf (opt (layout)),
cf (sort ("TemplateId")),
cf (opt (layout)),
cf (opt (sort ("BaseClause")))],
cf (sort ("ClassHead")),
attrs (as)),
[x0, l0, x1, l1, x2, l2, x3])
class-specifier-overlay (x0, l0, l1, x1, l2, as) =
appl (prod ([cf (sort ("ClassHead")),
cf (opt (layout)),
lit ("{"),
cf (opt (layout)),
cf (opt (sort ("MemberSpecification"))),
cf (opt (layout)),
lit ("}")],
cf (sort ("ClassSpecifier")),
attrs (as)),
[x0, l0,
appl (prod ([char-class ([123])], lit ("{"), no-attrs), [123]),
l1, x1, l2,
appl (prod ([char-class ([125])], lit ("}"), no-attrs), [125])])
module CompoundStatementsOverlays
imports
lib
imports
AsFix2-Syntax
overlays
compound-statement-overlay (l0, x0, l1, as) =
appl (prod ([lit ("{"),
cf (opt (layout)),
cf (opt (sort ("StatementSeq"))),
cf (opt (layout)),
lit ("}")],
cf (sort ("CompoundStatement")),
as),
[appl (prod ([char-class ([123])], lit ("{"), no-attrs), [123]),
l0, x0, l1,
appl (prod ([char-class ([125])], lit ("}"), no-attrs), [125])])
module DeclarationsOverlays
imports
AsFix2-Syntax
overlays
declaration-1-overlay (x, as) =
appl (prod ([cf (sort ("BlockDeclaration"))],
cf (sort ("Declaration")),
attrs (as)),
[x])
declaration-2-overlay (x, as) =
appl (prod ([cf (sort ("FunctionDefinition"))],
cf (sort ("Declaration")),
attrs (as)),
[x])
declaration-3-overlay (x, as) =
appl (prod ([cf (sort ("TemplateDeclaration"))],
cf (sort ("Declaration")),
attrs (as)),
[x])
declaration-4-overlay (x, as) =
appl (prod ([cf (sort ("ExplicitInstantiation"))],
cf (sort ("Declaration")),
attrs (as)),
[x])
declaration-5-overlay (x, as) =
appl (prod ([cf (sort ("ExplicitSpecialization"))],
cf (sort ("Declaration")),
attrs (as)),
[x])
declaration-6-overlay (x, as) =
appl (prod ([cf (sort ("LinkageSpecification"))],
cf (sort ("Declaration")),
attrs (as)),
[x])
declaration-7-overlay (x, as) =
appl (prod ([cf (sort ("NamespaceDefinition"))],
cf (sort ("Declaration")),
attrs (as)),
[x])
block-declaration-1-overlay (x, as) =
appl (prod ([cf (sort ("SimpleDeclaration"))],
cf (sort ("BlockDeclaration")),
attrs (as)),
[x])
block-declaration-2-overlay (x, as) =
appl (prod ([cf (sort ("AsmDefinition"))],
cf (sort ("BlockDeclaration")),
attrs (as)),
[x])
block-declaration-3-overlay (x, as) =
appl (prod ([cf (sort ("NamespaceAliasDefinition"))],
cf (sort ("BlockDeclaration")),
attrs (as)),
[x])
block-declaration-4-overlay (x, as) =
appl (prod ([cf (sort ("UsingDeclaration"))],
cf (sort ("BlockDeclaration")),
attrs (as)),
[x])
block-declaration-5-overlay (x, as) =
appl (prod ([cf (sort ("UsingDirective"))],
cf (sort ("BlockDeclaration")),
attrs (as)),
[x])
simple-declaration-overlay (x0, l0, x1, l1, as) =
appl (prod ([cf (opt (sort ("DeclSpecifierSeq"))),
cf (opt (layout)),
cf (opt (sort ("InitDeclaratorList"))),
cf (opt (layout)),
lit (";")],
cf (sort ("SimpleDeclaration")),
attrs (as)),
[x0, l0, x1, l1,
appl (prod ([char-class ([59])], lit (";"), no-attrs), [59])])
module IdExpressionsOverlays
imports
AsFix2-Syntax
overlays
qualified-id-overlay (x0, l0, x1, l1, x2, l2, x3, as) =
appl (prod ([cf (opt (sort ("Dummy0"))),
cf (opt (layout)),
cf (sort ("NestedNameSpecifier")),
cf (opt (layout)),
cf (opt (sort ("Dummy5"))),
cf (opt (layout)),
cf (sort ("UnqualifiedId"))],
cf (sort ("QualifiedId")),
as),
[x0, l0, x1, l1, x2, l2, x3])
nested-name-specifier-overlay (x0, l0, l1, x1, as) =
appl (prod ([cf (sort ("ClassOrNamespaceName")),
cf (opt (layout)),
lit ("::"),
cf (opt (layout)),
cf (opt (sort ("NestedNameSpecifier")))],
cf (sort ("NestedNameSpecifier")),
as),
[x0, l0,
appl (prod ([char-class ([58]), char-class ([58])], lit ("::"), no-attrs), [58, 58]),
l1, x1])
include $(top_srcdir)/config/Makefile.xt
EXTRA_DIST = \
ClassSpecifiersOverlays.str \
DeclarationsOverlays.str \
SimpleTypeSpecifiersOverlays.str \
SpecifiersOverlays.str \
TemplateDeclarationsOverlays.str \
TemplateIdsOverlays.str
module MemberSpecificationsOverlays
imports
AsFix2-Syntax
overlays
member-declaration-overlay (x0, l0, x1, l1, as) =
appl (prod ([cf (opt (sort ("DeclSpecifierSeq"))),
cf (opt (layout)),
cf (opt (sort ("MemberDeclaratorList"))),
cf (opt (layout)),
lit (";")],
cf (sort ("MemberDeclaration")),
attrs (as)),
[x0, l0, x1, l1,
appl (prod ([char-class ([59])], lit (";"), no-attrs), [59])])
module NamespacesOverlays
imports
AsFix2-Syntax
overlays
original-namespace-definition-overlay (x0, as) =
appl (prod ([cf (sort ("OriginalNamespaceDefinition"))],
cf (sort ("NamedNamespaceDefinition")),
attrs (as)),
[x0])
extension-namespace-definition-overlay (x0, as) =
appl (prod ([cf (sort ("ExtensionNamespaceDefinition"))],
cf (sort ("NamedNamespaceDefinition")),
attrs (as)),
[x0])
namespace-overlay (l0, x0, l1, l2, x1, l3, as) =
appl (prod ([lit ("namespace"),
cf (opt (layout)),
cf (sort ("Identifier")),
cf (opt (layout)),
lit ("{"),
cf (opt (layout)),
cf (sort ("NamespaceBody")),
cf (opt (layout)),
lit ("}")],
cf (sort ("OriginalNamespaceDefinition")),
attrs (as)),
[appl (prod ([char-class ([110]), char-class ([97]),
char-class ([109]), char-class ([101]),
char-class ([115]), char-class ([112]),
char-class ([97]), char-class ([99]),
char-class ([101])],
lit("namespace"),
no-attrs),
[110, 97, 109, 101, 115, 112, 97, 99, 101]),
l0, x0, l1,
appl (prod ([char-class ([123])], lit("{"), no-attrs), [123]),
l2, x1, l3,
appl (prod ([char-class ([125])], lit ("}"), no-attrs), [125])])
namespace-1-overlay (l0, x0, l1, l2, x1, l3, as) =
appl (prod ([lit ("namespace"),
cf (opt (layout)),
cf (sort ("OriginalNamespaceName")),
cf (opt (layout)),
lit ("{"),
cf (opt (layout)),
cf (sort ("NamespaceBody")),
cf (opt (layout)),
lit ("}")],
cf (sort ("ExtensionNamespaceDefinition")),
attrs (as)),
[appl (prod ([char-class ([110]), char-class ([97]),
char-class ([109]), char-class ([101]),
char-class ([115]), char-class ([112]),
char-class ([97]), char-class ([99]),
char-class ([101])],
lit("namespace"),
no-attrs),
[110, 97, 109, 101, 115, 112, 97, 99, 101]),
l0, x0, l1,
appl (prod ([char-class ([123])], lit("{"), no-attrs), [123]),
l2, x1, l3,
appl (prod ([char-class ([125])], lit ("}"), no-attrs), [125])])
module SimpleTypeSpecifiersOverlays
imports
AsFix2-Syntax
overlays
simple-type-specifier-overlay (x, l, x', l', x'', as) =
appl (prod ([cf (opt (sort ("Dummy0"))),
cf (opt (layout)),
cf (opt (sort ("NestedNameSpecifier"))),
cf (opt (layout)),
cf (sort ("TypeName"))],
cf (sort ("SimpleTypeSpecifier")),
attrs (as)),
[x, l, x', l', x''])
module SpecifiersOverlays
imports
AsFix2-Syntax