Skip to content

Commit

Permalink
Added conversions for DOUBLECOMPLEX.
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Rasmussen committed Mar 22, 2017
1 parent 429aa34 commit 993c61a
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions fortran/trans/fast2sage.str
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ signature
TYPE_FLOAT : TYPE_FLOAT
TYPE_DOUBLE : TYPE_DOUBLE
TYPE_COMPLEX : TYPE_COMPLEX
TYPE_DOUBLE_COMPLEX : TYPE_DOUBLE_COMPLEX
TYPE_BOOL : TYPE_BOOL
TYPE_CHAR : TYPE_CHAR
TYPE_LAST : TYPE_LAST
Expand Down Expand Up @@ -248,17 +249,17 @@ sg-fortran-operator =
<+ ? FORTRAN_INTRINSIC_GT() ; ! SgToken_ROSE_Fortran_Operators(10015)
<+ ? FORTRAN_INTRINSIC_NOT() ; ! SgToken_ROSE_Fortran_Operators(10016)

// e_unknown=0,e_void,e_int,e_float,e_double,e_complex,e_bool,e_char,e_last
// e_unknown=0,e_void,e_int,e_float,e_double,e_complex,e_double_complex,e_bool,e_char,e_last
sg-type-enum =
? TYPE_UNKNOWN() ; ! SgUntypedType_type_enum(0)
<+ ? TYPE_VOID() ; ! SgUntypedType_type_enum(1)
<+ ? TYPE_INT() ; ! SgUntypedType_type_enum(2)
<+ ? TYPE_FLOAT() ; ! SgUntypedType_type_enum(3)
<+ ? TYPE_DOUBLE() ; ! SgUntypedType_type_enum(4)
<+ ? TYPE_COMPLEX() ; ! SgUntypedType_type_enum(5)
<+ ? TYPE_BOOL() ; ! SgUntypedType_type_enum(6)
<+ ? TYPE_CHAR() ; ! SgUntypedType_type_enum(7)
//TODO - DOUBLECOMPLEX
<+ ? TYPE_DOUBLE_COMPLEX() ; ! SgUntypedType_type_enum(6)
<+ ? TYPE_BOOL() ; ! SgUntypedType_type_enum(7)
<+ ? TYPE_CHAR() ; ! SgUntypedType_type_enum(8)

sg-build-void-type = ! SgUntypedType("void",<sg-expression>NULL_EXPR(),0,0,0,
1,0,0,<sg-expression>NULL_EXPR(),"",0,<sg-type-enum>TYPE_VOID())
Expand All @@ -272,6 +273,8 @@ sg-build-intrinsic-type =
1,0,0, <sg-expression>NULL_EXPR(),"",0,<sg-type-enum>TYPE_DOUBLE())
<+ ? COMPLEX() ; ! SgUntypedType("complex",<sg-expression>NULL_EXPR(),0,0,0,
1,0,0, <sg-expression>NULL_EXPR(),"",0,<sg-type-enum>TYPE_COMPLEX())
<+ ? DOUBLECOMPLEX() ; ! SgUntypedType("double_complex",<sg-expression>NULL_EXPR(),0,0,0,
1,0,0, <sg-expression>NULL_EXPR(),"",0,<sg-type-enum>TYPE_DOUBLE_COMPLEX())
<+ ? LOGICAL() ; ! SgUntypedType("bool", <sg-expression>NULL_EXPR(),0,0,0,
1,0,0, <sg-expression>NULL_EXPR(),"",0,<sg-type-enum>TYPE_BOOL())
<+ ? CHARACTER() ; ! SgUntypedType("char", <sg-expression>NULL_EXPR(),0,0,0,
Expand All @@ -282,14 +285,12 @@ sg-build-intrinsic-type(|kind) =
1,0,0, <sg-expression>NULL_EXPR(),"",0,<sg-type-enum>TYPE_INT())
<+ ? REAL() ; ! SgUntypedType("float", kind,1,0,0,
1,0,0, <sg-expression>NULL_EXPR(),"",0,<sg-type-enum>TYPE_FLOAT())
<+ ? DOUBLEPRECISION() ; ! SgUntypedType("double", kind,1,0,0,
1,0,0, <sg-expression>NULL_EXPR(),"",0,<sg-type-enum>TYPE_DOUBLE())
<+ ? COMPLEX() ; ! SgUntypedType("complex", kind,1,0,0,
1,0,0, <sg-expression>NULL_EXPR(),"",0,<sg-type-enum>TYPE_COMPLEX())
<+ ? LOGICAL() ; ! SgUntypedType("bool", kind,1,0,0,
1,0,0, <sg-expression>NULL_EXPR(),"",0,<sg-type-enum>TYPE_BOOL())
<+ ? CHARACTER() ; ! SgUntypedType("char", kind,1,0,0,
1,0,0, <sg-expression>NULL_EXPR(),"",0,<sg-type-enum>TYPE_CHAR())
<+ ? CHARACTER() ; ! SgUntypedType("char", <sg-expression>NULL_EXPR(),0,0,0,
1,0,0, kind,"",1,<sg-type-enum>TYPE_CHAR()) /* kind actually length here */

//R201
fast-to-sage: Program(units)
Expand All @@ -310,6 +311,8 @@ fast-to-sage: DOUBLEPRECISION() -> <sg-build-intrinsic-type> DOUBLE
fast-to-sage: COMPLEX() -> <sg-build-intrinsic-type> COMPLEX()
fast-to-sage: COMPLEX(kind) -> <sg-build-intrinsic-type(|kind)> COMPLEX()

fast-to-sage: DOUBLECOMPLEX() -> <sg-build-intrinsic-type> DOUBLECOMPLEX()

fast-to-sage: LOGICAL() -> <sg-build-intrinsic-type> LOGICAL()
fast-to-sage: LOGICAL(kind) -> <sg-build-intrinsic-type(|kind)> LOGICAL()

Expand Down

0 comments on commit 993c61a

Please sign in to comment.