Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NameExpression"/> class.
        /// </summary>
        /// <param name="identifier">The name of the referenced expression.</param>
        public NameExpression(Identifier identifier)
        {
            if (identifier == null)
            {
                throw new ArgumentNullException(nameof(identifier));
            }

            this.Identifier = identifier;
        }
Example #2
0
        public Rule(Identifier identifier, Expression expression, IEnumerable<Identifier> flags)
        {
            if (expression == null)
            {
                throw new ArgumentNullException("expression");
            }

            this.identifier = identifier;
            this.expression = expression;
            this.flags = flags.ToList().AsReadOnly();
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PrefixedExpression"/> class.
        /// </summary>
        /// <param name="prefix">The name given to this expression as a prefix.</param>
        /// <param name="expression">The expression that has been prefixed.</param>
        public PrefixedExpression(Identifier prefix, Expression expression)
        {
            if (prefix == null)
            {
                throw new ArgumentNullException(nameof(prefix));
            }

            if (expression == null)
            {
                throw new ArgumentNullException(nameof(expression));
            }

            this.Prefix = prefix;
            this.Expression = expression;
        }
Example #4
0
        public Rule(Identifier identifier, Expression expression, IEnumerable<Identifier> flags)
        {
            if (identifier == null)
            {
                throw new ArgumentNullException(nameof(identifier));
            }

            if (expression == null)
            {
                throw new ArgumentNullException(nameof(expression));
            }

            this.Identifier = identifier;
            this.Expression = expression;
            this.Flags = (flags ?? Enumerable.Empty<Identifier>()).ToList().AsReadOnly();
        }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PrefixedExpression"/> class.
 /// </summary>
 /// <param name="prefix">The name given to this expression as a prefix.</param>
 /// <param name="expression">The expression that has been prefixed.</param>
 public PrefixedExpression(Identifier prefix, Expression expression)
 {
     this.Prefix     = prefix ?? throw new ArgumentNullException(nameof(prefix));
     this.Expression = expression ?? throw new ArgumentNullException(nameof(expression));
 }