コード例 #1
0
 public static void clearActionData(int funcType, int funcNum)
     throws RecognitionException, TokenStreamException {
   switch (funcType) {
     case ACTIVITY_TYPE_FUNC:
       Body_c actact =
           Body_c.getOneACT_ACTOnR698(FunctionBody_c.getOneACT_FNBOnR695(m_testFunc[funcNum]));
       if (actact != null) {
         actact.Clear_blocks();
       }
       break;
     case ACTIVITY_TYPE_BRG:
       actact = Body_c.getOneACT_ACTOnR698(BridgeBody_c.getOneACT_BRBOnR697(m_testBrg[funcNum]));
       if (actact != null) {
         actact.Clear_blocks();
       }
       break;
     case ACTIVITY_TYPE_CB_OP:
       actact =
           Body_c.getOneACT_ACTOnR698(OperationBody_c.getOneACT_OPBOnR696(m_testCBTfr[funcNum]));
       if (actact != null) {
         actact.Clear_blocks();
       }
       break;
     case ACTIVITY_TYPE_IB_OP:
       actact =
           Body_c.getOneACT_ACTOnR698(OperationBody_c.getOneACT_OPBOnR696(m_testIBTfr[funcNum]));
       if (actact != null) {
         actact.Clear_blocks();
       }
       break;
     case ACTIVITY_TYPE_MDA:
       actact =
           Body_c.getOneACT_ACTOnR698(
               DerivedAttributeBody_c.getOneACT_DABOnR693(m_testMDA[funcNum]));
       if (actact != null) {
         actact.Clear_blocks();
       }
       break;
     case ACTIVITY_TYPE_STATE:
       actact =
           Body_c.getOneACT_ACTOnR698(
               StateActionBody_c.getOneACT_SABOnR691(m_testAction[funcNum]));
       if (actact != null) {
         actact.Clear_blocks();
       }
       break;
     case ACTIVITY_TYPE_TRANSITION:
       actact =
           Body_c.getOneACT_ACTOnR698(
               TransitionActionBody_c.getOneACT_TABOnR688(m_testAction[funcNum]));
       if (actact != null) {
         actact.Clear_blocks();
       }
       break;
     default:
       fail("clearAction: Unknown Activity type constant");
   }
   m_requiresClear = false;
 }
コード例 #2
0
 public static void validateBlkStmtVal(int numBlock, int numStmt, int numVal) {
   FunctionBody_c[] fb = FunctionBody_c.FunctionBodyInstances(modelRoot);
   BridgeBody_c[] bb = BridgeBody_c.BridgeBodyInstances(modelRoot);
   OperationBody_c[] ob = OperationBody_c.OperationBodyInstances(modelRoot);
   StateActionBody_c[] sab = StateActionBody_c.StateActionBodyInstances(modelRoot);
   DerivedAttributeBody_c[] dab = DerivedAttributeBody_c.DerivedAttributeBodyInstances(modelRoot);
   TransitionActionBody_c[] tab = TransitionActionBody_c.TransitionActionBodyInstances(modelRoot);
   Body_c b[] = Body_c.BodyInstances(modelRoot);
   assertEquals(
       b.length, fb.length + bb.length + ob.length + sab.length + dab.length + tab.length);
   Block_c[] blk = Block_c.BlockInstances(modelRoot);
   assertEquals(numBlock, blk.length);
   Body_c[] bods = Body_c.BodyInstances(modelRoot);
   for (int i = 0; i < bods.length; ++i)
     assertEquals(IdAssigner.NULL_UUID, bods[i].getCurrentscope_id());
   Statement_c[] st = Statement_c.StatementInstances(modelRoot);
   assertEquals(numStmt, st.length);
   Value_c[] val = Value_c.ValueInstances(modelRoot);
   assertEquals(numVal, val.length);
 }