Commit 8cc5c167 authored by david_v's avatar david_v
Browse files

2004-02-13 Valentin David <valentin@lrde.epita.fr>

	* src/disamb/declarator/ValidDeclarator.str,
	* src/disamb/declarator/ParameterDeclaratorCandidate.str,
	* src/disamb/declarator/ParameterDeclarator.str,
	* src/disamb/declarator/MemberDeclaratorCandidate.str,
	* src/disamb/declarator/MemberDeclarator.str,
	* src/disamb/declarator/Makefile.am,
	* src/disamb/declarator/afcxx-declarator.str,
	* src/disamb/declarator/InitializerDeclaratorCandidate.str,
	* src/disamb/declarator/InitializerDeclarator.str,
	* src/disamb/declarator/IfDebug.str,
	* src/disamb/declarator/FunctionDeclarator.str,
	* src/disamb/declarator/Declarator.str,
	* src/disamb/declarator/ValidDeclarator.meta,
	* src/disamb/declarator/ParameterDeclaratorCandidate.meta,
	* src/disamb/declarator/ParameterDeclarator.meta,
	* src/disamb/declarator/MemberDeclaratorCandidate.meta,
	* src/disamb/declarator/InitializerDeclaratorCandidate.meta,
	* src/disamb/declarator/MemberDeclarator.meta,
	* src/disamb/declarator/InitializerDeclarator.meta,
	* src/disamb/declarator/FunctionDeclarator.meta,
	* src/disamb/declarator/Declarator.meta:
	Delete. It needed context to know (class names) to accept constructors.

	* configure.ac, src/disamb/Makefile.am,
	* src/parser/parse-cxx.str, config/check-rules.mk: Update.

	* src/disamb/disambiguate/Lookup.str:
	Delete deprecated imports.

	* src/disamb/disambiguate/TypeDefinition.str,
	* src/disamb/disambiguate/TemplateDefinition.str,
	* src/disamb/disambiguate/TemplateClassDefinition.str,
	* src/disamb/disambiguate/ResolveCompound.str,
	* src/disamb/disambiguate/Resolve.str,
	* src/disamb/disambiguate/NamespaceDefinition.str,
	* src/disamb/disambiguate/Makefile.am,
	* src/disamb/disambiguate/Definition.str,
	* src/disamb/disambiguate/ClassDefinition.str,
	* src/disamb/disambiguate/TemplateFunctionDefinition.str:
	Do the former job of afcxx-declarator.

	* src/disamb/disambiguate/SimpleDeclarationAmbiguity.str,
	* src/disamb/disambiguate/SimpleDeclarationAmbiguity.meta,
	* src/disamb/disambiguate/InitDeclaratorAmbiguity.str,
	* src/disamb/disambiguate/InitDeclaratorAmbiguity.meta,
	* src/disamb/disambiguate/FunctionDefinitionAmbiguity.str,
	* src/disamb/disambiguate/FunctionDefinitionAmbiguity.meta,
	* src/disamb/disambiguate/ConstructorDefinition.str,
	* src/disamb/disambiguate/ConstructorDefinition.meta,
	* src/disamb/disambiguate/DeclaratorIdAmbiguity.str,
	* src/disamb/disambiguate/DeclaratorIdAmbiguity.meta: New.

	* test/disambiguate/Makefile.am: Update.

	* test/g++/template/Makefile.am, test/g++/overload/Makefile.am,
	* test/g++/other/Makefile.am, test/g++/opt/Makefile.am,
	* test/g++/init/Makefile.am, test/g++/inherit/Makefile.am,
	* test/g++/eh/Makefile.am, test/g++/debug/Makefile.am (XFAIL_TESTS):
	Update.

	* test/disambiguate/simple-decl-02.detcc,
	* test/disambiguate/simple-decl-02.cc,
	* test/disambiguate/simple-decl-01.detcc,
	* test/disambiguate/simple-decl-01.cc: New.
parent fd6637b7
2004-02-13 Valentin David <valentin@lrde.epita.fr>
* src/disamb/declarator/ValidDeclarator.str,
* src/disamb/declarator/ParameterDeclaratorCandidate.str,
* src/disamb/declarator/ParameterDeclarator.str,
* src/disamb/declarator/MemberDeclaratorCandidate.str,
* src/disamb/declarator/MemberDeclarator.str,
* src/disamb/declarator/Makefile.am,
* src/disamb/declarator/afcxx-declarator.str,
* src/disamb/declarator/InitializerDeclaratorCandidate.str,
* src/disamb/declarator/InitializerDeclarator.str,
* src/disamb/declarator/IfDebug.str,
* src/disamb/declarator/FunctionDeclarator.str,
* src/disamb/declarator/Declarator.str,
* src/disamb/declarator/ValidDeclarator.meta,
* src/disamb/declarator/ParameterDeclaratorCandidate.meta,
* src/disamb/declarator/ParameterDeclarator.meta,
* src/disamb/declarator/MemberDeclaratorCandidate.meta,
* src/disamb/declarator/InitializerDeclaratorCandidate.meta,
* src/disamb/declarator/MemberDeclarator.meta,
* src/disamb/declarator/InitializerDeclarator.meta,
* src/disamb/declarator/FunctionDeclarator.meta,
* src/disamb/declarator/Declarator.meta:
Delete. It needed context to know (class names) to accept constructors.
* configure.ac, src/disamb/Makefile.am,
* src/parser/parse-cxx.str, config/check-rules.mk: Update.
* src/disamb/disambiguate/Lookup.str:
Delete deprecated imports.
* src/disamb/disambiguate/TypeDefinition.str,
* src/disamb/disambiguate/TemplateDefinition.str,
* src/disamb/disambiguate/TemplateClassDefinition.str,
* src/disamb/disambiguate/ResolveCompound.str,
* src/disamb/disambiguate/Resolve.str,
* src/disamb/disambiguate/NamespaceDefinition.str,
* src/disamb/disambiguate/Makefile.am,
* src/disamb/disambiguate/Definition.str,
* src/disamb/disambiguate/ClassDefinition.str,
* src/disamb/disambiguate/TemplateFunctionDefinition.str:
Do the former job of afcxx-declarator.
* src/disamb/disambiguate/SimpleDeclarationAmbiguity.str,
* src/disamb/disambiguate/SimpleDeclarationAmbiguity.meta,
* src/disamb/disambiguate/InitDeclaratorAmbiguity.str,
* src/disamb/disambiguate/InitDeclaratorAmbiguity.meta,
* src/disamb/disambiguate/FunctionDefinitionAmbiguity.str,
* src/disamb/disambiguate/FunctionDefinitionAmbiguity.meta,
* src/disamb/disambiguate/ConstructorDefinition.str,
* src/disamb/disambiguate/ConstructorDefinition.meta,
* src/disamb/disambiguate/DeclaratorIdAmbiguity.str,
* src/disamb/disambiguate/DeclaratorIdAmbiguity.meta: New.
* test/disambiguate/Makefile.am: Update.
* test/g++/template/Makefile.am, test/g++/overload/Makefile.am,
* test/g++/other/Makefile.am, test/g++/opt/Makefile.am,
* test/g++/init/Makefile.am, test/g++/inherit/Makefile.am,
* test/g++/eh/Makefile.am, test/g++/debug/Makefile.am (XFAIL_TESTS):
Update.
* test/disambiguate/simple-decl-02.detcc,
* test/disambiguate/simple-decl-02.cc,
* test/disambiguate/simple-decl-01.detcc,
* test/disambiguate/simple-decl-01.cc: New.
* lib/prelude/Strings.str, lib/prelude/Conditionals.str,
* lib/prelude/Booleans.str: Delete.
......
......@@ -18,7 +18,6 @@ CXX_PP_AF=$(top_builddir)/src/syn/Cxx.pp.af
$(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/bitfield/afcxx-bitfield -S | \
$(top_builddir)/src/disamb/classparam/afcxx-classparam -S | \
$(top_builddir)/src/disamb/resolve/afcxx-resolve -S | \
......
......@@ -103,7 +103,6 @@ AC_CONFIG_FILES([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
......
This diff is collapsed.
......@@ -2,7 +2,6 @@ include $(top_srcdir)/config/Makefile.xt
SUBDIRS = \
declaration \
declarator \
disambiguate \
namespace \
resolve \
......
/*
* Copyright (C) 2003 EPITA Research and Development Laboratory
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
module IfDebug
strategies
ifdebug (s) = s
/*
* Copyright (C) 2003 EPITA Research and Development Laboratory
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
module InitializerDeclarator
imports
lib
imports
AsFix2-Syntax asfix Cxx
Declarator
InitializerDeclaratorCandidate
rules
InitializerDeclarator : |InitDeclarator[ Declarator la Initializer-opt ]| -> |InitDeclarator[ Declarator' la Initializer-opt ]|
where < oncetd (declarator) > Declarator => Declarator'
strategies
initializer-declarator-single = (initializer-declarator-candidate;
InitializerDeclarator)
/*
* Copyright (C) 2003 EPITA Research and Development Laboratory
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
module InitializerDeclaratorCandidate
imports
lib
imports
AsFix2-Syntax asfix Cxx
rules
InitializerDeclaratorCandidate : a@|InitDeclarator[ Declarator Initializer-opt ]| -> a
strategies
initializer-declarator-candidate = InitializerDeclaratorCandidate
include $(top_srcdir)/config/Makefile.xt
-include afcxx-declarator.c.dep
-include afcxx-declarator-ast.c.dep
SRCS = \
Declarator.str \
FunctionDeclarator.str \
IfDebug.str \
InitializerDeclarator.str \
InitializerDeclaratorCandidate.str \
afcxx-declarator.str \
MemberDeclarator.str \
MemberDeclaratorCandidate.str \
ParameterDeclarator.str \
ParameterDeclaratorCandidate.str \
ValidDeclarator.str \
Declarator.meta \
MemberDeclaratorCandidate.meta \
FunctionDeclarator.meta \
ParameterDeclarator.meta \
InitializerDeclarator.meta \
ParameterDeclaratorCandidate.meta \
InitializerDeclaratorCandidate.meta \
ValidDeclarator.meta \
MemberDeclarator.meta
SCFLAGS = --main $* --verbose 0 --asfix
STRINCLUDES = -I $(ASFIX_TOOLS)/share/asfix-tools \
-I $(top_builddir)/src/sig \
-I $(top_builddir)/src/strategocxx
bin_PROGRAMS = afcxx-declarator afcxx-declarator-ast
BOOTCLEANFILES = afcxx-declarator.c afcxx-declarator-ast.c
EXTRA_DIST = $(SRCS)
CLEANFILES = afcxx-declarator.c.dep afcxx-declarator-ast.c.dep
afcxx-declarator-ast.c: afcxx-declarator.str
$(SCOMPILE) $(STRINCLUDES) --main afcxx-declarator --verbose 0 -i $< -o $@ -c
/*
* Copyright (C) 2003 EPITA Research and Development Laboratory
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
module ParameterDeclarator
imports
lib
imports
AsFix2-Syntax asfix Cxx
Declarator
ParameterDeclaratorCandidate
rules
ParameterDeclarator-0 : |ParameterDeclaration[ DeclSpecifierSeq la Declarator ]| -> |ParameterDeclaration[ DeclSpecifierSeq la Declarator' ]|
where < oncetd (declarator) > Declarator => Declarator'
ParameterDeclarator-1 : |ParameterDeclaration[ DeclSpecifierSeq la1 Declarator la2 = la3 AssignmentExpression ]|
-> |ParameterDeclaration[ DeclSpecifierSeq la1 Declarator' la2 = la3 AssignmentExpression ]|
where < oncetd (declarator) > Declarator => Declarator'
strategies
parameter-declarator-candidate = (parameter-declarator-candidate-0 +
parameter-declarator-candidate-1)
parameter-declarator-single = (parameter-declarator-candidate-0;
ParameterDeclarator-0) +
(parameter-declarator-candidate-1;
ParameterDeclarator-1)
/*
* Copyright (C) 2003 EPITA Research and Development Laboratory
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
module ParameterDeclaratorCandidate
imports
lib
imports
AsFix2-Syntax asfix Cxx
rules
ParameterDeclaratorCandidate-0 : a@|ParameterDeclaration[ DeclSpecifierSeq Declarator ]| -> a
ParameterDeclaratorCandidate-1 : a@|ParameterDeclaration[ DeclSpecifierSeq Declarator = AssignmentExpression ]| -> a
strategies
parameter-declarator-candidate-0 = ParameterDeclaratorCandidate-0
parameter-declarator-candidate-1 = ParameterDeclaratorCandidate-1
/*
* Copyright (C) 2003 EPITA Research and Development Laboratory
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
module ValidDeclarator
imports
lib
imports
AsFix2-Syntax asfix Cxx
rules
ValidDeclarator : a@|DeclaratorId[ IdExpression ]| -> a
strategies
valid-declarator = ValidDeclarator
......@@ -37,7 +37,7 @@ rules
// Process definition of class C in namespace N.
//
ClassDefinition : a@|ClassSpecifier[ ClassKey ID BaseClause-opt { MemberSpecification-opt } ]| -> a
ClassDefinition : a@|ClassSpecifier[ ClassKey la1 ID la2 BaseClause-opt la3 { la4 MemberSpecification-opt la5 } ]| -> |ClassSpecifier[ ClassKey la1 ID la2 BaseClause-opt la3 { la4 MemberSpecification-opt' la5 } ]|
where < identifier > ID => c // Read identifier (name of C).
; < rewrite (!"$namespace") > "$value" => d // Get current namespace name.
; < assert (!d) > (c, class-kind) // In N, mark C as being a class.
......@@ -48,7 +48,7 @@ rules
; < init-name-space (!e) > a // Initialize symbol table for N.
; < begin-scope (!"$namespace") > a // Save old current namespace name.
; < assert (!"$namespace") > ("$value", e) // Set new current namespace name.
; < definition > MemberSpecification-opt // Process the class definition body.
; < definition > MemberSpecification-opt => MemberSpecification-opt' // Process the class definition body.
; < end-scope (!"$namespace") > a // Restore old current namespace name.
; < concat-strings; debug > ["- Definition of class", " ", e']
......
/*
* Copyright (C) 2003 EPITA Research and Development Laboratory
* Copyright (C) 2004 EPITA Research and Development Laboratory
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
module MemberDeclaratorCandidate
module ConstructorDefinition
imports
......@@ -24,17 +24,23 @@ imports
imports
AsFix2-Syntax asfix Cxx
AsFix2-Syntax
asfix
Cxx
Definition
rules
MemberDeclaratorCandidate-1 : a@|MemberDeclarator[ Declarator ]| -> a
Member : |MemberDeclarator[ DirectDeclarator la1 ( la2 ParameterDeclarationClause la3 ) la4 CvQualifierSeq-opt la5 ExceptionSpecification-opt ]| ->
|MemberDeclarator[ DirectDeclarator' la1 ( la2 ParameterDeclarationClause la3 ) la4 CvQualifierSeq-opt la5 ExceptionSpecification-opt ]|
where < resolve > DirectDeclarator => DirectDeclarator'
; < oncetd(?|DeclaratorId[ Dummy0-opt NestedNameSpecifier-opt TypeName ]|) > DirectDeclarator'
MemberDeclaratorCandidate-2 : a@|MemberDeclarator[ Declarator PureSpecifier ]| -> a
MemberDeclaratorCandidate-2 : a@|MemberDeclarator[ Declarator ConstantInitializer ]| -> a
ConstructorDefinition : |MemberDeclaration[ DeclSpecifierSeq-opt la1 MemberDeclaratorList-opt la2 ; ]| -> |MemberDeclaration[ DeclSpecifierSeq-opt la1 MemberDeclaratorList-opt' la2 ; ]|
where < oncetd(Member) > MemberDeclaratorList-opt => MemberDeclaratorList-opt'
strategies
member-declarator-candidate-1 = MemberDeclaratorCandidate-1
member-declarator-candidate-2 = MemberDeclaratorCandidate-2
constructor-definition = ConstructorDefinition
constructor-definition-stop(s) = ConstructorDefinition
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