Next: Creating Fortran statements and
Up: Statements
Previous: Fortran declarations
The following function are available to cast a TSF expression into another
type :
-
TOVALUE(n)
-
The function casts the content of
n into an integer, a real or a string:
- if n is an integer, a real or a string then returns n.
- if n is an AST of variant "int_cst" (i.e. an integer constant)
then returns the integer value of n.
- if n is an AST of variant "real_cst" (i.e. a simple precision
constant) then returns a string that contains the value of n. (See
TOREAL to obtain a real value)
- if n is an AST of variant "double_cst" (i.e. a double precision
constant) then returns a string that contains the value of n. (See
TOREAL to obtain a real value)
- if n is an AST of variant "fstring_cst" then returns a string
that contains the value of n.
- if n is an AST of variant "name" then returns a string
that contains the Fortran symbol associated to n.
- else returns FALSE
-
TOINT(n)
-
The function casts the content of
n into an integer value. (see TOVALUE for more details about AST
cases)
-
TOREAL(n)
-
The function casts the content of
n into an real value. (see TOVALUE for more details about AST
cases)
-
TOSTRING(n)
-
The function casts the content of
n into a string. (see TOVALUE for more details about AST
cases)
-
TOTREE(n)
-
The function casts the content of
n into a AST.
- if n is an integer (resp. a real or a string) then return a
node of variant "int_cst" (resp. "real_cst" or "fstring_cst").
- if n is an AST then return n.
- else return FALSE.
Next: Creating Fortran statements and
Up: Statements
Previous: Fortran declarations
Yann Mevel
1999-04-30