Ejemplo n.º 1
0
        /// <summary>
        /// Creates a sequence of rules.
        /// </summary>
        /// <param name="rules">
        /// Set of rule to execute in sequence.
        /// </param>
        /// <remarks>
        /// <code>
        /// [EBNF]
        /// rule := A B C
        ///
        /// [C#]
        /// IRule rule = Rules.Seq(A,B,C);
        /// </code>
        /// </remarks>
        /// <returns>
        /// An <see cref="SequenceRule"/> instance implementing
        /// the sequence of rules.
        /// </returns>
        public static SequenceRule Seq(params IRule[] rules)
        {
            SequenceRule seq = new SequenceRule();

            foreach (IRule rule in rules)
            {
                seq.Rules.Add(rule);
            }
            return(seq);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a sequence of rules.
 /// </summary>
 /// <param name="rules">
 /// Set of rule to execute in sequence.
 /// </param>
 /// <remarks>
 /// <code>
 /// [EBNF]
 /// rule := A B C
 /// 
 /// [C#]
 /// IRule rule = Rules.Seq(A,B,C);
 /// </code>
 /// </remarks>
 /// <returns>
 /// An <see cref="SequenceRule"/> instance implementing
 /// the sequence of rules.
 /// </returns>
 public static SequenceRule Seq(params IRule[] rules)
 {
     SequenceRule seq = new SequenceRule();
     foreach(IRule rule in rules)
     {
         seq.Rules.Add(rule);
     }
     return seq;
 }