示例#1
0
 public void Initialise(MHParseNode p, MHEngine engine)
 {
     if (p.NodeType == MHParseNode.PNInt)
     {
         m_nColIndex = p.GetIntValue();
     }
     else
     {
         p.GetStringValue(m_ColStr);
     }
 }
示例#2
0
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine);
            m_nComponentTag = p.GetNamedArg(ASN1Codes.C_COMPONENT_TAG).GetArgN(0).GetIntValue();
            MHParseNode pOrigVol = p.GetNamedArg(ASN1Codes.C_ORIGINAL_VOLUME);

            if (pOrigVol != null)
            {
                m_nOriginalVol = pOrigVol.GetIntValue();
            }
        }
示例#3
0
 public void Initialise(MHParseNode arg, MHEngine engine)
 {
     if (arg.NodeType == MHParseNode.PNTagged && arg.GetTagNo() == ASN1Codes.C_INDIRECTREFERENCE)
     {
         // Indirect reference.
         m_fIsDirect = false;
         m_Indirect.Initialise(arg.GetArgN(0), engine);
     }
     else
     { // Simple integer value.
         m_fIsDirect = true;
         m_nDirect   = arg.GetIntValue();
     }
 }
示例#4
0
 public void Initialise(MHParseNode p, MHEngine engine)
 {
     if (p.NodeType == MHParseNode.PNInt)
     {
         m_nObjectNo = p.GetIntValue();
         // Set the group id to the id of this group.
         m_GroupId.Copy(engine.GetGroupId());
     }
     else if (p.NodeType == MHParseNode.PNSeq)
     {
         MHParseNode   pFirst  = p.GetSeqN(0);
         MHOctetString groupId = new MHOctetString();
         pFirst.GetStringValue(m_GroupId);
         m_nObjectNo = p.GetSeqN(1).GetIntValue();
     }
     else
     {
         p.Failure("ObjectRef: Argument is not int or sequence");
     }
 }
示例#5
0
 public override void Initialise(MHParseNode p, MHEngine engine)
 {
     base.Initialise(p, engine); // Target
     // The next one may be present but NULL in binary.
     if (p.GetArgCount() > 1)
     {
         MHParseNode pCtag = p.GetArgN(1);
         if (pCtag.NodeType == MHParseNode.PNInt)
         {
             m_fIsTagged      = true;
             m_nConnectionTag = pCtag.GetIntValue();
         }
         else
         {
             Logging.Assert(pCtag.NodeType == MHParseNode.PNNull);
         }
     }
     if (p.GetArgCount() > 2)
     {
         MHParseNode pTrEff = p.GetArgN(2);
         m_nTransitionEffect = pTrEff.GetIntValue();
     }
 }
示例#6
0
        // Set this up from the parse tree.
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine);
            // The link condition is encoded differently in the binary and text representations.
            MHParseNode pLinkCond = p.GetNamedArg(ASN1Codes.C_LINK_CONDITION);

            if (pLinkCond != null)
            {                                                           // Only in binary.
                m_EventSource.Initialise(pLinkCond.GetArgN(0), engine); // Event source
                m_nEventType = pLinkCond.GetArgN(1).GetEnumValue();     // Event type
                // The event data is optional and type-dependent.
                if (pLinkCond.GetArgCount() >= 3)
                {
                    MHParseNode pEventData = pLinkCond.GetArgN(2);
                    switch (pEventData.NodeType)
                    {
                    case MHParseNode.PNBool: m_EventData.Bool = pEventData.GetBoolValue(); m_EventData.Type = MHUnion.U_Bool; break;

                    case MHParseNode.PNInt: m_EventData.Int = pEventData.GetIntValue(); m_EventData.Type = MHUnion.U_Int; break;

                    case MHParseNode.PNString: pEventData.GetStringValue(m_EventData.String); m_EventData.Type = MHUnion.U_String; break;

                    default: pEventData.Failure("Unknown type of event data"); break;
                    }
                }
            }
            else
            {                                                                       // Only in text.
                MHParseNode pEventSource = p.GetNamedArg(ASN1Codes.P_EVENT_SOURCE); // Event source
                if (pEventSource == null)
                {
                    p.Failure("Missing :EventSource");
                }
                m_EventSource.Initialise(pEventSource.GetArgN(0), engine);
                MHParseNode pEventType = p.GetNamedArg(ASN1Codes.P_EVENT_TYPE); // Event type
                if (pEventType == null)
                {
                    p.Failure("Missing :EventType");
                }
                m_nEventType = pEventType.GetArgN(0).GetEnumValue();
                MHParseNode pEventData = p.GetNamedArg(ASN1Codes.P_EVENT_DATA); // Event data - optional
                if (pEventData != null)
                {
                    MHParseNode pEventDataArg = pEventData.GetArgN(0);
                    switch (pEventDataArg.NodeType)
                    {
                    case MHParseNode.PNBool: m_EventData.Bool = pEventDataArg.GetBoolValue(); m_EventData.Type = MHUnion.U_Bool; break;

                    case MHParseNode.PNInt: m_EventData.Int = pEventDataArg.GetIntValue(); m_EventData.Type = MHUnion.U_Int; break;

                    case MHParseNode.PNString: pEventDataArg.GetStringValue(m_EventData.String); m_EventData.Type = MHUnion.U_String; break;

                    default: pEventDataArg.Failure("Unknown type of event data"); break;
                    }
                }
            }

            MHParseNode pLinkEffect = p.GetNamedArg(ASN1Codes.C_LINK_EFFECT);

            m_LinkEffect.Initialise(pLinkEffect, engine);
        }