Commit db87f456 authored by david_v's avatar david_v
Browse files

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

	* src/disamb/disambiguate/SizeofAmbiguity.str,
	* src/disamb/disambiguate/SizeofAmbiguity.meta: New.

	* src/disamb/disambiguate/Resolve.str,
	* src/disamb/disambiguate/ResolveCompound.str:
	Handle "sizeof" ambiguities.

	* test/g++/Makefile.am, test/disambiguate/Makefile.am: Update.

	* test/disambiguate/sizeof-02.detcc, test/disambiguate/sizeof-02.cc,
	* test/disambiguate/sizeof-01.detcc, test/disambiguate/sizeof-01.cc:
	New.
parent 73f07e79
2004-02-24 Valentin David <valentin@lrde.epita.fr> 2004-02-24 Valentin David <valentin@lrde.epita.fr>
* src/disamb/disambiguate/SizeofAmbiguity.str,
* src/disamb/disambiguate/SizeofAmbiguity.meta: New.
* src/disamb/disambiguate/Makefile.am: Update.
* src/disamb/disambiguate/Resolve.str,
* src/disamb/disambiguate/ResolveCompound.str:
Handle "sizeof" ambiguities.
* test/g++/Makefile.am, test/disambiguate/Makefile.am: Update.
* test/disambiguate/sizeof-02.detcc, test/disambiguate/sizeof-02.cc,
* test/disambiguate/sizeof-01.detcc, test/disambiguate/sizeof-01.cc:
New.
* test/g++/Makefile.am (XFAIL_TESTS): Update. * test/g++/Makefile.am (XFAIL_TESTS): Update.
2004-02-23 Valentin David <valentin@lrde.epita.fr> 2004-02-23 Valentin David <valentin@lrde.epita.fr>
......
...@@ -75,6 +75,8 @@ SRCS = \ ...@@ -75,6 +75,8 @@ SRCS = \
PrimaryExpressionCandidate.str \ PrimaryExpressionCandidate.str \
Resolve.str \ Resolve.str \
ResolveCompound.str \ ResolveCompound.str \
SizeofAmbiguity.str \
SizeofAmbiguity.meta \
SimpleDeclarationAmbiguity.meta \ SimpleDeclarationAmbiguity.meta \
SimpleDeclarationAmbiguity.str \ SimpleDeclarationAmbiguity.str \
SimpleTypeSpecifier.meta \ SimpleTypeSpecifier.meta \
...@@ -133,6 +135,10 @@ SRCS = \ ...@@ -133,6 +135,10 @@ SRCS = \
VariableDefinitionCandidate.str \ VariableDefinitionCandidate.str \
afcxx-disambiguate.str afcxx-disambiguate.str
afcxx-disambiguate.c: $(SRCS:.str=.rtree)
.str.rtree:
$(PARSESTRATEGO) $(STRINCLUDES) -i $< -o $@ --verbose 0 --asfix
SCFLAGS = --main $* --verbose 0 --asfix SCFLAGS = --main $* --verbose 0 --asfix
STRINCLUDES = -I $(ASFIX_TOOLS)/share/asfix-tools \ STRINCLUDES = -I $(ASFIX_TOOLS)/share/asfix-tools \
-I $(top_builddir)/src/strategocxx \ -I $(top_builddir)/src/strategocxx \
......
...@@ -42,6 +42,7 @@ imports ...@@ -42,6 +42,7 @@ imports
TemplateFunctionTraverse TemplateFunctionTraverse
DeclaratorIdAmbiguity DeclaratorIdAmbiguity
SimpleDeclarationAmbiguity SimpleDeclarationAmbiguity
SizeofAmbiguity
InitDeclaratorAmbiguity InitDeclaratorAmbiguity
FunctionDefinitionAmbiguity FunctionDefinitionAmbiguity
...@@ -58,6 +59,7 @@ strategies ...@@ -58,6 +59,7 @@ strategies
declarator-id-ambiguity-stop(s) <+ declarator-id-ambiguity-stop(s) <+
simple-type-specifier-stop(s) <+ simple-type-specifier-stop(s) <+
simple-declaration-ambiguity-stop(s) <+ simple-declaration-ambiguity-stop(s) <+
sizeof-ambiguity-stop(s) <+
function-definition-ambiguity-stop(s) <+ function-definition-ambiguity-stop(s) <+
init-declarator-ambiguity-stop(s) <+ init-declarator-ambiguity-stop(s) <+
primary-expression-stop(s) <+ primary-expression-stop(s) <+
...@@ -74,6 +76,7 @@ strategies ...@@ -74,6 +76,7 @@ strategies
base-traverse <+ base-traverse <+
simple-type-specifier <+ simple-type-specifier <+
simple-declaration-ambiguity <+ simple-declaration-ambiguity <+
sizeof-ambiguity <+
init-declarator-ambiguity <+ init-declarator-ambiguity <+
function-definition-ambiguity <+ function-definition-ambiguity <+
mem-initializer-id-ambiguity <+ mem-initializer-id-ambiguity <+
...@@ -91,6 +94,7 @@ strategies ...@@ -91,6 +94,7 @@ strategies
base-traverse-candidate <+ base-traverse-candidate <+
simple-type-specifier-candidate <+ simple-type-specifier-candidate <+
simple-declaration-ambiguity-candidate <+ simple-declaration-ambiguity-candidate <+
sizeof-ambiguity-candidate <+
init-declarator-ambiguity-candidate <+ init-declarator-ambiguity-candidate <+
function-definition-ambiguity-candidate <+ function-definition-ambiguity-candidate <+
mem-initializer-id-ambiguity-candidate <+ mem-initializer-id-ambiguity-candidate <+
......
...@@ -35,6 +35,7 @@ imports ...@@ -35,6 +35,7 @@ imports
PostfixExpressionAmbiguity PostfixExpressionAmbiguity
PrimaryExpression PrimaryExpression
SimpleTypeSpecifier SimpleTypeSpecifier
SizeofAmbiguity
StatementAmbiguity StatementAmbiguity
TemplateIdAmbiguity TemplateIdAmbiguity
TemplateTraverse TemplateTraverse
...@@ -54,6 +55,7 @@ strategies ...@@ -54,6 +55,7 @@ strategies
class-traverse-stop(s) <+ class-traverse-stop(s) <+
simple-type-specifier-stop(s) <+ simple-type-specifier-stop(s) <+
simple-declaration-ambiguity-stop(s) <+ simple-declaration-ambiguity-stop(s) <+
sizeof-ambiguity-stop(s) <+
init-declarator-ambiguity-stop(s) <+ init-declarator-ambiguity-stop(s) <+
function-definition-ambiguity-stop(s) <+ function-definition-ambiguity-stop(s) <+
primary-expression-stop(s) <+ primary-expression-stop(s) <+
...@@ -73,6 +75,7 @@ strategies ...@@ -73,6 +75,7 @@ strategies
class-traverse <+ class-traverse <+
simple-type-specifier <+ simple-type-specifier <+
simple-declaration-ambiguity <+ simple-declaration-ambiguity <+
sizeof-ambiguity <+
init-declarator-ambiguity <+ init-declarator-ambiguity <+
function-definition-ambiguity <+ function-definition-ambiguity <+
mem-initializer-id-ambiguity <+ mem-initializer-id-ambiguity <+
...@@ -92,6 +95,7 @@ strategies ...@@ -92,6 +95,7 @@ strategies
class-traverse-candidate <+ class-traverse-candidate <+
simple-type-specifier-candidate <+ simple-type-specifier-candidate <+
simple-declaration-ambiguity-candidate <+ simple-declaration-ambiguity-candidate <+
sizeof-ambiguity-candidate <+
init-declarator-ambiguity-candidate <+ init-declarator-ambiguity-candidate <+
function-definition-ambiguity-candidate <+ function-definition-ambiguity-candidate <+
mem-initializer-id-ambiguity-candidate <+ mem-initializer-id-ambiguity-candidate <+
......
/*
* 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
* 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 SizeofAmbiguity
imports
TypeAmbiguity
AsFix2-Syntax
asfix
Cxx
lib
strategies
sizeof-ambiguity-candidate =
amb(map({TypeId:
?|UnaryExpression[ sizeof ( TypeId ) ]|}
<+
{UnaryExpression:
?|UnaryExpression[ sizeof UnaryExpression ]|}))
; where(<debug> "Candidate for sizeof expression ambiguity")
sizeof-ambiguity-stop(s) = sizeof-ambiguity-candidate
sizeof-ambiguity =
sizeof-ambiguity-candidate
; amb((
filter(?|UnaryExpression[ sizeof ( TypeId ) ]|)
; < resolve > TypeId => TypeId'
; !|UnaryExpression[ sizeof ( TypeId' ) ]|
<+
filter(?|UnaryExpression[ sizeof UnaryExpression ]|)
; < resolve > UnaryExpression => UnaryExpression'
; !|UnaryExpression[ sizeof UnaryExpression ]|)
; ?resolved)
; !resolved
...@@ -63,6 +63,8 @@ TESTS = \ ...@@ -63,6 +63,8 @@ TESTS = \
power-02.test \ power-02.test \
simple-decl-01.test \ simple-decl-01.test \
simple-decl-02.test \ simple-decl-02.test \
sizeof-01.test \
sizeof-02.test \
struct-01.test \ struct-01.test \
template-01.test \ template-01.test \
template-02.test \ template-02.test \
......
struct A {
int i;
};
int f()
{
sizeof(A);
}
struct A {
int /*<uid>*/i/*</uid>*/;
};
int /*<uid>*/f/*</uid>*/()
{
sizeof(/*<cl>*/A/*</cl>*/);
}
int /*<uid>*/f/*</uid>*/()
{
int /*<uid>*/A/*</uid>*/;
sizeof(/*<expr>*/A/*</expr>*/);
}
...@@ -21,10 +21,8 @@ TESTS_ENVIRONMENT = XTC_REPOSITORY=XTC ...@@ -21,10 +21,8 @@ TESTS_ENVIRONMENT = XTC_REPOSITORY=XTC
XFAIL_TESTS = \ XFAIL_TESTS = \
abi/bitfield6.test \ abi/bitfield6.test \
abi/bitfield8.test \
abi/dcast1.test \ abi/dcast1.test \
abi/dtor1.test \ abi/dtor1.test \
abi/empty9.test \
abi/mangle10.test \ abi/mangle10.test \
abi/mangle12.test \ abi/mangle12.test \
abi/mangle14.test \ abi/mangle14.test \
...@@ -37,7 +35,6 @@ XFAIL_TESTS = \ ...@@ -37,7 +35,6 @@ XFAIL_TESTS = \
abi/thunk1.test \ abi/thunk1.test \
abi/thunk2.test \ abi/thunk2.test \
abi/vague1.test \ abi/vague1.test \
abi/vbase11.test \
abi/vbase8-10.test \ abi/vbase8-10.test \
abi/vbase8-21.test \ abi/vbase8-21.test \
abi/vbase8-22.test \ abi/vbase8-22.test \
...@@ -100,9 +97,7 @@ XFAIL_TESTS = \ ...@@ -100,9 +97,7 @@ XFAIL_TESTS = \
inherit/thunk1.test \ inherit/thunk1.test \
inherit/typedef1.test \ inherit/typedef1.test \
init/addr-const1.test \ init/addr-const1.test \
init/array1.test \
init/array11.test \ init/array11.test \
init/array2.test \
init/array3.test \ init/array3.test \
init/array4.test \ init/array4.test \
init/array5.test \ init/array5.test \
......
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