diff options
author | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-30 21:45:02 +0000 |
---|---|---|
committer | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-30 21:45:02 +0000 |
commit | 59e2a584a5a474f8e332869f04ce7b8c22b42921 (patch) | |
tree | 12d8a378f5315443b91acd73a7def97e1a6accf5 /gcc/fortran/intrinsic.texi | |
parent | acc0a673001763578afb6999d7fa4a895d5765b0 (diff) | |
download | gcc-59e2a584a5a474f8e332869f04ce7b8c22b42921.tar.gz |
* intrinsic.c (add_functions): Add SELECTED_CHAR_KIND intrinsic.
* intrinsic.h (gfc_check_selected_char_kind,
gfc_simplify_selected_char_kind): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_SC_KIND.
* trans.h (gfor_fndecl_sc_kind): New function decl.
* trans-decl.c (gfor_fndecl_sc_kind): Build new decl.
* arith.c (gfc_compare_with_Cstring): New function.
* arith.h (gfc_compare_with_Cstring): New prototype.
* check.c (gfc_check_selected_char_kind): New function.
* primary.c (match_string_constant, match_kind_param): Mark
symbols used as literal constant kind param as referenced.
* trans-intrinsic.c (gfc_conv_intrinsic_sc_kind): New function.
(gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_sc_kind.
* intrinsic.texi (SELECTED_CHAR_KIND): Document new intrinsic.
* simplify.c (gfc_simplify_selected_char_kind): New function.
* intrinsics/selected_char_kind.c: New file.
* Makefile.am: Add intrinsics/selected_char_kind.c.
* Makefile.in: Regenerate.
* gfortran.dg/selected_char_kind_1.f90: New test.
* gfortran.dg/selected_char_kind_2.f90: New test.
* gfortran.dg/selected_char_kind_3.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134839 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/intrinsic.texi')
-rw-r--r-- | gcc/fortran/intrinsic.texi | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi index c2630b249be..9d3553da111 100644 --- a/gcc/fortran/intrinsic.texi +++ b/gcc/fortran/intrinsic.texi @@ -225,6 +225,7 @@ Some basic guidelines for editing this document: * @code{SCAN}: SCAN, Scan a string for the presence of a set of characters * @code{SECNDS}: SECNDS, Time function * @code{SECOND}: SECOND, CPU time function +* @code{SELECTED_CHAR_KIND}: SELECTED_CHAR_KIND, Choose character kind * @code{SELECTED_INT_KIND}: SELECTED_INT_KIND, Choose integer kind * @code{SELECTED_REAL_KIND}: SELECTED_REAL_KIND, Choose real kind * @code{SET_EXPONENT}: SET_EXPONENT, Set the exponent of the model @@ -9256,6 +9257,48 @@ seconds. +@node SELECTED_CHAR_KIND +@section @code{SELECTED_CHAR_KIND} --- Choose character kind +@fnindex SELECTED_CHAR_KIND +@cindex character kind +@cindex kind, character + +@table @asis +@item @emph{Description}: + +@code{SELECTED_CHAR_KIND(NAME)} returns the kind value for the character +set named @var{NAME}, if a character set with such a name is supported, +or @math{-1} otherwise. Currently, supported character sets include +``ASCII'' and ``DEFAULT'', which are equivalent. + +@item @emph{Standard}: +Fortran 2003 and later + +@item @emph{Class}: +Transformational function + +@item @emph{Syntax}: +@code{RESULT = SELECTED_CHAR_KIND(NAME)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .70 +@item @var{NAME} @tab Shall be a scalar and of the default character type. +@end multitable + +@item @emph{Example}: +@smallexample +program ascii_kind + integer,parameter :: ascii = selected_char_kind("ascii") + character(kind=ascii, len=26) :: s + + s = ascii_"abcdefghijklmnopqrstuvwxyz" + print *, s +end program ascii_kind +@end smallexample +@end table + + + @node SELECTED_INT_KIND @section @code{SELECTED_INT_KIND} --- Choose integer kind @fnindex SELECTED_INT_KIND |