示例#1
0
 private Repeat(IExpression expression, RepeatKind kind, int?min = null, int?max = null)
 {
     Expression = expression;
     Kind       = kind;
     Min        = min;
     Max        = max;
 }
        /// <summary>
        /// Constructor.
        /// </summary>
        public RepeatSpecification
        (
            RepeatKind kind
        )
            : this()
        {
            Sure.Defined(kind, nameof(kind));

            Kind = kind;
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public RepeatSpecification
        (
            RepeatKind kind,
            int index
        )
            : this()
        {
            Sure.Defined(kind, nameof(kind));
            Sure.NonNegative(index, nameof(index));

            Kind  = kind;
            Index = index;
        }
示例#4
0
        public TagElement(string tagName, RepeatKind repeat, bool isOptional)
        {
            TagName    = tagName;
            Repeat     = repeat;
            IsOptional = isOptional;

            if (Repeat == RepeatKind.Star)
            {
                IsOptional = true;
            }
            if (repeat == RepeatKind.Plus && IsOptional)
            {
                Repeat = RepeatKind.Star;
            }
        }
示例#5
0
 public NonterminalSymbol(int id, string name, bool visible, RepeatKind repeat)
     : base(id, name, visible)
 {
     Repeat = repeat;
 }
示例#6
0
 public TagElement(string tagName, RepeatKind repeat) : this(tagName, repeat, false)
 {
 }