Example #1
0
 public void SetAlternate(RuleStart alternate)
 {
     AlternateRule = alternate;
     if (alternate != null)
     {
         alternate.SetAlternateBack(this);
     }
 }
Example #2
0
        private void DeleteStartRule(RuleStart rs)
        {
            BNFRule   bnfRl   = rs.GetRuleConnect();
            RuleStart AltNext = rs.GetAlternate();
            RuleStart AltBack = rs.GetAlternateBack();

            if (AltBack != null)
            {
                AltBack.SetAlternate(AltNext);
            }
            if (AltNext != null)
            {
                AltNext.SetAlternateBack(AltBack);
            }
            int index = bnfRl.Index;

            m_Rules.RemoveAt(index);
        }
Example #3
0
 private void ConnectAlternateStartRules(MyArrayList StartRules)
 {
     if (StartRules.Count == 1)
     {
         RuleStart sr1 = (RuleStart)StartRules[0];
         sr1.SetAlternate(null);
         sr1.SetAlternateBack(null);
     }
     for (int i = 0; i < StartRules.Count - 1; i++)
     {
         RuleStart sr1 = (RuleStart)StartRules[i];
         RuleStart sr2 = (RuleStart)StartRules[i + 1];
         if (sr2 != null)
         {
             sr2.SetAlternate(null);
         }
         sr1.SetAlternateBack(null);
         sr1.SetAlternate(sr2);
     }
 }