aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/interface.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@gcc.gnu.org>2007-08-18 16:57:21 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2007-08-18 16:57:21 +0200
commit9e1d712c405048f18f246c974865777971c8be16 (patch)
tree266c365803dbf632341bf1d130d28ed8df05998c /gcc/fortran/interface.c
parenta595913e95d59f64670364c3dea31a4774c960f3 (diff)
downloadgcc-9e1d712c405048f18f246c974865777971c8be16.zip
gcc-9e1d712c405048f18f246c974865777971c8be16.tar.gz
gcc-9e1d712c405048f18f246c974865777971c8be16.tar.bz2
[multiple changes]
2007-08-18 Paul Thomas <pault@gcc.gnu.org> Janus Weil <jaydub66@gmail.com> * interface.c (gfc_match_interface,gfc_match_abstract_interface, gfc_match_end_interface,gfc_add_interface): Add abstract interface. * dump-parse-tree.c (gfc_show_attr): Ditto. * gfortran.h (interface_type,symbol_attribute): Ditto. * module.c (gfc_match_use,ab_attribute,attr_bits, mio_symbol_attribute): Ditto. * resolve.c (resolve_function): Ditto. * match.h: Ditto. * parse.c (decode_statement): Ditto. (parse_interface): Ditto, check for C1203 (name of abstract interface cannot be the same as an intrinsic type). * decl.c (gfc_match_bind_c): Check for NAME= with abstract interfaces. (access_attr_decl): Handle Abstract interfaces. 2007-08-17 Tobias Burnus <burnus@net-b.de> * gfortran.dg/interface_abstract_1.f90: New. From-SVN: r127612
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r--gcc/fortran/interface.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index dbd7538..55cc641 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -175,7 +175,8 @@ syntax:
}
-/* Match one of the five forms of an interface statement. */
+/* Match one of the five F95 forms of an interface statement. The
+ matcher for the abstract interface follows. */
match
gfc_match_interface (void)
@@ -232,6 +233,7 @@ gfc_match_interface (void)
break;
case INTERFACE_NAMELESS:
+ case INTERFACE_ABSTRACT:
break;
}
@@ -239,6 +241,32 @@ gfc_match_interface (void)
}
+
+/* Match a F2003 abstract interface. */
+
+match
+gfc_match_abstract_interface (void)
+{
+ match m;
+
+ if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: ABSTRACT INTERFACE at %C")
+ == FAILURE)
+ return MATCH_ERROR;
+
+ m = gfc_match_eos ();
+
+ if (m != MATCH_YES)
+ {
+ gfc_error ("Syntax error in ABSTRACT INTERFACE statement at %C");
+ return MATCH_ERROR;
+ }
+
+ current_interface.type = INTERFACE_ABSTRACT;
+
+ return m;
+}
+
+
/* Match the different sort of generic-specs that can be present after
the END INTERFACE itself. */
@@ -270,7 +298,8 @@ gfc_match_end_interface (void)
switch (current_interface.type)
{
case INTERFACE_NAMELESS:
- if (type != current_interface.type)
+ case INTERFACE_ABSTRACT:
+ if (type != INTERFACE_NAMELESS)
{
gfc_error ("Expected a nameless interface at %C");
m = MATCH_ERROR;
@@ -2449,6 +2478,7 @@ gfc_add_interface (gfc_symbol *new)
switch (current_interface.type)
{
case INTERFACE_NAMELESS:
+ case INTERFACE_ABSTRACT:
return SUCCESS;
case INTERFACE_INTRINSIC_OP: