Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BracketCloseDefinition"/> class.
 /// </summary>
 /// <param name="name">The name of the definition.</param>
 /// <param name="regex">The regex to match tokens.</param>
 /// <param name="bracketOpenDefinitions">The definitions that can be considered as the matching opening bracket.</param>
 /// <param name="listDelimeterDefinition">The definition for the delimeter for a list of items.</param>
 /// <exception cref="System.ArgumentNullException">bracketOpenDefinitions</exception>
 public BracketCloseDefinition(string name, string regex,
                               IEnumerable <BracketOpenDefinition> bracketOpenDefinitions,
                               GrammerDefinition listDelimeterDefinition = null)
     : base(name, regex)
 {
     if (bracketOpenDefinitions == null)
     {
         throw new ArgumentNullException(nameof(bracketOpenDefinitions));
     }
     this.BracketOpenDefinitions  = bracketOpenDefinitions.ToList();
     this.ListDelimeterDefinition = listDelimeterDefinition;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BracketCloseDefinition"/> class.
 /// </summary>
 /// <param name="name">The name of the definition.</param>
 /// <param name="regex">The regex to match tokens.</param>
 /// <param name="bracketOpenDefinition">The definition that can be considered as the matching opening bracket.</param>
 /// <param name="listDelimeterDefinition">The definition for the delimeter for a list of items.</param>
 public BracketCloseDefinition(string name, string regex,
                               BracketOpenDefinition bracketOpenDefinition,
                               GrammerDefinition listDelimeterDefinition = null)
     : this(name, regex, new[] { bracketOpenDefinition }, listDelimeterDefinition)
 {
 }