[Rose-commits] r250 - in branches/rice/src: ROSETTA ROSETTA/Grammar ROSETTA/src backend/unparser/FortranCodeGeneration frontend/OpenFortranParser_SAGE_Connection

fzhao at osp5.lbl.gov fzhao at osp5.lbl.gov
Fri Feb 13 08:13:24 PST 2009


Author: fzhao
Date: 2009-02-13 08:13:23 -0800 (Fri, 13 Feb 2009)
New Revision: 250

Modified:
   branches/rice/src/ROSETTA/Grammar/Expression.code
   branches/rice/src/ROSETTA/Grammar/Statement.code
   branches/rice/src/ROSETTA/Grammar/Type.code
   branches/rice/src/ROSETTA/astNodeList
   branches/rice/src/ROSETTA/src/expression.C
   branches/rice/src/ROSETTA/src/statement.C
   branches/rice/src/ROSETTA/src/type.C
   branches/rice/src/backend/unparser/FortranCodeGeneration/unparseFortran.h
   branches/rice/src/backend/unparser/FortranCodeGeneration/unparseFortran_expressions.C
   branches/rice/src/backend/unparser/FortranCodeGeneration/unparseFortran_statements.C
   branches/rice/src/frontend/OpenFortranParser_SAGE_Connection/FortranParserActionROSE.C
Log:
Added support for CoArray declaration and References (in function call and right-hand of assignment stmt). Added support for allocate statement with image team presented.


Modified: branches/rice/src/ROSETTA/Grammar/Expression.code
===================================================================
--- branches/rice/src/ROSETTA/Grammar/Expression.code	2009-02-13 08:42:19 UTC (rev 249)
+++ branches/rice/src/ROSETTA/Grammar/Expression.code	2009-02-13 16:13:23 UTC (rev 250)
@@ -979,7 +979,13 @@
           SgType* get_type() const;
 HEADER_USER_DEFINED_BINARY_EXPRESSION_END
 
+// FMZ (2/5/2009) Added for CoExpression
 
+HEADER_CO_EXPRESSION_START
+
+HEADER_CO_EXPRESSION_END
+
+
 // #########################################################
 // #########################################################
 //                      SOURCE CODE
@@ -5055,3 +5061,17 @@
 
 SOURCE_USER_DEFINED_BINARY_EXPRESSION_END
 
+
+// FMZ (2/5/200) Added for CoExpression
+SOURCE_CO_EXPRESSION_START
+
+SgType*
+SgCoExpression::get_type() const
+   {
+     SgType* returnType = get_referData()->get_type();
+     ROSE_ASSERT(returnType != NULL);
+     return returnType;
+   }
+
+SOURCE_CO_EXPRESSION_END
+

Modified: branches/rice/src/ROSETTA/Grammar/Statement.code
===================================================================
--- branches/rice/src/ROSETTA/Grammar/Statement.code	2009-02-13 08:42:19 UTC (rev 249)
+++ branches/rice/src/ROSETTA/Grammar/Statement.code	2009-02-13 16:13:23 UTC (rev 250)
@@ -2335,6 +2335,12 @@
           virtual SgName get_mangled_name() const;
 HEADER_USE_STATEMENT_END
 
+// FMZ (2/3/2009): Added for co-array fortran "withteam" stmt
+HEADER_WITH_TEAM_STATEMENT_START 
+
+HEADER_WITH_TEAM_STATEMENT_END
+
+
 HEADER_STOP_OR_PAUSE_STATEMENT_START
      public:
           enum stop_or_pause_enum
@@ -13480,3 +13486,10 @@
 SOURCE_LINEMARKER_PREPROCESSOR_DIRECTIVE_STATEMENT_START
 SOURCE_LINEMARKER_PREPROCESSOR_DIRECTIVE_STATEMENT_END
 
+SOURCE_WITH_TEAM_STATEMEMT_START
+void
+SgWithTeamStatement::post_construction_initialization()
+{
+}
+
+SOURCE_WITH_TEAM_STATEMEMT_END

Modified: branches/rice/src/ROSETTA/Grammar/Type.code
===================================================================
--- branches/rice/src/ROSETTA/Grammar/Type.code	2009-02-13 08:42:19 UTC (rev 249)
+++ branches/rice/src/ROSETTA/Grammar/Type.code	2009-02-13 16:13:23 UTC (rev 250)
@@ -1115,6 +1115,9 @@
      p_typedefs = new SgTypedefSeq();
      ROSE_ASSERT(p_typedefs != NULL);
 
+  //FMZ (2/6/2009): Added a flag for CoArray
+     p_isCoArray = false;
+
   // DQ (12/1/2007): This has been moved to the SgModifierType
   // ROSE_ASSERT(p_type_kind == NULL);
 
@@ -1151,6 +1154,9 @@
   // ROSE_ASSERT(p_type_kind == NULL);
 #endif
 
+     //FMZ (2/6/2009): Added a flag for CoArray
+     p_isCoArray = false;
+
      p_typedefs = new SgTypedefSeq();
      ROSE_ASSERT(p_typedefs != NULL);
      p_typedefs->set_parent(this);

Modified: branches/rice/src/ROSETTA/astNodeList
===================================================================
--- branches/rice/src/ROSETTA/astNodeList	2009-02-13 08:42:19 UTC (rev 249)
+++ branches/rice/src/ROSETTA/astNodeList	2009-02-13 16:13:23 UTC (rev 250)
@@ -598,3 +598,5 @@
 SgImagPartOp
 SgConjugateOp
 SgTypeCafTeam
+SgWithTeamStatement
+SgCoExpression

Modified: branches/rice/src/ROSETTA/src/expression.C
===================================================================
--- branches/rice/src/ROSETTA/src/expression.C	2009-02-13 08:42:19 UTC (rev 249)
+++ branches/rice/src/ROSETTA/src/expression.C	2009-02-13 16:13:23 UTC (rev 250)
@@ -182,6 +182,10 @@
 
   // DQ (1/31/2009): Added Fortran pointer assignment operator (to support pointer assignment statement).
      NEW_TERMINAL_MACRO (PointerAssignOp,       "PointerAssignOp",       "POINTER_ASSIGN_OP" );
+
+  // FMZ (2/6/2009): Added CoArray Reference Expression
+     NEW_TERMINAL_MACRO (CoExpression,    "CoExpression",    "COARRAY_REF_EXPR" );
+
 #endif
 
   // An expression with a designator, used for designated initialization in
@@ -227,7 +231,7 @@
           VarArgCopyOp        | VarArgStartOneOperandOp | NullExpression      | VariantExpression   | SubscriptExpression      |
           ColonShapeExp       | AsteriskShapeExp        | /*UseOnlyExpression |*/ ImpliedDo         | IOItemExpression         |
        /* UseRenameExpression | */ StatementExpression  | AsmOp               | LabelRefExp         | ActualArgumentExpression |
-          UnknownArrayOrFunctionReference,
+          UnknownArrayOrFunctionReference     | CoExpression,
           "Expression","ExpressionTag", false);
 
   // ***********************************************************************
@@ -676,6 +680,9 @@
      UserDefinedUnaryOp.editSubstitute  ( "PRECEDENCE_VALUE", " 2" );
      UserDefinedBinaryOp.editSubstitute ( "PRECEDENCE_VALUE", " 2" );
 
+     // FMZ (2/6/2009): Added for SgCoExpression
+     CoExpression.editSubstitute ( "PRECEDENCE_VALUE", " 2" );
+
 #if 0
   // Extra required Fortran IR nodes
      KeywordValueExpression
@@ -1417,6 +1424,20 @@
      UserDefinedBinaryOp.setDataPrototype ( "SgFunctionSymbol*", "symbol"     , "= NULL",
 				       CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
 
+
+     //FMZ (2/5/2009): Added for CoExpression
+     CoExpression.setFunctionPrototype ( "HEADER_CO_EXPRESSION", "../Grammar/Expression.code" );
+
+     CoExpression.setDataPrototype ( "SgName", "teamId",  "= \"\"", 
+				          CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS,NO_TRAVERSAL,NO_DELETE);
+     CoExpression.setDataPrototype ( "SgExpression*", "teamRank", "= NULL",
+				          CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+     CoExpression.setDataPrototype ( "SgExpression*", "referData", "= NULL",
+				          CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS,DEF_TRAVERSAL, NO_DELETE);
+     CoExpression.setFunctionSource ( "SOURCE_EMPTY_POST_CONSTRUCTION_INITIALIZATION", 
+                                  "../Grammar/Expression.code" );
+
+
 #endif
 
      DesignatedInitializer.setFunctionPrototype ( "HEADER_DESIGNATED_INITIALIZER", "../Grammar/Expression.code" );
@@ -1617,6 +1638,9 @@
      ActualArgumentExpression.setFunctionSource ( "SOURCE_ACTUAL_ARGUMENT_EXPRESSION", "../Grammar/Expression.code" );
      DesignatedInitializer.setFunctionSource ( "SOURCE_DESIGNATED_INITIALIZER", "../Grammar/Expression.code" );
 
+     //FMZ (2/6/2009): Added for CoArray Reference
+     CoExpression.setFunctionSource ( "SOURCE_CO_EXPRESSION", "../Grammar/Expression.code" );
+
 #if USE_UPC_IR_NODES
   // DQ and Liao (6/10/2008): Added new IR nodes specific to UPC.
      UpcLocalsizeofExpression.setFunctionSource ( "SOURCE_UPC_LOCAL_SIZEOF_EXPRESSION", "../Grammar/Expression.code" );

Modified: branches/rice/src/ROSETTA/src/statement.C
===================================================================
--- branches/rice/src/ROSETTA/src/statement.C	2009-02-13 08:42:19 UTC (rev 249)
+++ branches/rice/src/ROSETTA/src/statement.C	2009-02-13 16:13:23 UTC (rev 250)
@@ -156,6 +156,9 @@
      NEW_TERMINAL_MACRO (EndfileStatement,          "EndfileStatement",          "ENDFILE_STATEMENT" );
      NEW_TERMINAL_MACRO (WaitStatement,             "WaitStatement",             "WAIT_STATEMENT" );
 
+  // FMZ (2/3/2009): Added co-array "withteam" stmt
+     NEW_TERMINAL_MACRO (WithTeamStatement,         "WithTeamStatement",         "WITHTEAM_DECL_STMT" );
+
   // DQ (12/18/2007): Added support for Fortran Format statement
      NEW_TERMINAL_MACRO (FormatStatement,           "FormatStatement",           "FORMAT_STATEMENT" );
 
@@ -343,10 +346,11 @@
           UsingDirectiveStatement                 | ClassDeclaration     | ImplicitStatement    | 
           UsingDeclarationStatement               | NamelistStatement    | ImportStatement      |
           FunctionDeclaration                  /* | ModuleStatement */   | ContainsStatement    |
-          C_PreprocessorDirectiveStatement        | FortranIncludeLine,
+          C_PreprocessorDirectiveStatement        | FortranIncludeLine ,
           "DeclarationStatement","DECL_STMT", false);
 
   // DQ (2/2/2006): Support for Fortran IR nodes (contributed by Rice)
+  // FMZ(2/3/2009): Added co-array "withteam" stmt
      NEW_NONTERMINAL_MACRO (Statement,
 			    ScopeStatement       | FunctionTypeTable      | DeclarationStatement            | ExprStatement         |
 			    LabelStatement       | CaseOptionStmt         | TryStmt                         | DefaultOptionStmt     |
@@ -357,7 +361,7 @@
              AssignStatement      | ComputedGotoStatement  | AssignedGotoStatement           |
           /* FortranDo            | */ AllocateStatement   | DeallocateStatement             | UpcNotifyStatement    | 
              UpcWaitStatement     | UpcBarrierStatement    | UpcFenceStatement               | 
-             SequenceStatement,
+             SequenceStatement    | WithTeamStatement,
 			    "Statement","StatementTag", false);
 
           // DQ (11/24/2007): These have been moved to be declarations, so they can appear where only declaration statements are allowed
@@ -2101,6 +2105,17 @@
      FortranDo.setDataPrototype     ( "bool", "has_end_statement", "= false",
                   NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
 
+  //FMZ (2/3/2009): Added for co-array "withteam" stmt
+     //WithTeamStatement.setDataPrototype("SgWithTeamStatement*", "withteamStmt", "= NULL",
+                      //NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+     //WithTeamStatement.setDataPrototype("SgInitializedName", "variable", "",
+		      //NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+     WithTeamStatement.setFunctionPrototype( "HEADER_WITH_TEAM_STATEMENT", "../Grammar/Statement.code" );
+     WithTeamStatement.setFunctionSource ( "SOURCE_WITH_TEAM_STATEMEMT", "../Grammar/Statement.code" );
+
+
+
+
   // Fortran 95 specific construct (different from C/C++ for loop).
      ForAllStatement.setFunctionPrototype ( "HEADER_FORALL_STATEMENT", "../Grammar/Statement.code" );
      ForAllStatement.setDataPrototype ( "SgExprListExp*", "forall_header", "= NULL",

Modified: branches/rice/src/ROSETTA/src/type.C
===================================================================
--- branches/rice/src/ROSETTA/src/type.C	2009-02-13 08:42:19 UTC (rev 249)
+++ branches/rice/src/ROSETTA/src/type.C	2009-02-13 16:13:23 UTC (rev 250)
@@ -154,6 +154,10 @@
      Type.setSubTreeFunctionPrototype               ( "HEADER_GET_MANGLED", "../Grammar/Type.code" );
      Type.excludeFunctionPrototype                  ( "HEADER_GET_MANGLED", "../Grammar/Type.code" );
 
+  // FMZ (2/9/2009): Added a flag for CoArray
+     Type.setDataPrototype("bool","isCoArray","= 0",
+			   NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
+
   // DQ (3/7/2004): This functionality was added to EDG 1.4 (and has not yet been added to EDG_3.3)
   // The purpose it to allow types to be marked internally as being associated with a template 
   // argument.  There may be more information required to nail down more details in this mapping 

Modified: branches/rice/src/backend/unparser/FortranCodeGeneration/unparseFortran.h
===================================================================
--- branches/rice/src/backend/unparser/FortranCodeGeneration/unparseFortran.h	2009-02-13 08:42:19 UTC (rev 249)
+++ branches/rice/src/backend/unparser/FortranCodeGeneration/unparseFortran.h	2009-02-13 16:13:23 UTC (rev 250)
@@ -408,6 +408,9 @@
       //! begin the unparser (unparser.C)
           void run_unparser();
 
+      //FMZ (2/10/2009): Added support for unparsing SgCoExpresson
+          void unparseCoArrayExpression      (SgExpression* expr, SgUnparse_Info& info);
+
 };
 
 #endif

Modified: branches/rice/src/backend/unparser/FortranCodeGeneration/unparseFortran_expressions.C
===================================================================
--- branches/rice/src/backend/unparser/FortranCodeGeneration/unparseFortran_expressions.C	2009-02-13 08:42:19 UTC (rev 249)
+++ branches/rice/src/backend/unparser/FortranCodeGeneration/unparseFortran_expressions.C	2009-02-13 16:13:23 UTC (rev 250)
@@ -142,6 +142,7 @@
        // DQ (10/10/2008): Added support for unser defined unary and binary operators.
           case V_SgUserDefinedUnaryOp:        unparseUserDefinedUnaryOp (expr, info); break;
           case V_SgUserDefinedBinaryOp:       unparseUserDefinedBinaryOp(expr, info); break;
+          case V_SgCoExpression:              unparseCoArrayExpression(expr, info); break;
 
 #if 0
        // DQ (8/15/2007): These are handled in the base class
@@ -2134,3 +2135,47 @@
      unparseBinaryOperator(expr, userDefinedBinaryOp->get_operator_name().str(), info);
    }
 
+
+//FMZ (02/02/2009): Added for unparsing co_expression
+void
+FortranCodeGeneration_locatedNode::unparseCoArrayExpression (SgExpression* expr, SgUnparse_Info& info)
+   {
+    
+    // printf("unparseCoArrayExpresison\n");
+
+    SgCoExpression* coExpr = isSgCoExpression(expr);  
+
+    ROSE_ASSERT(coExpr != NULL);
+
+    SgExpression *dataExpr = coExpr->get_referData();
+   
+    ROSE_ASSERT(dataExpr != NULL);
+
+    SgExpression *teamRank = coExpr->get_teamRank();
+
+    unparseLanguageSpecificExpression(dataExpr,info);
+
+    SgName teamID = coExpr->get_teamId();
+
+    if (teamID!="" || teamRank) {
+        curprint("[");
+    }
+
+    if (teamRank) { 
+        SgIntVal* intRank = isSgIntVal(teamRank);
+
+        if (intRank)
+           unparseIntVal(intRank, info);
+        else
+           unparseLanguageSpecificExpression(teamRank,info);
+    }
+    
+    if (teamID!="") {
+        curprint("@");
+        curprint(teamID.str());
+    }
+
+    if (teamID!="" || teamRank)
+        curprint("]");
+   
+   }

Modified: branches/rice/src/backend/unparser/FortranCodeGeneration/unparseFortran_statements.C
===================================================================
--- branches/rice/src/backend/unparser/FortranCodeGeneration/unparseFortran_statements.C	2009-02-13 08:42:19 UTC (rev 249)
+++ branches/rice/src/backend/unparser/FortranCodeGeneration/unparseFortran_statements.C	2009-02-13 16:13:23 UTC (rev 250)
@@ -3936,6 +3936,11 @@
 
         }
 
+  //FMZ (2/10/2009): Added for CoArray 
+    if (type->get_isCoArray() == true)
+               curprint("[*]");
+
+
   // Unparse the initializers if any exist
   // printf ("In FortranCodeGeneration_locatedNode::unparseVarDecl(initializedName=%p): variable initializer = %p \n",initializedName,init);
      if (init != NULL)

Modified: branches/rice/src/frontend/OpenFortranParser_SAGE_Connection/FortranParserActionROSE.C
===================================================================
--- branches/rice/src/frontend/OpenFortranParser_SAGE_Connection/FortranParserActionROSE.C	2009-02-13 08:42:19 UTC (rev 249)
+++ branches/rice/src/frontend/OpenFortranParser_SAGE_Connection/FortranParserActionROSE.C	2009-02-13 16:13:23 UTC (rev 250)
@@ -6384,6 +6384,22 @@
      outputState("At TOP of R612 c_action_data_ref()");
 #endif
 
+  // FMZ (2/11/2009): Here we could have SgCoExpression in the astExpressionStack
+  // We need to pop out the SgNode to complete whatever need to be done regularly
+  //  (without co-array image selector)
+     bool isCoarray = false;
+     SgCoExpression* coExpr = NULL;
+     if (astExpressionStack.empty() == false) {
+          isCoarray=(astExpressionStack.front()->variantT()==V_SgCoExpression);
+      }
+
+     if (isCoarray) { //need to pop out the CoExpresion first
+           coExpr = isSgCoExpression(astExpressionStack.front());
+           ROSE_ASSERT(coExpr != NULL);
+           astExpressionStack.pop_front();
+        }
+
+
   // ROSE_ASSERT(numPartRef <= 1);
      if (numPartRef > 1)
         {
@@ -6833,7 +6849,16 @@
                printf ("Pushing variable = %p = %s onto the expression stack \n",variable,variable->class_name().c_str());
 
        // Save the expression on the stack
-          astExpressionStack.push_front(variable);
+       //   astExpressionStack.push_front(variable);
+
+       // FMZ (2/10/2009): Need to check if it is a CoArrayExpression
+           if (isCoarray) {
+              coExpr->set_referData(variable);
+              setSourcePosition(coExpr,nameToken);
+              astExpressionStack.push_front(coExpr);
+            } else
+              astExpressionStack.push_front(variable);
+
         }
 
   // Need to pop token from stack
@@ -16914,25 +16939,55 @@
 #endif
 
 // Laks 2009.01.13
-void c_action_co_array_spec() {
+// FMZ (2/6/2009): Added function body
+void c_action_co_array_spec() 
+    {
+     if ( SgProject::get_verbose() > DEBUG_RULE_COMMENT_LEVEL )
+          printf ("In c_action_co_array_spec() \n");
 
-}
+     if (astTypeStack.empty() == true) //scalar co-array, push a new one to the stack
+        {
+          //printf("the basetype is %s\n",(astBaseTypeStack.front())->sage_class_name());
+          SgType* newType = SgTypeVoid::createType();
+          astTypeStack.push_front(newType);
+        }
 
+      SgType * currType = astTypeStack.front();
+      currType->set_isCoArray(true);
+   }
+
+
 // Laks 2009.01.14
-void c_action_rice_co_shape_spec(const char *arg) {
-  printf("FortranParserActionROSE.C:c_action_rice_co_shape_spec():%s\n", arg);
-}
- 
-void c_action_allocate_co_array_spec() {
-}
+// FMZ (2/6/2009): currently seems we only need to print out the debug info.
+void c_action_rice_co_shape_spec(const char *arg) 
+    {
+      //printf("FortranParserActionROSE.C:c_action_rice_co_shape_spec():%s\n", arg);
+     if ( SgProject::get_verbose() > DEBUG_RULE_COMMENT_LEVEL )
+          printf ("In c_action_co_shape_spec() \n");
+    }
 
+//FMZ (2/12/2009):  Currently using "c_action_rice_allocate_co_array_spec"
+void c_action_allocate_co_array_spec() 
+    {
+     if ( SgProject::get_verbose() > DEBUG_RULE_COMMENT_LEVEL )
+          printf ("In c_action_allocate_co_array_spec() \n");
+    }
+
 /**
  * carg_0 is a flag about the coarray status:
  *   0 --> no team image
  *   1 --> using a team
  *   .... --> unused
  */
-void c_action_rice_image_selector(Token_t *team_id) {
+// FMZ (2/9/2009): possible cases: 
+/**
+ *     variable declared: A(:)[*], SA[*]
+ *     variable refer:    A(12)[1 at team1], SA[1 at team1] A(12)[1] and SA[1]
+ *     generate:          SgCoExpression(teamID, teamRank, Expression*)
+*/
+void c_action_rice_image_selector(Token_t *team_id) 
+    {
+#if 0
   if(team_id == NULL)
      printf("Rice image selector without team\n");
   else 
@@ -16940,21 +16995,73 @@
 
   // Laks: needs to throw away the expression to pass the assignment_stmt() assertion
   astExpressionStack.pop_front();
-}
+#endif
+       if ( SgProject::get_verbose() > DEBUG_COMMENT_LEVEL )
+          printf ("In c_action_declaration_construct() \n");
 
+       SgExpression* rankExpr = astExpressionStack.front();
+
+#if 0
+    { //For Testing
+      int tmpindx=(int)(rankExpr->variantT());
+      printf("the rankExpr is %s\n",Cxx_GrammarTerminalNames[tmpindx].name.c_str() );
+      printf("shoule be an integer value node. \n");
+    }
+#endif
+
+       // pop out the expresison of the "rank"
+       astExpressionStack.pop_front();
+
+       // The data reference part (such as "A(4)" in "A(4)[me+1 at ocean]") is yet to be processed
+       // currently, only "teamRank" and "teamId" (such as "me+1" "ocean") are available
+
+       SgExpression* dataExpr = NULL;
+
+       SgCoExpression* coExpr = new SgCoExpression("",rankExpr,dataExpr);
+
+       if (team_id) {
+              coExpr->set_teamId(team_id->text);
+              setSourcePosition(coExpr,team_id);
+        }
+
+       astExpressionStack.push_front(coExpr);
+   }
+  
 /**
  * carg_0 is a flag about the coarray status:
  *   0 --> no team image
  *   1 --> using a team
  *   .... --> unused
  */
+//FMZ (2/12/2009): Added CoArray image team ID
 void c_action_rice_allocate_co_array_spec(Token_t *team_id) {
+#if 0
   if(team_id == NULL)
      printf("Rice allocation without team\n");
   else 
      printf("Rice allocation with team: %s\n", team_id->text);
-}
+#endif
+     if ( SgProject::get_verbose() > DEBUG_COMMENT_LEVEL )
+          printf ("In c_action_rice_allocate_co_array_spec() \n");
 
+     SgExpression* dataExpr = astExpressionStack.front();
+
+     astExpressionStack.pop_front();
+
+     SgCoExpression* coExpr = new SgCoExpression(team_id->text,NULL,dataExpr);
+
+     coExpr->set_parent(dataExpr->get_parent());
+
+     dataExpr->set_parent(coExpr);
+
+     if(team_id == NULL) //set the  position based on the subexpression's location
+         resetSourcePosition(coExpr,dataExpr);
+     else //set the position based on the Token_t
+         setSourcePosition(coExpr,team_id);
+
+     astExpressionStack.push_front(coExpr);
+   }
+
 /**
  * Rice's with team statemetn:
  * @param label: label of the statement



More information about the Rose-commits mailing list